NFC "Tag written 'kicks' the application back to screen 1"

312 views
Skip to first unread message

Shazwan Salleh

unread,
Jan 9, 2015, 9:57:56 AM1/9/15
to mitappinv...@googlegroups.com
Hello everyone.

I am new to app inventor. Currently I am trying to develop an app for my final year project.
My app uses the NFC services that is provided by AppInventor.

Now the app I am trying to develop has multiple screens. So let say screen 2 has the NFC function in it. 

Everytime the app tries to read or write an NFC tag, it will just go back to screen 1. As if the read or write command will 'kick' the app back to the initial screen. 
Now i know my code works as I have done it on a single screen app with no trouble.

Now I am just trying to improve the GUI by adding multiple screen so the app does not look congested. 
I hope you guys can understand what I am trying to say and hopefully tell me what is wrong or what seems to be the problem. Thank you.

SteveJG

unread,
Jan 9, 2015, 11:00:33 AM1/9/15
to mitappinv...@googlegroups.com
!) You do not have to use multiple screens so the app does not look congested.   If you use layouts, you can turn them on and off (Visible = true   or Visible = false.)

2) I suspect this issue may be similar to what BlueTooth users, experience; if you switch screens, the they lose the bluetooth connection.  There may be a work around with the NFC but I do not know.   The alternative is NOT to switch screens.     Here is some help (suggestions)  
Despite the link name, the topic is really about building apps with only a single screen.

Each screen in AI2 works like a seperate app, all connected by the AI2 Screen1.   If you notice, if you use a variable on Screen2 and need it on Screen1, developers have to 'pass' the variable either using a TinyDB or using the Control block  open another screen with start value   block.  What you are confronting may be related to that and the inability of the NFC to 'stay' open when switching screens.  This behavior may be design.   I do not know.

Help some of this helps.

Regards,
Steve



Shazwan Salleh

unread,
Jan 13, 2015, 12:21:04 AM1/13/15
to mitappinv...@googlegroups.com
Hello SteveJG

Thank you for your reply.

After browsing the internet I've found similar problems faced by others. It is classified as a bug in the App Inventor. Further research and I've found this
:
Only permit NFC to work on Screen1. This is a limitation imposed by
Android, the “singleTask” activity modifier should only be used on a
“Top” activity, which in App Inventor is Screen1.
Although I'm not very sure what it means =D
Anyway thank for your reply. I'll definitely check out the link you've provided me. 
Thank you.
Reply all
Reply to author
Forward
0 new messages