Ich benutze als Framework Android Studio und als Betriebssystem Windows 10.
Auf dem Smartphone wird der Installationsprozess der apk-Datei noch dargestellt, danach ercheint aber die Meldung "App wurde nicht installiert".
Hier der Quellcode:
StartActivity.java :
package com.example.myapplication2; import android.app.Activity; import android.os.Bundle; public class StartActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.myapplication2"> <application android:label="@string/app_name"> <activity android:name=".StartActivity" android:label="@string/app_name" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> layout-datei main.xml :
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" androidrientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello World, StartActivity!"/> </LinearLayout>
Auf dem Smartphone wird der Installationsprozess der apk-Datei noch dargestellt, danach ercheint aber die Meldung "App wurde nicht installiert".
Hier der Quellcode:
StartActivity.java :
package com.example.myapplication2; import android.app.Activity; import android.os.Bundle; public class StartActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.myapplication2"> <application android:label="@string/app_name"> <activity android:name=".StartActivity" android:label="@string/app_name" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> layout-datei main.xml :
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" androidrientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello World, StartActivity!"/> </LinearLayout>
Comment