Android multi-process application - android

I have been wondering 1 thing about running multi-process app on Android.
Say, I have a setup in the manifest file as follow..
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.multiprocess">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MainService"
android:process=":main" />
<service
android:name=".SubService"
android:process=":sub" />
</application>
</manifest>
With this, when I start both services with startService() and I will see each process listing separately on system's "Running services" page. (See image below)
I would like to know how can I get both processes list under 1 name like Google Play services does? (see image below)

Probably, they use android:sharedUserId for all of their processes. But in any case you can figured that out by extracting AndroidManifest.xml from Google Play *.apk file and analyze it

Related

Every time when i open class teacher's project to my system it shows this error.Error running app: Default activity not found

I'm a beginner in Android.
Every time when I open class teacher's project to my system it shows this error.
Error running app: Default activity not found.
What should I do to match the same project as my teacher's?
I've tried many solutions.
My Manifest file is
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.assigncheckbox">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
maybe it happen because you didn't add this activity to your AndroidManifest.xml
<activity
android:name=".yourActivity"
/>

Can't find uses-permission into manifest file

I'm trying to upload a new version of an application into Google Developer Console.
At the end of the upload, the console show this error message:
"Your APK uses permissions that require the setting of privacy policies: (android.permission.CAMERA)"
So I think that I have this uses-permission into the manifest file and I need to add a google privacy policy.
That's ok, but this is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="simone.biliato.delonghitrevisotvb">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="simone.biliato.delonghitrevisotvb.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="simone.biliato.delonghitrevisotvb.NotificationInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name="simone.biliato.delonghitrevisotvb.NotificationMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
Where are all the permissions? Why I don't see them? I'm sure that I added them earlier and now disappear. Is there a specific location? A list of all permission for the project?
User permissions are made up from the ones you have in your manifest and those that come from the library or dependencies you have in your project. The result will be a manifest merged by all of them. Check your dependencies.
You can use the apk analyzer : https://developer.android.com/studio/build/apk-analyzer.html
Our friends from CommonsWare give us a good solution to detect where the permissions come from:
https://commonsware.com/blog/2015/06/25/hey-where-did-these-permissions-come-from.html
To get a better sense of where those elements are
coming from, we can look at
app/build/outputs/logs/manifest-merger-debug-report.txt.

Android Studio: App Installs But Doesn't Open Android 5.0

I've been trying to make an app. I've finished it with no errors, but when I install it on my device I can't open it.
I've searched for the solution on here, but nothing has helped. Most people post their AndroidManifest, so here it is.
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"></application>
<activity android:name="Main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Any help is much appreciated. Thanks!

unfortunately package installer has stopped android

I want to create a live wallpaper in android. My app works fine on emulator but on my phone, I am not able to install it.
Here is my AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.BIND_WALLPAPER"
android:supportsRtl="true"
android:debuggable="false"
android:theme="#style/AppTheme">
<service
android:name="GIFWallpaperService"
android:enabled="true"
android:label="Wallpaper Example "
android:permission="android.permission.BIND_WALLPAPER" >
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService" >
</action>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/wallpaper" >
</meta-data>
</service>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
wallpaper.xml :
<?xml version="1.0" encoding="UTF-8"?>
<wallpaper
xmlns:android="http://schemas.android.com/apk/res/android"
android:label="GIF Wallpaper"
android:debuggable="false"
android:thumbnail="#mipmap/ic_launcher">
</wallpaper>
Whenever I try to run my code on emulator everything works fine but when I copy
"app-debug" to my phone and try to install it does not work.
After installation is complete I get two options :
Open the app.
Done.
If I click Done nothing happens and afterwards if I click my installed app icon it says app is not installed.
If I click open at the end of installation it says unfortunately package installer has stopped android
Debuggable is set to false right? Does not that mean that you can not debug with it? Try removing 'android:debuggable="false",'and see if it works.
I found my answer here :
Android Permission Denial starting Intent for Wallpaper Settings
I had android:permission="android.permission.BIND_WALLPAPER" at the wrong place.

Voice command not working on my glass app

My manifest file is as below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.demo.myglassapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="com.demo.myglassapp.MainActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger_start" />
</service>
</application>
</manifest>
voice trigger start file
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="#string/its_demo" />
My strings.xml file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">myglassapp</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="its_demo">Hello Sir</string>
</resources>
As per my knowledge I have added a code block
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
in manifest file. I created a voice trigger file and set a variable in it.
Now i call that variable from strings.xml file.
So, basically it is all correct but i do not see "Hello Sir" added to my OK GLASS menu.
When I run my application from Eclipse IDE, i do not see my menu after OK GLASS menu option.
In stead, I see my app directly running like it runs in Android phone when we set it in debug mode.
Any idea why it is not working?
I agree with Nicole. Maybe if you move some stuff around it may work. But, it depends a lot on how you are building your app. In my case, for example, the voice trigger intent is define for my activity, not my service (Similar to Nicole's case). However, I have seen some examples where the trigger is on the service. You can check those examples by creating a sample Android project in Eclipse.
Now, the reason why your app is opening after you run it similarly to a mobile is because you have this on your manifest
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
You should remove that if you dont want that behavior
In your glass itself you say your application name it will show the list of app
Try this Hope this will help
I am new to glassware development.. but maybe try moving some things inside your application tag in manifest (instead of the service tag.. I do not have a service tag at all). Here's an example of my manifest file that works with voice recognition from the start menu...
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="#xml/voice_trigger_start" />
</activity>
</application>`

Categories

Resources