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?
Related
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.
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"
So I've managed to get the settings button to appear while in the preview for my live wallpaper. The only issue I'm having is that it's not shooting me to my preference activity. (I've logged it and I never enter the activity).
I have a feeling I must have made a mistake in the XML somewhere... But I cant seem to spot it.
Here's my wallpaper.xml
<?xml version="1.0" encoding="utf-8"?>
<wallpaper xmlns:android="http://schemas.android.com/apk/res/android"
android:thumbnail="#drawable/icon"
android:description="#string/wallpaper_description"
android:settingsActivity="com.company.app.package.LiveWallpaperPrefs">
</wallpaper>
Here's the relevant snippet from my manifest.
<service
android:name="com.company.app.package.LiveWallpaperService"
android:enabled="true"
android:icon="#drawable/icon"
android:label="app"
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter android:priority="1" >
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/wallpaper" />
</service>
<activity android:name="com.company.app.package.LiveWallpaperPrefs"/>
Anybody know why It's not sending me to my LiveWallpaperPrefs when I press settings? It's actually currently giving me an error "Unfortunately, Live Wallpaper Picker has stopped."
Thanks!
Actually figured it out... I wasn't giving the system permission to enter that settings portion of my app from outside of my app... Here's what fixed my code.
In the manifest (replacing the old LiveWallpaperPrefs)
<activity android:name="com.company.app.package.LiveWallpaperPrefs">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
You could export the LiveWallpaperPrefs like this:
<activity
android:name="com.company.app.package.LiveWallpaperPrefs"
android:exported="true" />
I realize this question is a bit old, but I was having a similar problem. None of the suggestions I found online seemed to be working. No matter what I did, the settings would not display when you tapped the button.
After wasting about 3 hours, I realized that it WAS working, but for some reason I had to completely REMOVE the app from the device and re-install it fresh.
Usually, cleaning the project and re-uploading it to the device actually changes the app. But for some reason the change would not take effect until the app was removed and re-installed.
Hope this helps someone in the future!
I'm trying to launch my live wallpaper from the app icon & live wallpaper list. It works from the live list but from the app icon it breaks.
Following is the code for both of them:
<service
android:label="#string/appName"
android:name=".LiveService"
android:permission="android.permission.BIND_WALLPAPER"
>
<intent-filter android:priority="1">
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
<meta-data android:name="android.service.wallpaper" android:resource="#xml/wallpaper" />
</service>
You can not start a WallPaperService yourself.
The system manages all the calls to your service and therefor you engine.
There currently isn't a way to have your wallpaper running as an "app."
The current fix seems to be to have an icon install on the desktop that directs them to the live wallpaper list.
i'm new at live wallpapers. Is it possible to link a live wallpaper to an app with it's own engine? I mean, to avoid using the typical "Live wallpapers settings" where you choose the amount of items (mostly fishes xD), that you want in the wallpaper. I'd like to have my own app to manage the content of the live wallpaper. Would that be possible? If answer is yes, i'd be helpful if you told me how to do it.
I don't think Hackbod understood your question. If you want to place your live wallpaper settings in an app instead of in the preferences button on live wallpaper preview, you can do that.
First, you must set your application to be a live wallpaper and a regular application at same time. So your manifest should have these two parts:
<activity ...>
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
and
<service android:name="..." android:permission="android.permission.BIND_WALLPAPER">
<intent-filter android:priority="1">
<action android:name="android.service.wallpaper.WallpaperService" />
</intent-filter>
....
</service>
Second you should persist user settings changes made in your app (you can use SharedPreferences) and update your live wallpaper behavior on your WallpaperService.Engine callbacks (like onVisibilityChanged or whatever makes sense for you).
Sorry, the live wallpaper is global to the system and can't change per-application.