Maybe your onStart() doesn't get called when you think it does, which is
what might explain why the pinState setting doesn't work from onStart.
I don't know about the notification. You're getting quite deep into the
"generic Android question" territory, for which you might have a lot better
luck reading the Android developer docs or searching/posting on
stackoverflow.


On Sun, Apr 6, 2014 at 6:12 PM, Lagz Moncs <[email protected]> wrote:

> Although this is more on java and am just starting to learn it, I hope you
> can give some advice and/or corrections.
> I am doing these tests using a USB connection to a host Android 4.2.2 with
> IOIO as device.
>
> I define boolean array in IOIOService class.
>
> public class HelloIOIOService extends IOIOService {
>     boolean[] pinState = new boolean[3];
> ...
>
> I then use those array as .write parameter for IOIO io pins in loop().
>
> @Override
> public void loop() throws ConnectionLostException,
>              InterruptedException {
>         for(int i=1; i<3; i++)
>         {
>          i_o[i].write(pinState[i]);
>         }
> }
>
> When I set pinState[1] to "true" in onStart() I get no corresponding IOIO
> output on pin#1.
>
> @Override
>     public void onStart(Intent intent, int startId) {
>         super.onStart(intent, startId);
>                 pinState[1] = true;
> }
>
> But if I set it in IOIOLooper it will set IOIO output pin#1.
>
> @Override
> protected IOIOLooper createIOIOLooper() {
>                 pinState[1] = true;
> ...
>
> When I run the original version of HelloIOIOService503 in the same
> environment, I also noticed that no notification appears on the
> Android device although the IOIO status led is blinking.
>
> I have tried this code setup before with App-IOIO330 and IOIO as host and
> it's working. What did I possibly miss?
>
>
> On Friday, April 4, 2014 1:42:19 AM UTC+8, Ytai wrote:
>
>> The simplest way to pass data between the main thread and the IOIO thread
>> is to define member variables in your activity class that get shared
>> between the two. All the example apps do that.
>> On Apr 3, 2014 1:38 AM, "Lagz Moncs" <[email protected]> wrote:
>>
>>> I noticed onStart is not executed in HelloIOIOService503 example. I get
>>> no notification.
>>>
>>> In my application I cannot pass values from onStart() to loop(). What am
>>> I missing?
>>>
>>> On Wednesday, April 2, 2014 11:38:04 PM UTC+8, Ytai wrote:
>>>>
>>>> There's no problem using loops inside setup() or loop(). You probably
>>>> have some other problem, such as an infinite loop or doing something inside
>>>> the loop that's invalid.
>>>> If you provide more details about what's happening and/or your code
>>>> and/or logcat output I can try to help.
>>>> Be warned that there's a problem with the IOIOService approach using
>>>> OA, as the service will not get notifications of the IOIO connecting.
>>>> Apparently an Activity can forward the Intents to the Service to overcome
>>>> this problem, but I've never actually verified that.
>>>>
>>>>
>>>> On Tue, Apr 1, 2014 at 9:42 PM, Lagz Moncs <[email protected]> wrote:
>>>>
>>>>> I mean worked before with bluetooth and OA with IOIO as host.
>>>>>
>>>>>
>>>>> On Wednesday, April 2, 2014 12:41:20 PM UTC+8, Lagz Moncs wrote:
>>>>>>
>>>>>> It is supposed to be a question but not completed, sorry. Is it the
>>>>>> loops inside setup() and loop() that's really preventing HelloIOIOService
>>>>>> from talking to the IOIO? When I remove the loops, controlling the IOIO 
>>>>>> is
>>>>>> fine. This loop setup worked before.
>>>>>>
>>>>>> On Wednesday, April 2, 2014 12:20:56 PM UTC+8, Ytai wrote:
>>>>>>>
>>>>>>> Is this a question?
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Apr 1, 2014 at 8:20 PM, Lagz Moncs <[email protected]> wrote:
>>>>>>>
>>>>>>>> Hello, I think I'm lost here. I'm using adt bundle 20140321,
>>>>>>>> App-IOIO0503. HelloIOIOService503 is working fine.
>>>>>>>> In my previous application I used a for loop inside the setup() and
>>>>>>>> loop() in HelloIOIOService but now it seems it's freezing 
>>>>>>>> HelloIOIOService.
>>>>>>>> I might have missed something. I'm just starting with java.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Saturday, March 29, 2014 9:31:11 AM UTC+8, Lagz Moncs wrote:
>>>>>>>>>
>>>>>>>>> Okay. I have to make things up to date.
>>>>>>>>>
>>>>>>>>> On Saturday, March 29, 2014 9:07:16 AM UTC+8, Ytai wrote:
>>>>>>>>>>
>>>>>>>>>> And upgrade ADT to latest.
>>>>>>>>>> On Mar 28, 2014 6:06 PM, "Ytai Ben-Tsvi" <[email protected]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Please consult the eclipse troubleshooting page on the IOIO wiki.
>>>>>>>>>>> On Mar 28, 2014 5:37 PM, "Lagz Moncs" <[email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Alright. How about my ADT, it's 20130729 but I have installed
>>>>>>>>>>>> software update already. SDK is up to 19. The v5.03 HelloIOIO 
>>>>>>>>>>>> project is
>>>>>>>>>>>> complaining about an R(cannot be resolved to a variable) in 
>>>>>>>>>>>> MainActivity.
>>>>>>>>>>>> Two of them actually.
>>>>>>>>>>>>
>>>>>>>>>>>> I'll have to find a way to illiminate this error and maybe I
>>>>>>>>>>>> can start troubleshooting my application.
>>>>>>>>>>>>
>>>>>>>>>>>> On Friday, March 28, 2014 11:35:40 PM UTC+8, Ytai wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Start by trying to build HelloIOIO from the source code in the
>>>>>>>>>>>>> v5.03 bundle.
>>>>>>>>>>>>> If anything doesn't go smoothly during the build process (e.g.
>>>>>>>>>>>>> if you had to modify anything to make things work), note it. In 
>>>>>>>>>>>>> general,
>>>>>>>>>>>>> this shouldn't happen if you do everything OK.
>>>>>>>>>>>>> Once you have this working, you can either incrementally
>>>>>>>>>>>>> modify HelloIOIO to your own logic or just diff it against your 
>>>>>>>>>>>>> existing
>>>>>>>>>>>>> app to figure out what you've done wrong.
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Fri, Mar 28, 2014 at 2:05 AM, Lagz Moncs 
>>>>>>>>>>>>> <[email protected]>wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> I already upgraded the firmware to v0500 and you are right,
>>>>>>>>>>>>>> the 503 HelloIOIO is working. It blinks the LED.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> But there is still something I'm missing with my app. I can't
>>>>>>>>>>>>>> get digital outputs. Any idea?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Friday, March 28, 2014 2:49:42 PM UTC+8, Ytai wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> Yes, that's what I meant. You can always downgrade later if
>>>>>>>>>>>>>>> you want, although it's very unlikely that you'll have any 
>>>>>>>>>>>>>>> reason to do so.
>>>>>>>>>>>>>>> On Mar 27, 2014 11:48 PM, "Lagz Moncs" <[email protected]>
>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> The IOIO OTG I have have this ID's
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> Hardware ID:   SPRK0020
>>>>>>>>>>>>>>>> Bootloader ID: IOIO0400
>>>>>>>>>>>>>>>> Firmware ID:   IOIO0330
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> You mean I will upgrade Firmware ID: IOIO0330 to Firmware
>>>>>>>>>>>>>>>> ID: IOIO0500?
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> I have not done this but I hope it isn't that sensitive. On
>>>>>>>>>>>>>>>> my way.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> On Friday, March 28, 2014 1:47:36 PM UTC+8, Ytai wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>> You're in good shape. Try upgrading the firmware to v5.00
>>>>>>>>>>>>>>>>> and my guess is that everything will work fine.
>>>>>>>>>>>>>>>>> On Mar 27, 2014 10:02 PM, "Lagz Moncs" <[email protected]>
>>>>>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> I tried using the pre-compiled HelloIOIO.apk from v5.03
>>>>>>>>>>>>>>>>>> as you suggested. It did show a Hello IOIO dialog box. 
>>>>>>>>>>>>>>>>>> "Allow the app Hello
>>>>>>>>>>>>>>>>>> IOIO to access the USB device?. Checked the box "Use by 
>>>>>>>>>>>>>>>>>> default for this
>>>>>>>>>>>>>>>>>> USB device. Still can't toggle the IOIO yellow status led.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> Is it then this android device does not support the USB
>>>>>>>>>>>>>>>>>> device API?
>>>>>>>>>>>>>>>>>> Is there any other way to connect aside from Bluetooth?
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>> On Friday, March 28, 2014 10:55:10 AM UTC+8, Ytai wrote:
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> It is possible that this device does not support the USB
>>>>>>>>>>>>>>>>>>> device API.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> I think that even if you have no IOIO application
>>>>>>>>>>>>>>>>>>> installed, you should see the USB dialog popping up, but 
>>>>>>>>>>>>>>>>>>> I'm not 100% sure
>>>>>>>>>>>>>>>>>>> (this is for sure the behavior in IOIO as host mode).
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> In either case, try using the pre-compiled HelloIOIO.apk
>>>>>>>>>>>>>>>>>>> from the v5.03 software bundle to eliminate any possibility 
>>>>>>>>>>>>>>>>>>> of something
>>>>>>>>>>>>>>>>>>> wrong with your build.
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>> On Thu, Mar 27, 2014 at 6:01 PM, Lagz Moncs <
>>>>>>>>>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Hello,
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> I am using a IOIO-OTG with HP Slate 21(Android 4.2.2).
>>>>>>>>>>>>>>>>>>>> Connectivity with Bluetooth works fine. I wanted a more 
>>>>>>>>>>>>>>>>>>>> stable connection
>>>>>>>>>>>>>>>>>>>> so I tried to go with USB using cable micro B 
>>>>>>>>>>>>>>>>>>>> plug(IOIO-side) to standard A
>>>>>>>>>>>>>>>>>>>> plug(Slate21 side). IOIO-OTG mode switch is set to "A". 
>>>>>>>>>>>>>>>>>>>> The IOIO-OTG power
>>>>>>>>>>>>>>>>>>>> light indicates it is being powered by the HP Slate 21 but 
>>>>>>>>>>>>>>>>>>>> HelloIOIO(with
>>>>>>>>>>>>>>>>>>>> IOIOLibAndroidDevice) can't control the yellow light on 
>>>>>>>>>>>>>>>>>>>> the IOIO-OTG.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Is it possible the Slate 21's Android 4.2.2 is not
>>>>>>>>>>>>>>>>>>>> supporting IOIOLibAndroidDevice's connection with 
>>>>>>>>>>>>>>>>>>>> IOIO-OTG? Is there any
>>>>>>>>>>>>>>>>>>>> other IOIO-OTG USB connection option for this android 
>>>>>>>>>>>>>>>>>>>> device?
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> Thank you.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>> --
>>>>>>>>>>>>>>>>>>>> You received this message because you are subscribed to
>>>>>>>>>>>>>>>>>>>> the Google Groups "ioio-users" group.
>>>>>>>>>>>>>>>>>>>> To unsubscribe from this group and stop receiving
>>>>>>>>>>>>>>>>>>>> emails from it, send an email to ioio-users+...@
>>>>>>>>>>>>>>>>>>>> googlegroups.com.
>>>>>>>>>>>>>>>>>>>> To post to this group, send email to
>>>>>>>>>>>>>>>>>>>> [email protected].
>>>>>>>>>>>>>>>>>>>> Visit this group at http://groups.google.com/group
>>>>>>>>>>>>>>>>>>>> /ioio-users.
>>>>>>>>>>>>>>>>>>>> For more options, visit https://groups.google.com/d/op
>>>>>>>>>>>>>>>>>>>> tout.
>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>  --
>>>>>>>>>>>>>>>>>> You received this message because you are subscribed to
>>>>>>>>>>>>>>>>>> the Google Groups "ioio-users" group.
>>>>>>>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails
>>>>>>>>>>>>>>>>>> from it, send an email to [email protected]
>>>>>>>>>>>>>>>>>> .
>>>>>>>>>>>>>>>>>> To post to this group, send email to
>>>>>>>>>>>>>>>>>> [email protected].
>>>>>>>>>>>>>>>>>> Visit this group at http://groups.google.com/group
>>>>>>>>>>>>>>>>>> /ioio-users.
>>>>>>>>>>>>>>>>>> For more options, visit https://groups.google.com/d/op
>>>>>>>>>>>>>>>>>> tout.
>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>  --
>>>>>>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>>>>>>> Google Groups "ioio-users" group.
>>>>>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails
>>>>>>>>>>>>>>>> from it, send an email to [email protected].
>>>>>>>>>>>>>>>> To post to this group, send email to
>>>>>>>>>>>>>>>> [email protected].
>>>>>>>>>>>>>>>> Visit this group at http://groups.google.com/group
>>>>>>>>>>>>>>>> /ioio-users.
>>>>>>>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>  --
>>>>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>>>>> Google Groups "ioio-users" group.
>>>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>>>>>> it, send an email to [email protected].
>>>>>>>>>>>>>> To post to this group, send email to
>>>>>>>>>>>>>> [email protected].
>>>>>>>>>>>>>> Visit this group at http://groups.google.com/group/ioio-users
>>>>>>>>>>>>>> .
>>>>>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>  --
>>>>>>>>>>>> You received this message because you are subscribed to the
>>>>>>>>>>>> Google Groups "ioio-users" group.
>>>>>>>>>>>> To unsubscribe from this group and stop receiving emails from
>>>>>>>>>>>> it, send an email to [email protected].
>>>>>>>>>>>> To post to this group, send email to [email protected].
>>>>>>>>>>>> Visit this group at http://groups.google.com/group/ioio-users.
>>>>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>>>>
>>>>>>>>>>>   --
>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>> Groups "ioio-users" group.
>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>> send an email to [email protected].
>>>>>>>> To post to this group, send email to [email protected].
>>>>>>>> Visit this group at http://groups.google.com/group/ioio-users.
>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "ioio-users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To post to this group, send email to [email protected].
>>>>> Visit this group at http://groups.google.com/group/ioio-users.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "ioio-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/ioio-users.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "ioio-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/ioio-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to