Utilizing custom app activities with NFC Launcher

Search This thread

krohnjw

Inactive Recognized Developer
Jul 17, 2007
1,987
534
Plainfield
Cool. Thanks for the quick response

Sent from my HTC One X using Tapatalk 2

I rooted my One X and dock mode is working really well. It requests root access and fires up the desk dock app (via a simulated hardware insertion into the pogo pin dock). This is on the international One X. Which version do you have? Stock firmware or custom rom?
 

eortizr

Senior Member
Jul 6, 2010
1,291
219
Dallas,Texas
I rooted my One X and dock mode is working really well. It requests root access and fires up the desk dock app (via a simulated hardware insertion into the pogo pin dock). This is on the international One X. Which version do you have? Stock firmware or custom rom?

I have AT&T, I tried with different roms and it does exactly the same, it just wont go to Dock Mode using NFC Task Launcher, I can go into Dock Mode using a shortcut without any problems. But using NFC Launcher it will not go. If I simulate hardware insertion via pogo pin I too get into Dock without issues.

the activity name that triggers DockMode is:

com.htc.htcdockscreen/com.htc.htcdockscreen.DeskDock
 
Last edited:

krohnjw

Inactive Recognized Developer
Jul 17, 2007
1,987
534
Plainfield
I have AT&T, I tried with different roms and it does exactly the same, it just wont go to Dock Mode using NFC Task Launcher, I can go into Dock Mode using a shortcut without any problems. But using NFC Launcher it will not go. If I simulate hardware insertion via pogo pin I too get into Dock without issues.

Hm, can you try the following in a terminal emulator app? (not adb shell)
Code:
su

LD_LIBRARY_PATH='/vendor/lib:/system/lib' /system/bin/am broadcast -a android.intent.action.DOCK_EVENT --ei android.intent.extra.DOCK_STATE 1
 

eortizr

Senior Member
Jul 6, 2010
1,291
219
Dallas,Texas
Hm, can you try the following in a terminal emulator app? (not adb shell)
Code:
su

LD_LIBRARY_PATH='/vendor/lib:/system/lib' /system/bin/am broadcast -a android.intent.action.DOCK_EVENT --ei android.intent.extra.DOCK_STATE 1

yeap, that works.

one thing I notice, is that NFC launcher never ask for root. (I'm using SuperSU)
 

frekesho

New member
Dec 28, 2006
2
0
Me too!

OK, kicking this one.

I have the same problem; NFC TL doesn't prompt SuperSu for root access (or, at least, SuperSU doesn't prompt me). I have SuperSU in /system/app too, and (after some googling), I also copied the NFC TL apk from /data/app to /system/app.
NFC TL works fine, but it will not get root, and as a consequence, it will not start/stop GPS.

Were you guys ever able to resolve this?
 

krohnjw

Inactive Recognized Developer
Jul 17, 2007
1,987
534
Plainfield
OK, kicking this one.

I have the same problem; NFC TL doesn't prompt SuperSu for root access (or, at least, SuperSU doesn't prompt me). I have SuperSU in /system/app too, and (after some googling), I also copied the NFC TL apk from /data/app to /system/app.
NFC TL works fine, but it will not get root, and as a consequence, it will not start/stop GPS.

Were you guys ever able to resolve this?

If it's in /system/app and you've rebooted then the system should grant WRITE_SECURE_ACCESS as a permission, no root request will ever be made as it's unnecessary. Root access will never be requested in the current build for modifying GPS. Root was just leveraged to copy the app to /system to get the appropriate permission (when you clicked make system app).

I've updated this for the next release to use root to request the permission at run time as moving the app to system is confusing for people.
 

frekesho

New member
Dec 28, 2006
2
0
Cool, thanks for clearing that bit up. :)
I've removed everything again just now, and reinstalled NFC TL. Will test in my car later today to see if the tag works now. I may be back. :cool:

