1

I am running into an issue that is confusing me. It seems as if android apps are NOT fully compartmentalized is this the case.

I have a Samsung SIII phone and I am building apps that are used as templates. Basically it is the same app but with different content the content is retrieved from our database at startup.

So my process is to create a single app get it working, then copy it to another package through refactoring and I change the data retrieval calls and I have two apps the internal functioning and coding is basically identical.

What I am seeing is this I start one app and it seems to be working just fine and I can open and close it several times with no issue, then out of the blue I get a pop up that says a certain app has stopped functioning. The issue is I never opened that app I could have opened one of the duplicates but I even forgot I had the app that crashed on the phone let alone starting it.

I routinely shut down all running apps just to make sure things run smoothly and I never see that this mystery app is running anywhere.

The shut down message just simply appears but it is always after running apps that ran the same code but not all the time.

This may be the reason I have seen some other issues but can't tell the basics of the other issue is two sets of code that are pretty much identical per my process where one works and the other doesn't

I am very confused Can anyone help clear the smoke?

this may help it is a list of my permissions

uses-permission android:name="com.android.vending.BILLING" 
uses-permission android:name="android.permission.INTERNET" 
uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" 
uses-permission android:name="android.permission.READ_PHONE_STATE" 
uses-permission android:name="android.permission.ACCESS_WIFI_STATE" 
uses-permission android:name="android.permission.BLUETOOTH" 

The content for all of my template apps will be VERY similar except for the package name versions etc.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blah.blahblah"
android:versionCode="2"
android:versionName="0.75" >
<uses-sdk
    android:minSdkVersion="5"
    android:targetSdkVersion="7" />
<!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".IntroActivity"
        android:label="@string/title_activity_main"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".InfoActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".AudioActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".MovePlayActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".WebActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
</application>

Here is a second one

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blah2.blah2blah2"
android:versionCode="4"
android:versionName="1.5" >
<uses-sdk
    android:minSdkVersion="4"
    android:targetSdkVersion="7" />
<!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >
    <activity
        android:name=".IntroActivity"
        android:label="@string/title_activity_main"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".AudioActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".MovePlayActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name=".WebActivity"
        android:configChanges="orientation|keyboardHidden"
        android:screenOrientation="portrait" >
    </activity>
</application>

I do see the min SDK version has changed I don't remember doing this right off hand but I must have for some reason

Jeff Janes
  • 885
  • 1
  • 8
  • 22
  • 1
    Are you registering any BroadcastReceivers that might be waking up the various apps? Do you see any relevant info in Logcat when you see the "Unfortunately, X has stopped" dialog? – acj Jan 09 '13 at 18:19
  • 1
    Please post the manifests from 2 examples. And please, don't kill running apps. It's a long story and argument but Android works much better if you let it make the decisions. You don't even mean "running"! – Simon Jan 09 '13 at 18:19
  • I looked at the task manager and they show as active not running sorry about that but those are the ones I closed I will try to stop doing that nad I will add two manifest files although I have several apps that fall into the same category but i will show the manifest for the app that mysteriously appears – Jeff Janes Jan 09 '13 at 18:25
  • The interesting bit is how you've declared the package names, activities and intent filters. – Simon Jan 09 '13 at 18:34
  • I am having trouble finding the actual eclipse files for the troublesome package but the structure is that of the inapp purchase tutorials published by google V2 and V3. I also just started the troublesome app and closed it down and then a bout a minute later i got the unexpectedly closed message I tapped OK and it closed again then aminute later I got it again. since then nothing – Jeff Janes Jan 09 '13 at 18:40
  • With 100% certainty, the manifests are identical apart from the app name and package? – Simon Jan 09 '13 at 18:56
  • This one has an extra activity called info but other than that it uses all the same permissions and only these permission laid out just like this – Jeff Janes Jan 09 '13 at 19:16
  • About the only thing I can think of is to try to figure out who launched the activity. Take a look at the answer from iHearGeoff here http://stackoverflow.com/questions/4789155/how-to-find-intent-source-in-android. It's not trivial. Good luck! – Simon Jan 09 '13 at 19:26

0 Answers0