2017년 1월 14일 토요일

NFC sensor on multiple screens


Hi, I made some try with nfc sensor and I came to the conclusion that it only works on apps with 1 screen.
I placed a read button, a write button and a label on the two screen of my test app, the write buttono on the first screen write "Screen1", on the second screen "Screen2".
If I stay on screen1 both read\write works ok and I can read the written text on the label.
If I switch on screen2 then, whatever I press, the app returns on screen1 (after the beeping noise of nfc) and the tag isn't written nor readed.

I guess this is how the nfc component works and I wonder if there's a way to use it on multiple screen (if I read a tag on screen2 I want the app to stay on Screen2 and shows result there) or maybe if this can be a feature to add for awesome guys of MIT.

--
Incorrect... It only work on the screen on which the companent is added. If you want it to work on other screens yo have to add it there and connect on each screen as well.

--
Is what i did. Nfc component is both on screen1 and screen2. But when i read/write a tag from screen2 it opens screen1. I attach the test app

Edit:  Your  APK file has been removed.  As per the posting guidelines, APK's are not allowed, and AIA files should only be posted if requested.  Please post screenshots of your relevant code blocks instead.

--
Please post some screenshots of your relevant blocks.  Show what happens on Screen1 and what happens on Screen2 so we can see what you're doing and advise you on how to proceed...  If you're not sure how to do screenshots, please see my tips below.

--
Screenshot and aia attached, thanks

 Clipboard01.png

 clipboard01.png


--
Gabriele... You're using AI2LiveComplete, not AI2 production... please ask your questions in that forum. Hossein can answer you here:  http://amerkashi.wordpress.com/

--
You're right but the component isn't changed. Can you just tell me your thoughts based on the screenshots? I'll appreciate it

--
I do not think it is possible to use the NFC component on more than a single screen; it is similar to the Bluetooth component and the Bluetooth component ceases to work (it disconnects) if one changes screens so all the code directly related to BT needs to be on the same screen.   It is possible this is also the case with the NFC.    I do not know for sure, however it is very likely.

You might also be having issues closing screens... you are doing this simply ...here is the TribleHunter method   http://puravidaapps.com/tribblehunter.php   Note, this method works after the apk has been built...use  the browser Screen button to change screens while developing... however when this code is in placed in your app it switches perfectly.   Having the close screen part of the change screen process will prevent the device's system memory from overflowing and crashing your app.   This method is more suitable in some apps than the screen manager Taifun  frequently recommends   They both work.

--
You're very kind Steve, thanks, so what you're saying is exactly what i experienced. I'll try to adapt my app to using this, thanks

--

댓글 없음:

댓글 쓰기