Samsung One UI Home Screen shows a setting button for some widgets when I select the widget,
But not for some
Wondering what is the difference between the two or is it just a OEM specific feature as I couldn't the menu in POCO launcher or emulator's launcher at all.
Please note I am already using
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:configure=".WidgetConfigurationActivity"
...
in my provider and this in my manifest
<receiver ...>
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
...
Yet these are just adding configuration when I add a widget not after the addition of the widget, and couldn't find the answer on searching the net.
I know this question is months old, but I'll answer anyway. After reverse-engineering a Samsung app, I've found the secret behind the Settings button.
You only got to add this meta-data to your app widget (<receiver>):
<meta-data android:name="android.appwidget.provider.semConfigureActivity" android:value="com.example.MySettingsActivity" />
Full example:
<receiver android:name="com.example.MyWidget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="#xml/widget_info"/>
<!-- The secret sauce is here -->
<meta-data android:name="android.appwidget.provider.semConfigureActivity" android:value="com.example.MySettings"/>
</receiver>
Advice: It's recommended to learn reverse-engineering to implement undocumented features (just make sure the core functionality of your app does not depend on undocumented APIs).
Just to add also, in Android 12 this has standardized finally and provided with android:widgetFeatures="reconfigurable" or (reconfigurable|configuration_optional), see https://developer.android.com/guide/topics/appwidgets/configuration#use-default for more information from Android 12.
Also maybe worth to note, apparently reconfigurable has been defined for some releases just that in this release the declared it as officially supported.
Related
I have a very basic Android app generated from https://appmaker.xyz/pwa-to-apk/. That app was actually modeled very closely off an example published by Google which I cannot find anymore.
The problem is that if you set the default browser on the device to one that does not support TWA, the app opens but shows the URL bar. If you want all the technical fun, here's a bug report that explains everything: https://bugs.chromium.org/p/chromium/issues/detail?id=942930
My Android development skills are limited to compiling the app in Android Studio and I have no clue what modification I can make to force my app to prefer a browser that supports TWA. Is there some modification I can make to that will do this?
Here's my AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.placeholder">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="${launcherName}"
android:supportsRtl="true"
android:theme="#style/Theme.TwaSplash">
<meta-data
android:name="asset_statements"
android:value="${assetStatements}" />
<activity android:name="android.support.customtabs.trusted.LauncherActivity"
android:label="${launcherName}">
<meta-data android:name="android.support.customtabs.trusted.DEFAULT_URL"
android:value="${defaultUrl}" />
<meta-data
android:name="android.support.customtabs.trusted.STATUS_BAR_COLOR"
android:resource="#color/colorPrimary" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"
android:host="${hostName}"/>
</intent-filter>
</activity>
</application>
</manifest>
Browser support for Trusted Web Activity is improving - Chrome, Edge, and a couple of others support it, with Firefox coming soon (Firefox Nightly already supports it).
The example was svgomg-twa, which is now deprecated.
The best way to generate a an app that uses Trusted Web Activity is using something like Bubblewrap - It's a Node.js CLI application.
It defaults to the Custom Tabs fallback behaviour (the URL bar) but has the option to enable a WebView fallback.
Initialize the project with bubblewrap init --manifest=https://example.com/manifest.json
This will generate the Android project and a filed called twa-manifest.json. Edit this file and change the fallbackType field from customtabs to webview.
Update the project with bubblewrap update
Lastly, build the APK with bubblewrap build
Alternative approach:
PWABuilder uses Bubblewrap as a library and can be used for the same goal:
Navigate to https://www.pwabuilder.com/
Enter the add address to the PWA on the input
Click on Build my PWA
Click on the arrow pointing down on the Android card
Click on Options
Change the Fallback type radio from "Custom Tabs" to "Web View"
Click Done
Click on Download
Is it possible to bundle several mobile apps into a single download? So a person can install the bundled apps, then have several new apps available on their phone.
For example, a bundle of iOS apps, or a bundle of Android apps?
For iOS you can't do it. I tried to place multiple application in one ipa (which is just zip), but it will recognized just one of them.
Downloading additional content is also prohibited on iOS.
However, if you distribute application over the air, you can create a file (I don't remember exactly how it's called) which will have multiple asset's in it (multiple ipa's).
For Android, pablisco and user2115660 pretty much covered it.
You can't do that as it is. What wou can do is add an extra Activity with a CATEGORY_HOME in the intent filter and it will appear as a separate app on Android's launcher:
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
You would have to change the icon and label properties of the activity for it to have a different icon and name as well :)
UPDATE:
The format I was using for the intent filter wasn't correct. This is how the activities would have to be declared inside the application tag in the manifest:
<activity android:name=".MainActivity"
android:icon="#drawable/main_icon"
android:label="#string/main_app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SecondaryActivity"
android:icon="#drawable/secondary_icon"
android:label="#string/secondary_app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
If you want to include an Activity inside a library project you will have include the full path to that given Activity.
One interesting approach would be to create both apps like library projects and then compound them into one. Bear in mind that you can't package library projects into apk so you would have to do separate projects if you want to create individual products.
Here is some info about library projects: http://www.vogella.com/articles/AndroidLibraryProjects/article.html
I saw one app that after instillation started downloading apk's and installing them.
For iOS, outside of the jailbreak world, of which I am not overly familiar with, no.
This is a question concerning android applications with two different .apks (or two apps contained in the one .apk file)
I have two apps which do completely different things but are related, say one is a standard user app and one is an admin app. But a user can be both a user and an admin. I am wondering is it possible for me to create one .apk file that installs two applications to the phone? And how would I got about this?
Thanks,
Matt
You can have two activity elements in the same manifest file, which have both the intent filter with action=MAIN and category=LAUNCHER. Further, you have also to use the attribute "android:taskAffinity" for both activity elements (see also here):
<application android:allowBackup="true"
android:icon="#drawable/main_icon"
android:label="#string/main_name"
android:theme="#style/AppTheme" >
<activity android:name="com.foobar.MyActivity2"
android:taskAffinity="com.foobar.MyActivity2"
android:icon="#drawable/icon1"
android:label="#string/name1" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.foobar.MyActivity2"
android:taskAffinity="com.foobar.MyActivity2"
android:icon="#drawable/icon1"
android:label="#string/name2" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
When the APK file with this manifest is installed on a device, then it will create two icons on the homescreen. The titles of these icons will be taken from the attributes android:label, and the icons will be taken from the attributes android:icon. In the list of apps under "Settings | Apps" you will see the name & icon defined by the attributes of the application tag. When you choose "uninstall" for this entry in the list of apps, then both "apps" will be removed from the device.
It depends on your definition of "application". You cannot install 2 applications if you use the more official definition, as you can have only 1 <application> in your manifest.xml
You can define several activities in your manifest.xml, and they can do seperate things, so in that way YOU CAN have 2 things a person might describe as "application" in one APK
Just define multiple activities and use those could be defined as an option, but it depends on your definition of 'application', but in this case I'd say it would work
Yes, you can install multiple apps by just installing one app.
In Manifest.xml
Project Structure:
You should either build 2 APKs are use APK Expansion Files.
Btw, this is a security measure.
No.
what you can do is to check if the second app is already installed, and if the answer is no, you can prompt the request to install the second app using this post.
I have tested this app on the Android emulators, phones, tablets, and Google TV. Its works. When I published it Google Play, the app is not visible. Below is the manifest. I sincerely appreciate any insight as to the problem. Thank- you.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zzzz.xyzxyz"
android:installLocation="internalOnly"
android:versionCode="4"
android:versionName="1.4" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />
<uses-feature
android:name="android.hardware.microphone"
android:required="false" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".AlbumSelectorActivity"
android:label="#string/app_name"
android:launchMode="singleTask" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="xyzxyzAppWidgetActivity"
android:noHistory="true" >
</activity>
<activity
android:name=".SelectableImagesActivity"
android:noHistory="true" >
</activity>
<activity
android:name=".SelectedImageActivity"
android:noHistory="true"
android:windowSoftInputMode="stateHidden|adjustResize" >
</activity>
<activity
android:name=".ReplayAlbumActivity"
android:noHistory="true"
android:windowSoftInputMode="stateAlwaysHidden|adjustResize" >
</activity>
<activity android:name=".PreferenceHelpActivity" >
<category android:name="android.intent.category.PREFERENCE" >
</category>
</activity>
<activity android:name=".PreferenceSettingsActivity" >
<category android:name="android.intent.category.PREFERENCE" >
</category>
</activity>
<service android:name=".ReplayAlbumService" >
<intent-filter>
<action android:name="com.zzzz.xyzxyz.ReplayAlbumService" />
</intent-filter>
</service>
<activity
android:name=".xyzxyzAppWidgetConfigureActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/appwidget_name" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver
android:name=".xyzxyzAppWidgetProvider"
android:icon="#drawable/ic_launcher"
android:label="#string/appwidget_name" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/appwidget_provider" />
</receiver>
</application>
</manifest>
Just try it on your browser setting the link:
https://play.google.com/store/apps/details?id=yourpackagename
even if it's not indexed in the search, if it's published you will find it, if not, somethings wrong then
I ran into this problem (or a similar one). I submitted my app on the internal test track and soon after, in the Google play Console, it said my app is Published and provided a link to go to Google Play Store to download the app. However, when I clicked the link, it would tell me the requested URL could not be found. I also could not find the app in the Google Play Store by searching for it.
The solution:
Apparently, I had to add myself to the testers group and more importantly - opt in. I found the opt-in link in Google play Console:
On the left, click "Release Management"
"App releases"
Go to the version you have uploaded and click "MANAGE".
Click on "Manage testers". There, you will find an opt-in URL.
Try searching with exact name in double quotes ""
like for eg: "ZipDrive"
it might take some time to index it. Until that you might not find it in the search. It is also posible that you don't see it because it doesn't match the device you use to search for it. Or the country you're in.
I had been waiting ~11 hours and still it wasn't online... until I realised I'd published it but it was still in Beta. I never used the Google Play Alpha/Beta testing features but I still had to click on the button under the Beta tab to "Move to Production".
Here is my first hand experience. I published my first app on the Google play store (GPS) on October 15th. Was pretty excited to locate on GPS. But yes the same experience, it didn't show up.
Then here is the series of events:
1. Day 1 to Day 3
When searched using double quotes "Cool Tic Tac Toe", I could see at the bottom of the search list - at the last almost after 200 items, but yes it was there which made me happy.
2. Day 4 onwards -
I removed the quotes and searched by app name with the spaces i.e. Cool Tic Tac Toe, it showed up almost at the bottom.
In the mobile or tablet version of Play Store app, you will see filters like "New" "4.5" or "4.0" for ratings. So when I used the filters New and 4.5 in the play store app, it started showing up almost in the first few pages.
3. Day 6-7
My app now shows up at the top (in top 10) when I put the exact app name without any quotes and without using any filters - this is very good sign. So far I have about 100 downloads (most from my friends and family and not from any real user I would imagine as no one in the world will really search my app with its full name.
I realize visitors of GPS would not know my app name, they will search with a generic key word like Tic Tac Toe and not Cool Tic Tac Toe
Day 7 onwards - today(8th day)
I search my app with generic name Tic Tac Toe in GPS, it doesn't show up ANYWHERE, not even at the bottom. This is a little disappointing, but I do hope it will crawl up and start showing somewhere.
HOWEVER If I add the filters "New" and "4.5" it does show up in top 25. This I think is a good sign. I will update more on this if I see any related behavior.
Hope this helps give some idea to my fellow developers who have put their first app in GPS and trying to locate it in the ocean of many millions of other apps.
I tried all the above solutions but I just realised someone can do this below-mentioned mistake too.
In Play Console, go to Setup-> Advanced settings in the left pane.
Select Managed Google Play
Choose the Turn off option, if you want your app to be publicly available.
Since you've waited a sufficient amount of time and it should appear, you can try checking your APK to see what default permissions and features your app requires using aapt:
$ aapt d badging your.apk
Make sure that what is listed for features is not filtering your device. You can mostly do this on Google Play too, but I have seen a few differences where Google Play will show that it is available for older devices, but it actually will not install.
Also, as suggested by #ricvieira, you should do a query in a web browser to see if your app shows up at all.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Android AppWidget does not show up in the menu in honeycomb until reboot
It seems like the default launcher in Android 3 (Honeycomb) has a bug. It doesn't seem to refresh the widget list when you install a new application. When you restart the launcher (or restart the whole tablet) the widget will be there, as it should be. Seems like the widget list there is cached, while on earlier versions of Android, and in other launchers this is not the case.
I've followed the instructions in the SDK, and it seems to be working find on other devices, but on Android 3 it never worked right from the first time :(
I've marked my application with android:installLocation="internalOnly"
Here's the widget registration in the manifest:
<receiver android:name=".BatteryWidget" android:label="#string/widget_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<intent-filter>
<action android:name="org.flexlabs.action.BATTERY_UPDATED" />
<action android:name="org.flexlabs.action.dualbattery.SETTINGS_UPDATED" />
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="#xml/widget_info" />
</receiver>
Please help?
Honeycomb+ launcher behaves a bit differently than pre-Honeycomb one. It does not display widget in list of widgets until you launch any activity of the application.
See http://groups.google.com/group/android-developers/browse_thread/thread/6ef964dc4395e979/161a79b9a4d0a753?show_docid=161a79b9a4d0a753&pli=1 for more details.