Uninstalling Android Application - android

When I create an Android project in Eclipse and send it to my device for debugging, the app works fine but when I try to uninstall it, I get a strange message. Below are the steps to recreate my problem:
Eclipse Version: 4.2.0 Build id: I20120608-1400
ADT Version: 2.0.3 v201208082019-427395
Run Eclipse
Click File->New->Project...
Select Android/Android Application Project
Click Next.
Enter Application Name: Test
Build SDK: Android 4.1
Minimum Required SDK: API 8 Android 2.2
Enable: Create custom launcher icon / Create project in workspace
Click Next thrice.
Click Finish.
Connect 4.1 Android device to computer via USB.
Click Run->Run from menu.
Select "Android application" on popup the "Run As" popup.
Click Ok.
MainActivity application runs on device.
Click the Back button on the Android device.
Open applications on device and find "MainActivity" app.
Long press the MainActivity icon and drag to trash.
Here's the puzzling part:
Instead of getting a standard
Do you want to uninstall this app?
I get a dialog with this text:
MainActivity is part of the following app: Test
Do you want to uninstall this app?
Why do I get this message instead of the standard one?
Why is MainActivity the name of the app when I specifically stated the name of the app is "Test"?
Additional Information:
If I go to Settings->Apps, the Application shows up as Test but is listed in my Launcher as MainActivity.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

The solution is to remove android:label="#string/title_activity_main" in the activity element.
The AndroidManifest.xml below solves the problem on Android 4.1.1 .
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
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>

Make sure your app name app_name is not styled.
Since I was using the app name somewhere else in the app I had made it bold, like this - In my strings.xml
<string name="app_name"><b>We are sons<b></string>
When I removed
<b></b>
tags, it worked.
Just keep it :
<string name="app_name">We are sons</string>

I do not know how to solve the first issue but the second can be solved in the following way. The problem is connected with Android new project wizzard. To solve this problem you can correct your manifest file in the following way and redeploy your project:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter android:label="#string/app_name" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Do not forget to check what is the value of app_name. Some more details you can find in this post

Related

Android app is not showing installed on emulator and my device

I have tried converted my android app from eclipse to android studio project and app is working on testing on emulator and my real device but I couldn't find it when trying to exit the app .. After publishing to the store I got the same issue + app is never open .. after installing I just got uninstall only on google play store .. please help :)
this is app url to the store : https://play.google.com/store/apps/details?id=com.linkedtalents.app&hl=en
Here is my manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.linkedtalents.app"
android:versionCode="10"
android:versionName="1.1" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/launch123"
android:label="#string/app_name"
android:largeHeap="true" >
<activity
android:name="com.linkedtalents.app.Splash"
android:theme="#style/AppBaseTheme"
android:screenOrientation="portrait"
android:configChanges="locale"
>
it seems that you are missing the intent filter. at least you didnt post it. can you have a look that you have the MAIN LAUNCHER like here? you need exactly one activity that matches this, if you want to be started from a homescreen.
<activity
android:name="..."
android:label="#string/app_name"
android:theme="#style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Unable to instantiate activity componentinfo classnotfoundexception

I've developed an app but when I run it, it crashes and shows the error: android unable to instantiate activity componentinfo classnotfoundexception.
I've read a lot about this error. I've tried Project -> Properties -> Java Build Path -> Order & Export and ensure Android Private Libraries and all other library projects are checked.
I've also noticed that when I press ctrl and pass the mouse over, for example, .MainActivity in my Android Manifest file, it doesn't display or link me to the Activity, don't know why.
Any ideas about this problem? Thank you so much.
EDIT: Manifest added
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.isa.mememe"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="16" />
<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"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</manifest>

Android app can't run on real device, but does recognize it

I'm trying to write my first android app.
Eclipse does recognise my phone, but can't launch the app on it. The "OK" button can't be pressed.
Any idea?
Thanks
xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<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>
</application>
Solved.
The problem is with my phone.
I checked with another device and it was OK.
Thanks and sorry for botherring.
Check if your SDK is up to date using Android SDK Manager in Eclipse. If not update it. Install min sdk version and max sdk version package you want.
Check if OEM drivers for the respective device are installed on the PC and Developer options on the phone are activated. To know what are OEM drivers check this link
Lastly check for hardware loose connection in the USB wire and unplug and plug it again. :) :P

Export Problems - to .apk

App works fine when tested from Eclipse on phone via USB/Sync, when I try and Export it to an .apk, the Manifest.xml looses track of 2 activities under the parent "MasterActvity". Then even the USB/Sync stops working because it can't locate the activities. No memory storage is used, just text displays.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.theoreferenceguide"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.theoreferenceguide.MasterActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="TipActivity"></activity> This keeps getting kicked out during .apk
<activity android:name="UccActivity"></activity> This keeps getting kicked out during .apk
</application>
</manifest>
I agree with nicopico. It looks like you are missing the . infront of the activity which tells the manifest that the activity is in the local namespace. Alternatively if TipActivity is in the same namespace as MasterActivity you can also do android:name="com.example.theoreferenceguide.TipActivity"

How can I check my banner application on my actual android device that is it working correctly or not?

I have developed a simple application using SDK(Android: 3.2[API-13]) for, to display Google banners.
I have tow problems in this application.
Problem No.1:
I have checked the application it runs on emulator but how can i check it that it working correctly or not?
Problem No.2:
I want to run the application on my physical Android device using Android version 2.3.3. What changes I need to do in the application to run it on my Android device using Android version 2.3.3.?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.farman.banner"
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=".MyBannerActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
</manifest
>
Ans 1 :-You have to install it in the Device and Check it.
Ans 2 :-To Run it in the 2.3.3 version,you have edit the files as below:-
project.properties OR default.properties(Only 1 of the 2 may
be present in the root folder)
Here...Change the value of target=android-10
Androidmanifest.xml
Here...Check and Change the value of
<uses-sdk android:minSdkVersion="13" /> as <uses-sdk android:minSdkVersion="10" />
Now clean and run your application and it will run in 2.3 version.

Categories

Resources