1

I've made an Android application using Eclipse. It has no errors, good to go, but I wanted to test it on my own phone first. I copied the APK file to my Samsung Galaxy S6 using an USB cable. Unplugged it, made sure the file version is not higher or later than my android version on my phone.

Used an APK installer app, and it's installed. It's at my files, and I can update it how many times I want. After updating, or installing it gives 2 buttons in the button. "Ready" and "Open". "Ready" is the only one clickable, and leaves the page. I can't open the apk-file. I've followed every tutorial but I just can't open it.

This is my Manifest code:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.rodekruis"
    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:supportsRtl="true"
        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>
        <activity
            android:name=".BezoekActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="com.example.rodekruis.BezoekActivity" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".AfspraakActivity"
            android:label="@string/title_activity_afspraak" >
        </activity>
        <activity
            android:name=".ContactActivity"
            android:label="@string/title_activity_contact" >
        </activity>
        <activity
            android:name=".MeningActivity"
            android:label="@string/title_activity_mening" >
        </activity>
        <activity
            android:name=".RouteActivity"
            android:label="@string/title_activity_route" >
        </activity>
        <activity
            android:name=".SpecialistenActivity"
            android:label="@string/title_activity_specialisten" >
        </activity>
        <activity
            android:name=".BWCActivity"
            android:label="@string/title_activity_bwc" >
        </activity>
        <activity
            android:name=".AgendaActivity"
            android:label="@string/title_activity_agenda" >
        </activity>
        <activity
            android:name=".InfoActivity"
            android:label="@string/title_activity_informatie" >
        </activity>
        <activity
            android:name=".VriendActivity"
            android:label="@string/title_activity_vriend" >
        </activity>
        <activity
            android:name=".FoldersActivity"
            android:label="@string/title_activity_folders" >
        </activity>
        <activity
            android:name=".NieuwsActivity"
            android:label="@string/title_activity_nieuws">
        </activity>
    </application>

</manifest>

Does anybody knows why this is, or how I can solve it? If I need to add more things, feel free to ask. I'm struggling with this and really want it to work on my phone. Thanks in advance!

Koen de baas
  • 51
  • 1
  • 10
  • 1
    what do you mean by "i can't open apk file"? I don't get it. – Flash Thunder Jun 29 '16 at 10:04
  • after you install it you can just access it like other apps.. like WhatsApp..!! not need to open APK file..!! – Janki Gadhiya Jun 29 '16 at 10:05
  • _"Used an APK installer app"_ Why? Can't you just use `adb install MyApp.apk` while you have the phone attached via USB? – Michael Jun 29 '16 at 10:06
  • What i mean by "i can't open the file" is that I can install it on my phone, but I can't open it. The app is only findable in my downloads, but I can't open it. There is a button "open" after installing but I can't click on it. – Koen de baas Jun 29 '16 at 10:06
  • @janki gadhiya it's not with my apps. It's only in my downloads, and from there i'm not able to open it. – Koen de baas Jun 29 '16 at 10:07
  • @Michael did many things. Used an app, and did it your way. The app is in my "APK installer", it's in my files, it's at my downloads. I'm just no where able to actually OPEN it. It's there, but I can't see inside it, checking if everything works. – Koen de baas Jun 29 '16 at 10:08

1 Answers1

1

Activate USB debugging. It is easier.

Also:

 <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.rodekruis"
    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:supportsRtl="true"
        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>
        <activity
            android:name=".BezoekActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.category.DEFAULT" />

                <category android:name="com.example.rodekruis.BEZOEKACTIVITY" />
            </intent-filter>
        </activity>
        <activity
            android:name=".AfspraakActivity"
            android:label="@string/title_activity_afspraak" >

        </activity>
        <activity
            android:name=".ContactActivity"
            android:label="@string/title_activity_contact" >
        </activity>
        <activity
            android:name=".MeningActivity"
            android:label="@string/title_activity_mening" >
        </activity>
        <activity
            android:name=".RouteActivity"
            android:label="@string/title_activity_route" >
        </activity>
        <activity
            android:name=".SpecialistenActivity"
            android:label="@string/title_activity_specialisten" >
        </activity>
        <activity
            android:name=".BWCActivity"
            android:label="@string/title_activity_bwc" >
        </activity>
        <activity
            android:name=".AgendaActivity"
            android:label="@string/title_activity_agenda" >
        </activity>
        <activity
            android:name=".InfoActivity"
            android:label="@string/title_activity_informatie" >
        </activity>
        <activity
            android:name=".VriendActivity"
            android:label="@string/title_activity_vriend" >
        </activity>
        <activity
            android:name=".FoldersActivity"
            android:label="@string/title_activity_folders" >
        </activity>
        <activity
            android:name=".NieuwsActivity"
            android:label="@string/title_activity_nieuws">
        </activity>
    </application>

