Android Plugin

Discussion and support for individual OSA plugins
Message
Author
User avatar
bwoodworth
Site Admin
Posts: 1563
Joined: Tue May 04, 2010 6:49 am
Location: California

Re: Android Plugin

#21 Post by bwoodworth » Fri May 24, 2013 8:44 am

I would lean toward your first option. Like you said the functionality in your app would only need to be configured occasionally and the mobile UI is something that would get used most of the time.
Brian

Automate
Posts: 1691
Joined: Sat Dec 11, 2010 1:44 pm
Location: US

Re: Android Plugin

#22 Post by Automate » Fri May 24, 2013 8:49 am

Same here

User avatar
Mat
Posts: 501
Joined: Thu Aug 09, 2012 2:35 pm
Location: UK

Re: Android Plugin

#23 Post by Mat » Fri May 24, 2013 2:00 pm

It sounds like you have done a lot more Android development than I have... I think you have made yourself the official Android developer :D When I started on my App I thought about doing a custom android app, but after a load of reading I opted for a stub app that seems to be a common approach, that way additional functionality where required could be added to the mobile web, if someone decided to implement a IOS version then they wouldn't have re-write the code, yes you could use something like phonegap but but that has a learning curve in itself. The only element which I could achieve without native support was the voice recognition. Im not sure if you read the previous threads on my app but a number of people wanted to use it on a tablet, so if you do go ahead and merge the apps it worth bearing in mind about that.

fiveHellions
Posts: 86
Joined: Wed Feb 06, 2013 12:12 pm

Re: Android Plugin

#24 Post by fiveHellions » Fri May 24, 2013 3:39 pm

I've done a decent bit of Android programming, but I still consider myself a hack at it. I figure out what I want to do and go find examples and make them work in my app. I still have a long way to go in learning the best and most efficient ways of doing things.

I agree that a webview to the mobile ui is the best way to go right now since any update can be made to it can be shared across all platforms. Getting an interface much better would require alot of work since you would probably be getting into making it user customizable. So for now I'm gonna concentrate on other areas like the tasker integration and maybe widgets to easily control objects from your homescreen. And keep the mobile ui around for a while.

Whats wrong with it on a tablet? Besides having alot more space that could be better used. It works just fine. I'm using it on my nexus 7. Once the regular web ui has all the features that it sounds like are planned for it, we can give tablet users the choice to use the mobile ui or the main web ui instead to make better use of a tablets space.

Speaking of the mobile ui I think I found a bug
Image

I think this part of the index.aspx is the problem

Code: Select all

                  $.each(data.Methods, function (i, meth) {
                      $("#callback").append('<a id="btn' + i + '"href="#" data-role="button" onclick="runMethod(\'' + object + '\',\'' + meth + '\', \'\',\'\');" >' + meth + '</a>');
                      $('#btn' + i).button();
                  });
should be

Code: Select all

                  $.each(data.Methods, function (i, meth) {
                      $("#callback").append('<a id="btn' + i + '"href="#" data-role="button" onclick="runMethod(\'' + object + '\',\'' + meth.MethodName + '\', \'\',\'\');" >' + meth.MethodName + '</a>');
                      $('#btn' + i).button();
                  });
When I get a chance I can update the code. I already fixed it on my server and I can now run any methods that don't need parameters.

User avatar
bwoodworth
Site Admin
Posts: 1563
Joined: Tue May 04, 2010 6:49 am
Location: California

Re: Android Plugin

#25 Post by bwoodworth » Fri May 24, 2013 4:08 pm

Thanks. I put the fix in for that bug.

btw, the Tasker plugin is working great to set my PERSON object to HERE and AWAY.
Brian

User avatar
Mat
Posts: 501
Joined: Thu Aug 09, 2012 2:35 pm
Location: UK

Re: Android Plugin

#26 Post by Mat » Wed May 29, 2013 3:33 pm

I haven't had chance to have a play with your Android stuff yet so it may already do it, however if you could get geo-location working in there that would be great that way :D

fiveHellions
Posts: 86
Joined: Wed Feb 06, 2013 12:12 pm

Re: Android Plugin

#27 Post by fiveHellions » Thu May 30, 2013 8:02 am

There is nothing currently built in the app for geo location, but it can easily be done with tasker. I currently have it set up to do it.

I may add it straight into the app later on for those that don't have tasker. Google released a new geo fencing api at google io this year. Looks really easy to implement and they handle all the complex code for you like when to use cell location and when to use gps when you get close to a defined area so it should be good on the battery. This would be a good project to play around with it.

I'd like to eventually have alot of common events like geo location, when your on a call, incoming text, notifications ect built into the app so its easy for everybody. Then still have tasker integration to take it even further. But that will probably be way down the road.

fiveHellions
Posts: 86
Joined: Wed Feb 06, 2013 12:12 pm

Re: Android Plugin

#28 Post by fiveHellions » Thu May 30, 2013 8:36 am

New Version that combines the old OSA android app and this new app together. I still have some work to do to make them look more like the same app. I will probably theme my part to look more like the web ui. Instead of having a dark web ui and then the light theme that I currently have.

You can download the new apk here. https://dl.dropboxusercontent.com/u/433 ... ension.apk

New version of Android OSA plugin here. http://www.opensourceautomation.com/plu ... 08f522c03c

This version also allows you to trigger tasker tasks from OSA. Once you update the Android plugin the Android Device Objects now have and EXECUTE command. Simply send the name on the tasker task you want to execute in the first parameter. Be careful because it is CASE SENSITIVE. Also I had a space at the end of one of my task names and didn't realize it. Took me forever to realize that is why it wasn't executing that task.

Not sure what all this can be used for. But as a test I created a task that turns on my phone and unlocks it and launches an app that I use as a remote for my media center. Tied that in the the stopped event on my media center object. So when the playing media stops it launches the remote app. I will probably never use it much but it was a neat little proof of concept.

Datahead
Posts: 711
Joined: Fri Jan 27, 2012 6:50 am
Location: San Marcos, Ca.

Re: Android Plugin

#29 Post by Datahead » Thu May 30, 2013 8:47 pm

As I have been working on a arduino temperature sensor array and weather station for OSA, I haven't had the chance to try your Plugin and app. But in the interim of waiting on parts from China I figured I'd give it a go. I have a quick question though. Does one need to have Tasker for the app to work or does it run on its own?

Ron

fiveHellions
Posts: 86
Joined: Wed Feb 06, 2013 12:12 pm

Re: Android Plugin

#30 Post by fiveHellions » Fri May 31, 2013 5:31 am

It runs on it's own, but it is a bit more limited in what it can do without tasker.

Without tasker OSA can send alerts to your phone or tablet. You can have these alerts either put a notification in your notification pull down or play a sound or speak the message. Now that I have combined it with the android app Mat wrote, it will also be a portal to the mobile website and have speech recognition to send commands to OSA.

If you have tasker, you will also be able to have any event (incoming call, text, location, ect..) on your phone call either an object method or namedscript in OSA. You will also have the ability for OSA to control your phone by sending a command to execute a tasker task.

So it depends on what you want to accomplish if you will need tasker or not.

Post Reply