A
Android Question
Guest
Hello, im going make this short and precise;
*I'm running ubuntu 14.04+
*running eclipse while connected to nexus 4 (ANDROID 4.3)
*started programing for android application where i only had the option to program at android level 5.1 (at the start of the program where it asks you to set).
So i launched the program at first and it gave this error
ERROR: Application requires API version 22. Device API version is 18 (Android 4.3)
so i read online and changed things around in my
<uses-sdk
android:minSdkVersion="22"
android:targetSdkVersion="22" />
TO
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />
BUT my app lanuches and crashes right away.
error produced in LOGCAT
GC_FOR_ALLOC freed 495K, 6% free 9168K/9704K, paused 12ms, total 12ms
and thats where the program stops at in the console
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=self.name.firstandroidprogram/.MainActivity
lastly here is my code in java
package self.name.firstandroidprogram;
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
public class MainActivity extends Activity {
LinearLayout layout1;
TextView label1;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
layout1 = new LinearLayout(this);
label1 = new TextView(this);
layout1.addView(layout1);
setContentView(layout1);
}
}
Thank you.
*I'm running ubuntu 14.04+
*running eclipse while connected to nexus 4 (ANDROID 4.3)
*started programing for android application where i only had the option to program at android level 5.1 (at the start of the program where it asks you to set).
So i launched the program at first and it gave this error
ERROR: Application requires API version 22. Device API version is 18 (Android 4.3)
so i read online and changed things around in my
<uses-sdk
android:minSdkVersion="22"
android:targetSdkVersion="22" />
TO
<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />
BUT my app lanuches and crashes right away.
error produced in LOGCAT
GC_FOR_ALLOC freed 495K, 6% free 9168K/9704K, paused 12ms, total 12ms
and thats where the program stops at in the console
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=self.name.firstandroidprogram/.MainActivity
lastly here is my code in java
package self.name.firstandroidprogram;
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.LinearLayout;
import android.widget.TextView;
public class MainActivity extends Activity {
LinearLayout layout1;
TextView label1;
@override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
layout1 = new LinearLayout(this);
label1 = new TextView(this);
layout1.addView(layout1);
setContentView(layout1);
}
}
Thank you.