App doesn't show up on device - android

So I'm learning android programming and everything is going well, until I came to this problem.
I'm using android studio and transfer my app to my phone, this has worked well until now. The app start automatically and works fine, but when I go back to the home screen on my phone the app is not there, it's not saved on my phone. The problems is the same when using the emulator.
anyone know this problem?

Most probably you need a line in the android manifest that tells us that the app will appear in the launcher.
Check this link out :
https://groups.google.com/forum/m/#!topic/android-developers/csokbhepUG0

In your manifest, add this to your main activity:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
You probably already have the MAIN action on the activity, you just need to add the category <category android:name="android.intent.category.LAUNCHER" /> so that it shows up on the launcher.

Related

Two apps in one apk

When I build a single apk and I try to install it on the device two apps are shown instead of one, but neither app opens. What is the cause of this? I just want one only.
No, there's still just one app but you need to tweak your Manifest file as apparently you have two activities with
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Remove this filter from activity you do not want to be your entry point.

Bundle mobile apps into single 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.

every class of application installing individually in the phone.

I developed an android application with no errors. It is installed in my phone and functioning perfectly but the only problem is, when I'm installing the application. It is installing all the classes in application individually and along with it my main application.
So, how should I prevent all the classes installing individually. please help me.
I am guessing that your AndroidManifest.xml has multiples of this:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Which is causing multiple icons to be showed for each Activity
Find all the "extra" ones and delete them. This used to be an issue with the ADT plugin a while back (every time you made a new Activity via the wizard, it would auto add it with launcher attributes), you seem to be on an older version. You should update it.

Bundling multiple apps I have created into one .apk file

Is it possible to bundle an app and the app settings into one apk file? so I can change the app settings from the "App settings"
Thanks
If these two apps have no overlaps, you only need to merge the AndroidManifest.xml, res and src folders.
Keep two activities with the following intent filter:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
will make you have two launch entrances in Launcher.
In fact, it's one app with one apk. But since have two launchable activities, user will feel like they have installed two apps with one apk.
Found answer on another question

android market is not showing my published application

i have published android app but not appearing in android market.i m using android 2.2 and i have tried in samsung galaxy that is not showing my application so just give me some idea to fix this problem.
this is my manifest.xml file:
<activity android:name=".Full"
android:screenOrientation="landscape"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
<activity android:name=".Short"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.SAMPLE_CODE" />
</intent-filter>
</activity>
</application>
Please help me..
The android market appears to be experiencing some problems for many isers currently. Many people are unable to download anything from it. I would imagine that your problem is related to this. And i would guess it will be fixed tomorrow if not in a few hours or less.
Check your developer console for the market. Make sure that you see your app in the console and that it say "published" on the right. If that's all there, click on the app name to see the details and then expand the section on market filtering. It might explain there why your app may not be showing up on your galaxy tab.
Or, like #Tim says, you may just need to be patient. The market infrastructure for developers still has quite a few warts.

Categories

Resources