Installing two apps using one apk - android

I have 2 apps:
1 - ContentProvider;
2 - Application that uses this ContentProvider.
I need to install these 2 apps using single apk file. I want to push these two apps simultaneously, in Eclipse if I add to buildpath of one app another project and add several lines in the manifest.Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?

Is it possible to install simultaneously two apps(one of them is ContentProvider) using one apk?
No, sorry.

You may define multiple activitys, services etc in one manifest.xml. So if you were to move both of your applications into one project, and then add them both to the manifest, you can in a way install multiple apps in one apk.
Look here for more info about the manifest: http://developer.android.com/guide/topics/manifest/manifest-intro.html
However, as already pointed out, the application-tag can only occur once.

Yes it's possible to have two apps (internally activities) installed in one api.
Extending to dac2009's answer..
Here is one sample Manifest file that does this.
`<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dualapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name_people"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.dualapp.MeetPeopleActivity"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name_people"
android:taskAffinity="com.example.dualapp.MeetPeopleActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.dualapp.MeetTechieActivity"
android:icon="#drawable/ic_tech"
android:label="#string/app_name_techie"
android:taskAffinity="com.example.dualapp.MeetTechieActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>`
Installing this puts two app icons in my mobile.

Related

Android application installs but not launches [duplicate]

This question already has answers here:
My android app is not being displayed in the app drawer?
(3 answers)
Closed 8 years ago.
Before labeling this as a duplicate, please read. I have successfully installed an Android application I developed on Eclipse on to two different platforms: one emulator (Blue Stacks) and one actual device. Like I said, the app installs just fine on both platforms, but it doesn't appear on the list of apps that can be launched. When I go to settings, I can see the app on the list of installed applications, and it lets me uninstall it, but not open it. I've spent hours trying every remedy online, but nothing works. My app is only one activity, so it should be simple, but this is the first app I've developed. I'll attach my manifest xml file below.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.teamjava.theultimatetipcalculator"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.teamjava.theultimatetipconverter.MainActivity"
android:screenOrientation="portrait" >
</activity>
<intent-filter>
<action android:name="android.intent.action.MainActivity" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</application>
You should probably try using the same package name for the app and location of your activity.
You have:
package="com.teamjava.theultimatetipcalculator"
android:name="com.teamjava.theultimatetipconverter.MainActivity"
Try
package="com.teamjava.theultimatetipcalculator"
android:name="com.teamjava.theultimatetipcalculator.MainActivity"
or
package="com.teamjava.theultimatetipconverter"
android:name="com.teamjava.theultimatetipconverter.MainActivity"
EDIT -
Also try placing the intent filter inside the activity. This is how my manifest looks on all my apps
<activity
android:name="com.example.exampleapp.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>
Change:
<action android:name="android.intent.action.MainActivity" />
to:
<action android:name="android.intent.action.MAIN" />
Have you checked your console in Eclipse? Sometimes, your program can compile fine, but display errors in the console on startup.
In Eclipse. Window - show view - Console

Installed test APK does not appear on device's main screen

I installed an instrumentation test APK from Eclipse(Run->Run As Android application) on device as the log shows below.
[2013-08-08 22:14:13 - SettingsTests] /SettingsTests/bin/SettingsTests.apk installed on device
However, on the home screen of the device, somehow the test APK does not show. In Settings->Application Manager, the list shows the test apk correctly.
Any idea what's going on?
The android system info shows:
Source:/data/app/PACKAGE.test.test-1.apk
data:/data/app/PACKAGE.test.test
Here's the test apk's manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="PACKAGE.test.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="17" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="my.package" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Only the activity defined in manifest like below will be shown. You must define at least one activty like that.
<activity
android:name="YourActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
What you are trying to install doesn't have an activity defined in the manifest.
As per the docs
An activity is that implements part of the application's visual user interface.
All activities must be represented by <activity> elements in the manifest file.
Any that are not declared there will not be seen by the system and will never be run.
You can refer the document so as to have an idea how activity works
It's quite normal behavior, as you don't have any activity in your instrumentation package. Didn't you mean to run it as Android JUnit Test?

Android update is installing app again

I have searched through the forum, but found no match for the issue I am currently facing:
I have an app, which installs and works ok, but when I try to update it (install again), the application does not update, but is installed separately one more time - I get two shortcuts, different app data, both versions work, etc.
I have not changed the application name, have observed the same behavior in adb and with actual phone and tablet, also tried with same and increased app version...
This is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rts.android.language" android:versionCode="1" android:versionName="1.1"
android:installLocation="auto">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.VIBRATE"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name="com.rts.android.language.ui.MainActivity"
android:label="#string/app_name"android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Any ideas what the reason might be?
Thanks!
please, make sure both applications contain same package name?
package="com.rts.android.language"
First, try to rename your activity:
from:
<activity android:name="com.rts.android.language.ui.MainActivity" />
to :
<activity android:name=".ui.MainActivity" />
Try to clean your project then build/rebuild...
When doing that you need to clean your Keystore:
%USERPROFILE%/.androidon Windows
~/.android/debug.keystore on Linux and Mac OS X

problem with installing app in the device

I have an android app. (built for 1.5) while installing it on my device it creates no error, but while running it, it says "the application is not installed in your phone"..
can any one help me...?
I have tried this installing after uninstalling it for many times...
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.testapp"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:label="#string/app_name" android:name="WelcomeScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="Untitled1"></activity>
<activity android:name="Welcome"></activity>
</application>
</manifest>
Have you got your package name correct? It will be looking for a different application if your package name in the Manifest does not match that of your project
Its an application error. In application there is an manifest file in which we pass two actions ACTION_LAUNCHER and ACTION_MAIN which is not write there thats why this application says "the application is not installed in your phone" please verify from the android developer of this application. IF you have manifest file of this please write down here. i will correct this.
If this answer is useful to you then please tick that this answer is useful to you.
Who or what tells you "is not installed"?
If you have a shortcut on the home screen, this may become stale and you can get this message.
Try going to the list of apps and starting it from there.
I also see potential that the "com.android.*" package you show is causing issues, as this package may be reserved (at least it is not good practice to use it).
Issue solved,
I just copied and deleted the below lines from the manifest file and pasted it again in the same place ...
I dont know how it solved the issue but it just solved it....
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:label="#string/app_name" android:name="WelcomeScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

application not installing on android emulator

I am running tab based application in android.When i try to install the application on the emulator it gives output in the console as
[2011-03-08 12:40:35 - TabBar] Application already deployed. No need to reinstall.
[2011-03-08 12:40:35 - TabBar] \TabBar\bin\TabBar.apk installed on device
[2011-03-08 12:40:35 - TabBar] Done!
Can anyone tell how should i pursue
Thanks in advance
Tushar
I'm also tackled with this same problem and finally I found the solution for it. When you creating a new android project using Eclipes and if you didn't create a activity for your first window, your project's Manifest also don't create proper codings for you to application launch up.
So, you should hardcode them yourself.
First check these codes are available or not in your Project's Manifest file, within your main activity tags.
**
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
**
These two code lines are very important. Because these two lines are calling to android OS to launch this app.
So, Make sure these codes are available in your project's Manifest file. If it's not this below Manifest file code will gets you rough idea to fix this problem.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mershanfernando.testingappz"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/ic_launcher" android:label="#string/app_name">
<activity android:name=".Main"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

Categories

Resources