Edit:
Just tested using the hold-action, then Play. I still got the notification that I'm trying to change a secure setting which will only work with root access, and GPS was not coming on... So I checked permissions for the copy of NFC TL in the /system/app folder, turns out it wasn't set correctly. I changed it so that Group and Other had Read permissions, and hey presto. :D

Thanks!
 
Last edited:

HaiImCrumb

New member
Dec 2, 2013
3
0
Im doing a school project, we're making our own app and we're trying to find out if it is possible to open a specific activity within the app. (Using custom code to write onto NFC tags)

Googling this has not been successful and this thread has some knowledgeable characters so I was wondering if I could get help! :)
 
Last edited:

krohnjw

Inactive Recognized Developer
Jul 17, 2007
1,987
534
Plainfield
Im doing a school project, we're making our own app and we're trying to find out if it is possible to open a specific activity within the app.

Googling this has not been successful and this thread has some knowledgeable character so I was wondering if I could get help! :)

What do you need to know?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I think this can really 'make' NFC worth it by breaking through the mundane wifi, bluetooth, and gps tasks that are standard NFC functions and create interesting tasks with apps without the use of the Tasker app.

    Under NFC Task Launcher > New Task > Add Action > Launch Applications > Application > Application of your choosing and Custom activity within app

    I can't find any help searchin on google or the dev's site to use custom activities. I am curious as heck to use this feature to create more detailed NFC tags, but I am hoping someone can inform on how to determine the activities within third party apps so that I could use this feature.
    :confused::confused::confused:

    It's really not that exciting currently :) Essentially that's used to start a specific activity within a package. Some packages have multiple activities that can be launched (and are present in the app drawer). If you pick one of these from the list that box will auto populate. You could also manually set if it you want (com.pagkage.name.Activity).

    Going forward I'm kicking around allowing the creation of a custom intent to pass extra data into apps (much more useful) but that's a bit off right now. Plenty of features to get through currently before I run in to that (done for the next release is lock screen controls, dock modes - including hardware dock impersonation, sms, phone calls, allowing NFC to be excluded from all airplane mode toggles, layout optimizations and fixes of reported issues) :)

    Long term we do want to get some "how to" articles / videos up. At this point though they don't exist really. If you have any specific questions feel free to email or send me a message here.
    2
    OK, kicking this one.

    I have the same problem; NFC TL doesn't prompt SuperSu for root access (or, at least, SuperSU doesn't prompt me). I have SuperSU in /system/app too, and (after some googling), I also copied the NFC TL apk from /data/app to /system/app.
    NFC TL works fine, but it will not get root, and as a consequence, it will not start/stop GPS.

    Were you guys ever able to resolve this?

    If it's in /system/app and you've rebooted then the system should grant WRITE_SECURE_ACCESS as a permission, no root request will ever be made as it's unnecessary. Root access will never be requested in the current build for modifying GPS. Root was just leveraged to copy the app to /system to get the appropriate permission (when you clicked make system app).

    I've updated this for the next release to use root to request the permission at run time as moving the app to system is confusing for people.
    1
    Reviving a slumbering thread ...

    Is there a way to get a list of activities supported by an app?

    For example, instead of just starting Google Play Store, is there a custom activity that would start Play Store and go to "My Apps"?

    This is in the next release. All exported activities will now be listed when you select an app.
    1
    Quick thought - since a tag can encode a URL, put the gps location in google maps & take the resulting quicklink?

    Where are you trying to 'send' the GPS coords to? Smartphones and tablets with NFC probably already have a gps device - are you trying to have the tag read the current location (which could change), or are you trying to replicate the Checkin functions for Foursquare, etc (tag is in a fixed, known location)?
    1
    Yes

    Sent from my HTC One X using Tapatalk 2

    Ok, I'll root my one x here tomorrow and see if I can get it sorted.

    Sent from my Galaxy Nexus using xda premium