Can one APK result in multiple icons/apps on the device?

by Andrew » Thu, 09 Jul 2009 00:36:26 GMT


Sponsored Links
 Hi all,

Curious if this functionality is present on the Android platform.  I'm
looking to package my apps into a single APK file, which when
installed would spawn multiple application icons on the device.  All
applications would be related and would talk to each other (this part
isn't a problem and is working fine).

Can I package multiple related apps in a single APK install file?

Thanks

--~--~---------~--~----~------------~-------~--~----~



Can one APK result in multiple icons/apps on the device?

by Mark Murphy » Thu, 09 Jul 2009 00:41:37 GMT


 


That depends on what you mean by "app".

If you mean multiple icons in the Launcher, sure, no problem. Just have
all such activities have the standard intent-filter with <action
android:name="android.intent.action.MAIN" /> and <category
android:name="android.intent.category.LAUNCHER" />. Every activity with
that intent filter will show up with an icon.

If you want multiple entries in the Manage Applications list in
Settings, though, that cannot be done AFAIK.

In Android, an app = APK. What you are really creating with the multiple
icons is a single app with multiple user-initiated entry points.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Warescription: Three Android Books, Plus Updates, $35/Year

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Can one APK result in multiple icons/apps on the device?

by Bryne McCullough » Wed, 05 Aug 2009 00:21:28 GMT


 'm trying to do the same thing as the original poster: That is, have
one APK, resulting in multiple icons in the Launcher app tray, each
icon launching a different Activity within my APK. Seems like a simple
thing, but it's not working for me.

I've posted my AndroidManifest.xml below. The behavior I'm seeing is
that I indeed get two icons in the Launcher app tray -- an icon for
Foobar1, and another icon for Foobar2. Both icons work as expected if
they're the first thing I click. That is, icon Foobar1 launches
Activity Foobar1, and icon Foobar2 launches Activity Foobar2.

However, if I launch Foobar1, then hit the home key (not the back
key!), then try to launch Foobar2, what I get is Foobar1 -- and vice
versa.

It seems like if either Foobar1 or Foobar2 are already instantiated
within the app's task, and I go back to the Launcher and attempt to
launch either Foobar1 or Foobar2, the Launcher simply brings my
already existing task to the foreground showing whatever Activity was
previously on top.

Any pointers? Thanks!

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.foobar"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="Foobar">
<activity android:name=".Foobar1" android:label="Foobar1">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".Foobar2" android:label="Foobar2">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category
android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="3"/>
</manifest>





On Jul 8, 9:41am, Mark Murphy <mmur...@commonsware.com> wrote:

--~--~---------~--~----~------------~-------~--~----~



Can one APK result in multiple icons/apps on the device?

by Bryne McCullough » Wed, 05 Aug 2009 10:38:13 GMT


  think I have a solution figured out. As my limited understanding
goes, the launcher always launches Activities with
FLAG_ACTIVITY_NEW_TASK, which means the newly launched activity is
intended to be the root of a new task. However, if that task already
exists with a different Activity at its root, this doesn't work. So,
the solution to the example I pasted in my prior post with Activities
Foobar1 and Foobar2 would be to give those two Activities different
task affinities like so:

...
<activity android:name=".Foobar1" android:label="Foobar1"
android:taskAffinity=".Foobar1">
...
<activity android:name=".Foobar2" android:label="Foobar2"
android:taskAffinity=".Foobar2">
...

Clarifications would be welcome!



On Aug 3, 5:48pm, Bryne McCullough <bryne.mccullo...@gmail.com>
wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. First Market Experiences

Now that I've released my first app on Android Market, I can see some of 
the good and bad features that I've seen discussed here. I was mainly 
surprised by a number of low ratings by people who had obviously hardly 
used the program, or at least not for what it was intended for. 
Especially for free apps, there seem to be a number out there who 
download anything new & free, try things until they find something they 
don't like, then rate it 1 star with a comments like "Doesn't do X. 
Uninstalling." Too bad there's not a way to respond to some of these.


The big surprise to me, however, was the error reporting capabilities. I had no idea that AM would provide details on errors right down to the stack trace! Yes, I did have some dreaded NullPointer situations{*filter*} around, but was able to immediately get fixes into the next update to take care of them. I am mightily impressed with this feature! Doug Gordon --

2. AESObfuscator is very slow

I am trying to implement the Market License Checker, and am following
the sample application.  I am using the AESObfuscator class, but find
that it takes a VERY long time (23 seconds on the emulator) to
instantiate, which greatly delays the startup of my application.  Is
this normal, or am I doing something wrong?  If it is normal, can I
put the license check in a separate thread, or does it need to run in
the main thread?

Thanks.

-- 

3. Skype for Android

4. SimpleExpandableListAdapter sub-class

5. GPS & NET Position

6. FLV Player

7. Prevent Rooted phones to access sqlite db and preferences