I'm trying to get some information about how to add my app as a tap and pay option for Android devices.
Apps like PayPal and Android Pay can be set as the default app to launch when NFC contact is detected. I would like for my payment app to be an option to launch when someone does NFC tap.
Currently my app can take advantage of NFC by the Android Beam functionality, but I was curious to see how I can get my app included as a tap-to-pay default option so that an NFC tap would launch the app directly.
I am trying to do the same like you and I found this question which ables you to show your app as payment method.
Application not visible in Tap and Pay
add this lines within application tag in your android manifest...
<service android:exported="true" android:name="my.package.MyPaymentService" android:permission="android.permission.BIND_NFC_SERVICE">
<intent-filter>
<action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.nfc.cardemulation.host_apdu_service" android:resource="#xml/apduservice" />
</service>
and then create a file named apdusehvices.xml in your xml folder with this content...
<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
android:requireDeviceUnlock="true"
android:apduServiceBanner="#drawable/ic_fingerprint_error">
<aid-group
android:category="payment"
android:description="#string/app_name" >
<aid-filter
android:name="325041592E5359532E4444463031"
android:description="#string/ppse" />
<aid-filter
android:name="A0000000041010"
android:description="#string/mastercard" />
<aid-filter
android:name="A0000000031010"
android:description="#string/visa" />
<aid-filter
android:name="A000000003101001"
android:description="#string/visa" />
<aid-filter
android:name="A0000002771010"
android:description="#string/interac" />
</aid-group>
you will need to set the string variables in your values => strings and the background image in your drawable folder.
Now I can select my app as Tap & Pay app but when I select it the app crashes and I suppose it's because I haven't created there Service class and the manifest is pointing to my.package.MyPaymentService.
Related
So I have implemented the deep link logic like this with Navigation Component:
nav_graph.xml:
<fragment
android:id="#+id/forgotPasswordChangeFragment"
android:name="......ForgotPasswordChangeFragment" >
<argument
android:name="token"
app:argType="string" />
<deepLink app:uri="https://example.com/create-new-password/{token}" />
</fragment>
AndroidManifest.xml:
<activity
android:name=".ui.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<nav-graph android:value="#navigation/nav_graph_main" />
</activity>
But the link https://example.com/create-new-password/24c37747e3a451e60c0c61c06b36eee7 opens only in browser apps (for Android 12+)
When I allow example.com as supported web address in the device system settings about app ("App info") then it works fine
But users are not going to do such things...
Should add some other permissions somehow for the address or deep link? What else do I miss?
UPDATE
I checked this https://developer.android.com/training/app-links/verify-site-associations
But how can I add android:autoVerify when I use Navigation Component and graph.xml?
As per the page you've linked to, the visual Navigation Editor allows you to set this when building your deep link:
(optional) Check Auto Verify to require Google to verify that you are the owner of the URI.
You can manually add this to your XML as well (which is all the visual editor is going to do for you):
<deepLink
app:uri="https://example.com/create-new-password/{token}"
android:autoVerify="true" />
This will automatically add that flag to the generated intent filters in your manifest.
I have the app running the way I want, but want to be able to set the app as a live wallpaper.
Editing AndroidManifest.xml, I am able to see the app in the wallpaper chooser, but selecting it causes the app to crash (probably due to lack of a "preview".
<!-- Live Wallpaper service -->
<service
android:name="MyWallpaperService"
android:enabled="true"
android:label="HDLW"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" ></action>
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/livewallpaper" >
</meta-data>
</service>
The livewallpaper.xml contains the following
<?xml version="1.0" encoding="UTF-8"?>
<wallpaper
xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="#drawable/icon"
android:settingsActivity="com.tns.NativeScriptActivity"
/>
com.tns.NativeScriptActivity seems to be what runs main.js, and setting android:settingsActivity to it allows the settings icon to actually load the app and show it.
So my questions are:
1) How to I make com.tns.NativeScriptActivity also run in the wallpaper preview? and
2) How do I actually set the com.tns.NativeScriptActivity as the wallpaper?
I am trying to dd my application the "Accounts Section" of the settings. So that when the user clicks on Add account , my app name is visible. The complete code can be found here
I have created an authenticator service. This is how my manifest looks like
<service android:name=".AuthenticatorService">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
</service>
I also created an "authenticator.xml"
<?xml version="1.0" encoding="utf-8"?>
<account-authenticator xmlns:android="http://schemas.android.com/apk/res/android"
android:accountType="com.udinic.auth_example"
android:icon="#drawable/ic_launcher"
android:smallIcon="#drawable/ic_launcher"
android:label="testing"
android:accountPreferences="#xml/prefs"/>
But still I dont see my app under accounts. I am following this tutorial
but its not working. Can you tell me what am I doing wrong ?
Use a resource string instead of using literal text in label.
"authenticator.xml"
android:label="#string/some_label"
i want to add the MiniMob Ads in my android application. I have read the full documentation from the http://www.minimob.com/integration-guide.html for minimob sdk, but i still dont get it.
Now i have two queries:
We have to give the app url either of the android market or some other when we create new app using the MiniMob sdk. So how can we give that url like 1st upload the app without that minimob integration and get the url of the app and then again upload with the minimob integration.
And the 2nd thing is we have to just give that app id, app key and package name in the manifest and add the jar file in lib. and rest some code which i shown below in that activity where we want to show these Ads. Am i wright ??
<!-- MiniMob Manifest declaration start -->
<activity android:exported="false"
android:name="com.minimob.android.OptinActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="\#android:style/Theme.Translucent" />
<activity
android:taskAffinity=""
android:name="com.minimob.android.PushAds"
android:configChanges="orientation|keyboardHidden"
android:theme="\#android:style/Theme.Translucent.NoTitleBar"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="com.minimob.android.DeliveryReceiver"
android:exported="false"/>
<receiver android:name="com.minimob.android.MessageReceiver"
android:exported="false"/>
<receiver android:name="com.minimob.android.BootReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<meta-data android:name="MINIMOB_APPID" android:value="id:$appid" />
<meta-data android:name="MINIMOB_APPKEY" android:value="key:$appkey" />
<meta-data android:name="MINIMOB_APPHOST"
android:value="http://mpm.minimob.com/mobile/serve.asp" />
<meta-data
android:name="MINIMOB_ACTION" android:value="com.minimob.android.PushService$appid" />
<service android:name="com.minimob.android.PushService" android:exported="false">
<intent-filter>
<action android:name="com.minimob.android.PushService$appid" />
</intent-filter>
</service>
<!-- MiniMob Manifest declaration end -->
Regarding the app URL, it is there so we can have access to an app for a number of reasons (e.g. troubleshooting). If your app is not publicly available yet you can temporarily enter a random URL and update with the correct URL later when the app has been accepted in Google Play or another app store.
About your second query, please do the things below everytime you want to integrate the Minimob SDK in an app, as it is custom built for each app and instructions will slightly differ.
Go to the Applications page in Minimob and register your app
Click on the "Download SDK" button next to your app
Open the "Instructions.txt" file
The steps are pretty much the ones you have mentioned (copy the .jar file, copy-paste the permissions and declarations in the manifest, add call in your main activity that starts the Minimob SDK).
We implemented Android's Account Manager and Sync Manager api to create contact sync. But when user selects our account while adding contact, it only displays Name fields and all other fields disappear.
Here is what I have in my manifest
<activity android:name=".AuthenticatorActivity" android:label="iAnywhere Login"
android:theme="#android:style/Theme.Dialog"
android:excludeFromRecents="true"></activity>
<service android:name=".accounts.AuthenticationService">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator"></action>
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator">
</meta-data>
</service>
<service
android:name=".accounts.SyncService"
android:exported="true">
<intent-filter>
<action
android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="#xml/syncadapter" />
</service>
This is what I have in my syncadapter.xml and authenticator.xml
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.android.contacts"
android:accountType="com.rahul.utility.contacts"
/>
Have seen people talk about this kind of issue while adding custom fields that it is a bug in Contact application. I also checked out the code of Exchange Email client in Android source code and they seems to be doing exactly same as what I did, but still when you select Add Contact for an Exchange account it shows up all the fields in the contact.
After a lot of research and looking into the Android code base I found that Android only checks the account type to be either of Google or Default for rendering all the fields. If the account type is of any other type, it only displays basic two fields. There are no work around to it apart from creating your own Contact Add / Edit screen (Sad! Really).
There was a possibility where Android could have provided an interface for others to return field types which they wanted on the screen but it is not implemented that way as of now.