Reputation: 31
I am new with JavaScript and Developement on Android
. I installed Eclipse
but I can't even run the "Hello World" program, included when you created a new project !
Please help me, I spent the two last days installing this IDE (even tried Android Studio
),
but there is always the same error :
Could not find Chwet.apk!
And there seems to be an error with the "R", like in setContentView(R.layout.activity_main)
Here is my code :
package com.example.chwet;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
Upvotes: 0
Views: 68
Reputation: 1568
Look at following tutorial to get start with Android application development.
Upvotes: 1
Reputation: 1568
Press Ctrl+shift+o to add missing packages. It will automatically remove your errors.
Upvotes: 0
Reputation: 622
Instead of importing android R class , import R class with your package name.
Upvotes: 0