M
M
m1ck2014-04-16 19:15:12
Android
m1ck, 2014-04-16 19:15:12

How to write at least a simple a+b program in Android Studio?

The tutorials are mostly incomprehensible, so I opened the MainActivity in the java folder. and I have here:
package com.project.oneproject;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
public class MainActivity extends ActionBarActivity {
@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;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
Should I add here how the code for a + b is in Java, or how would it look more correct?
Explain, please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
pigah, 2014-04-16
@m1ck

startandroid.ru/ru/uroki.html everything is pretty well written here, read

G
Grigory Zhernov, 2014-04-17
@gzhernov

I want to get a job as an Android developer. Where to start, where to go?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question