Can a live wallpaper be linked to an app? - android

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.

Related

Can a preference screen be added to the Settings app?

In iOS, an app developer can create a preference screen with editable fields using the Settings.bundle\Root.plist file. This preference screen is accessed through the Settings app and not through the app itself.
Can the samething be done on Android? Can I create a preference screen that can be accessed through the Settings app?
Android 7.0+ lets you have an activity with the APPLICATION_PREFERENCES action. This activity will be linked to your app's page in the Settings app, via a gear icon.
<activity
android:name="EditPreferences"
android:label="#string/app_name"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The android:exported="false" limits access: Settings can start your activity, but arbitrary other apps cannot. Right now, I am not sure why that works, but it does.
I have a bit more on this in this blog post.
No, Android does not have this option. If you want a preference screen you need to create by yourself like another Activity and if you need save preference data use the class Sharedpreferences.

replace android intent chooser dialog

is there a way to replace the intent-chooser dialog? At the moment my app is having heaps of intent-filters to come close to this - but I would like to explore other options ( also only working on rooted devices is an option in this case )
I mainly want to achieve these goals:
- not having the default intent-chooser any more before my app
- being registered to all intents
also just getting closer to just one of these goals would be nice - anyone here sees an option to do what I want to do?
This is supported by the system. All you need to do is to create an Activity that has an Intent.CHOOSER Intent filter.
Here is the definition of the one by default in Android:
<activity android:name="com.android.internal.app.ChooserActivity"
android:theme="#style/Theme.Holo.Dialog.Alert"
android:finishOnCloseSystemDialogs="true"
android:excludeFromRecents="true"
android:multiprocess="true">
<intent-filter>
<action android:name="android.intent.action.CHOOSER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

single app with different launches to configure and run in android

I have a requirement to do an app to function like this.
Its an android application and it should have 2 launching methods.
One is to proceed the function directly when touching the icon.
Another icon should be there to give the setting to the same app to set the setting the settings of the android application.
Basically the app should work like the screen off and lock app in the market.
How can i achieve these 2 things in one app? When i install the app, i need to have two icons, one to do the functionality directly and other to set the settings of the application.
I believe you are trying to have to separate launchers (icons to start apps) in your app, launching two different activities. This is easily achieved within your manifest. Create two activities, say MainActivity and SettingsActivity and then declare them in manifest as launch-able - with different titles:
<activity
android:name=".MainActivity"
android:label="#string/main_activity_title"
android:icon="#drawable/main_icon">
<intent-filter android:label="#string/main_app_title">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SettingsActivity"
android:label="#string/settings_activity_title"
android:icon="#drawable/settings_icon">
<intent-filter android:label="#string/settings_app_title">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
When your app is installed, there will be two icons created: one to start the MainAcivity and another one to start SettingsActivity.

Livewallpaper launch from App Icon

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.

android.intent.action.SEND; doing it wrong?

So I'm updating an app I created a while ago. In the AndroidManifest.xml I have the following (along with an <intent-filter> for android.intent.action.MAIN) inside an <activity>:
<intent-filter android:label="#string/send_label" android:icon="#drawable/icon">
<action android:name="android.intent.action.SEND" />
<data android:mimeType="text/plain" />
</intent-filter>
If I remember correctly, when I first created this app, the above (minus the android:label and android:icon bits) worked; my app would show up in the "Share" menu. A couple weeks ago I noticed a review of my app on the Market saying that it didn't show up when trying to Share stuff. I checked, and sure enough, it wasn't there.
Is the fact that I have two <intent-filter> blocks for one Activity confusing it? Did I break something between then and now, did something change in the Android API, or what's going on here?
Don't you need to specify a category?
(such as <category android:name="android.intent.category.DEFAULT" />

Categories

Resources