What are you doing with your Phidget on Android?

Supporting 4.1 and up
MarqTwine
Phidgetly
Posts: 17
Joined: Mon Dec 27, 2010 11:45 pm
Contact:

What are you doing with your Phidget on Android?

Postby MarqTwine » Mon Jul 30, 2012 1:16 pm

At risk of displaying my ignorance of proper object oriented programming and Android in particular, I thought I would invite people to share what they are doing with their Phidgets devices on Android, and begin by sharing my own experiences.

My application is to control several different processes with different Activities (screens) controlling different sections of the over all process. I am using two Interface kits connected to a Toshiba Thrive through a generic (powered) hub.

I start with a main Start Activity screen with buttons going to four other Activity screens. Working with the first screen off the Start Activity, I was able to get both IFkits to read and write as expected, and that individual Activity worked reliably (except for the init issue as described in another post). I was able to read the analog and digital inputs, perform logic operations, and then write an appropriate output on both kits.

At that time, I was opening the two IFkits in that activity's onCreate, and closing them at onPause. This kept the init problem from following me back to the main menu, or the other Activity screens in the application.

I then tried transferring data from a calibration screen to my first operation screen. I was eventually able to do this but, I couldn't get the outputs to work reliably in both Activity screens. They would usually work in one or the other.

I wondered if this was because I was initializing the kits in one Activity screen and then trying to write to them in another. I thought that perhaps if I initialized and opened them in the Hello Activity, maybe I could I write to them in both Activity screens so I changed things to that configuration.

That is my current configuration, but I still have the same output issues. Now I wonder if it is because I am calling multiple instances of each activity instead of closing each one before going to another Activity screen.

Also, FWIW, from a cold boot, I have to start the program 3-4 times in Eclipse in order to register both kits and then start using the program. Thereafter, there is no issue as I restart the program in Eclipse countless times during that editing session.

What is your project and how is it going for you? (Newbies invited too.)

Return to “Android”

Who is online

Users browsing this forum: No registered users and 5 guests