Android share menu : apps ordering - android

I made an Android app which can receive text via ACTION_SEND intents from other apps. However, when I try to share content from another app, my app is in the bottom of the long list of available apps. It's not alphabetically ordered because my app begins with "A". So how can I do to raise the position?

The order of options is controlled by the UI showing those options. That might be a system-supplied UI (e.g., platform default chooser) or an in-app API (e.g., ShareActionProvider). You have no means of guaranteeing your app's position in those options in either case. Whether they use alphabetical order, frequency of use, or other criteria is up to their developers, not you.

Related

Android Wear 2.0 - Providing multiple complications

How can I provide several types of complications using only one complications provider? I want to achieve the same effect as "android wear" app does. They only have one provider and offer date, next event, photos, step counter, and others.
The documentation is still very poor, and I can't see anything where this is being talked about.
Thank you.
The first list that appears when you bring up the provider chooser is a list of apps. Clicking on an entry there brings up a list of complication providers included in that app.
Therefore 'Android Wear' contains 7+ complication providers, one for each type of data.
There is not only one provider under the app "Android Wear", instead they are independent providers.
Each provider can support multiple types and the complication on watch face slide will determine which type is prefer to display.
For example, the "Next event" in android wear support "LONG_TEXT" and "SHOR_TEXT". If a complication slot in watch face prefer "SHORT_TEXT", the provider will send "SHOR_TEXT" complication data to the watch face.
So what you need to do is implemented one provider for each kind of data.

In an Android game, can you enable the player to unlock something in ANOTHER game (or see another game's high score)?

Applications of these two ideas could include enabling the player to see his or her progress in earlier games within the latest sequel, being able to keep the same character/progress across games, etc. etc.
While the best solution is likely having the player create an account they use across games, I'd like to avoid that if I can (both because players are already logging into Google Play Games, and because I currently do not have access to server infrastructure to handle doing that). Is there any other official/popular mechanism for passing data between games, or is the account route the best bet?
I believe that this is what you are looking for, Interacting with Other Apps especially the Sharing Simple Data and Sharing File section. You may also refer to this documentation for Receiving Simple Data from Other Apps which suggests that you will need an ACTION_SEND intent filter.
Update Your Manifest
Intent filters inform the system what intents an application component is willing to accept. Similar to how you constructed an intent with action ACTION_SEND in the Sending Simple Data to Other Apps lesson, you create intent filters in order to be able to receive intents with this action. You define an intent filter in your manifest, using the <intent-filter> element.
Handle the Incoming Content
To handle the content delivered by an Intent, start by calling getIntent() to get Intent object. Once you have the object, you can examine its contents to determine what to do next. Keep in mind that if this activity can be started from other parts of the system, such as the launcher, then you will need to take this into consideration when examining the intent.
I think this would be a good place to start on how to pass data from one app to another. You will also need to make changes in your current implementation both in your existingt and new app for this to be possible.
The other solution to this is to have all the games share a common Play Game Console configuration. You can have multiple packageIds point to the same appId, so they see the same list of achievements, leaderboards, etc.
Depending on your specific requirements, you could simply change the descriptions of the items to describe which game they are for, or implement custom UIs to display the lists.

Android Intent Category CATEGORY_BROWSABLE

I want to add a web page navigation Activity in my Android application, and I find that I need to use CATEGORY_BROWSABLE. The description says:
By supporting this category, you are promising that there is nothing damaging
(without user intervention) that can happen by invoking any matching Intent.
Can someone tell what risk is Android is trying to highlight here ? What could be damaging in handling web page navigation ?
Operations such as invasive edits to an account, deleting contacts and text messages, downloading files without user permission, etc. are considered damaging without user intervention.
As this category can be added to any activity (webview-based or not), the line you quoted is meant as a general rule of thumb for developers who decide to flag their activities (webview-based or not) as BROWSABLE.

Android google analytics unique visitors

I'm using Google Analytics SDK to collect statistics from my Android application. I want to be able to create a chart showing which language are users using.
To do so, I'm creating a visitor scope custom variable like this:
tracker.setCustomVar(1, "Language", language, 1);
The problem is I'm afraid that this approach isn't correct. I want to create a pie chart in Home -> Dashboards in google analytics, so I choose Add widget -> Pie -> "Unique Visitors" grouped by "Custom Variable (Value 01)".
Pie chart created like above shows invalid results. The goal is to get last variable value for each user and then display the number of users for each value. What it actually does is it takes all variable values and for each value it shows the number of visitors that ever had this value.
This means that if someone switched between languages, he will appear in both languages in the chart. Not the one that he is actually using.
So my question is - how to do it correctly? Should I change something in the code, perhaps use something other than variables? Or maybe it's possible to fix it just via google analytics website?
Thanks
There's no way to achieve what you want.
If the same visitor changes it's language it will have that language from now on, but he'll still show up as the old value on the days before. It happens because in GA history is never rewritten, data is processed by session(visit) and the data that goes in is static and can't be removed or changed. If the visitor was reported only on the new value it means that the visits before would have been changed. This is just against the design.
You may find other ways to remedy that and understand better people that are changing their languages on the application. You may fire an event when Language is changed for example and understand the impact of new languages being added to your application.
There's only one place in GA where you have a better view on multiple sessions. and that's the multichannel funnels, but they only work for Goal Completions reporting on different Traffic Sources. The reports you see there are processed by a separate system inside Google Analytics and can break some of the rules about how Google Analytics processes and stores data. Because of that they can tie the visit back together and understand the progression of changes that happend on the traffic sources dimension and lead to a goal completion.
I'm sorry it doesn't solve your problem. But unfortunately it's just not possible by design.
You don't need to set the user's language yourself, go to your Google Analytics webpage > Audience > Demographics > Language.
This will show you everything you need to know about your users' selected languages.
EDIT:
For a custom app value (like a setting value), in my experience the best approach is to set up a daily/weekly ping of that value as an event, so you'll get a daily pie chart of all your active users selected language.
you can set up such a ping using the AlarmManager

How to set my contacts application as the default?

Is it possible to replace Android's default contacts app? I want my custom app to load in place of the default contact application.
If this is possible, could you explain how this can be accomplished? If not, why? The default keyboard can be changed, why not an application?
This is for the user to decide. Your application needs to be able to receive the Intent for picking an item from the contact list (see this question). The user will decide then, if he wants to use your application as the default one.

Categories

Resources