</manifest>

You have to have a launcher defined. The rest have to be defined as you originally defined the first activity with default and the package name. The main activity(the first to launch) has to be defined with MAIN and LAUNCHER

EDIT:

OK, I screwed up. I updated it. Action cannot be the package name:

<action android:name="android.intent.category.DEFAULT" />

<category android:name="com.example.rodekruis.BEZOEKACTIVITY" />

You did it the other way around which is why it didnt work. You have to do the default and name for all the activities. The MainActivity was written correctly

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • So those lines at Main and Bezoek, with MAIN and LAUNCHER is what I need to add on all those activities under there as well? – Koen de baas Jun 29 '16 at 10:11
  • no, I'm sorry. I did not see the main activity. Editing now – Zoe Jun 29 '16 at 10:12
  • @Koendebaas I edited the answer. You had swapped the two actions in intent-filter. For all activities you have to add the IntentFilter with DEFAULT on action and the package name on category – Zoe Jun 29 '16 at 10:17
  • Thanks a lot, i'll try that. Do I just have to save it, then copy the same file to my phone again? Or can I update it on my phone right away? – Koen de baas Jun 29 '16 at 10:21
  • Because you mixed up the action and category tab the manifest was wrong and therefore the app would not start. With USB debugging you would be able to see the stacktrace. In addition you have to add intentfilter to all the classes – Zoe Jun 29 '16 at 10:21
  • Here: http://stackoverflow.com/questions/16707137/how-to-find-and-turn-on-usb-debugging-mode-on-nexus-4 It works on every device as far as I have tried – Zoe Jun 29 '16 at 10:22
  • It works, I got it on my phone. However, i tried to update it after changing some things. I just copied the file after saving it on my phone again, replacing the old file. Installing it again on my phone, but nothing changes. Do you know how I can update it after changing some things? – Koen de baas Jun 29 '16 at 12:21
  • Use USB debugging instead. It makes it easier because you can see exactly what is wrong if your app crashes. It also allows you to test without signing the APK. See the link I posted in a comment above – Zoe Jun 29 '16 at 12:23
  • I have that enabled already. It's that thing with pressing the buildnumber 7 times right? – Koen de baas Jun 29 '16 at 12:25
  • almost. That is developer settings. Go into the developer settings and activate USB debugging. Then it is just to press launch from android studio – Zoe Jun 29 '16 at 12:27
  • Oh you have to actually start it from the android studio.. Eclipse in my case. Well, eclipse doesn't seem to recognize my phone. It's plugged in with USB, but at Run Configurations, my phone is not visible. – Koen de baas Jun 29 '16 at 12:33
  • SOme phones do not support it for some reason. I have seen that all Nexus phones support it, and to my knowledge Samsung galaxy s5 and s6(and edge). Did you activate usb debugging? (this thing: http://www.androidcentral.com/sites/androidcentral.com/files/postimages/684/usb-debugging.png) – Zoe Jun 29 '16 at 12:35
  • Yes, it's called USB-foutopsporing, that's it in dutch. It's enabled. I do have an Samsung Galaxy S6 though.. – Koen de baas Jun 29 '16 at 12:37
  • I got the S6 edge. I'm not experiencing any problems. What OS do you have? – Zoe Jun 29 '16 at 12:39
  • Android-version 6.0.1 When it's USB plugged in, I can't see the device anywhere on the Android Device Chooser.. – Koen de baas Jun 29 '16 at 12:42
  • Then I don't know. You might have to google about it – Zoe Jun 29 '16 at 12:44