4 ms·
What nonsense? I found the google page on beacons and it says to go and deal with oauth. https://developers.google.com/beacons/proximity/get-started https://de
by IanCal 9y ago
What nonsense? I found the google page on beacons and it says to go and deal with oauth.
https://developers.google.com/beacons/proximity/get-started https://developers.google.com/beacons/proximity/get-started
Android dev used to say to go to eclipse, now it's JetBrains apparently. Have a look at the "your first app" here:
https://developer.android.com/training/basics/firstapp/index.html https://developer.android.com/training/basics/firstapp/index...
Compare just part of the code for making text appear:
public class MainActivity extends AppCompatActivity {
public static final String EXTRA_MESSAGE = "com.example.myfirstapp.MESSAGE";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
/** Called when the user taps the Send button */
public void sendMessage(View view) {
Intent intent = new Intent(this, DisplayMessageActivity.class);
EditText editText = (EditText) findViewById(R.id.editText);
String message = editText.getText().toString();
intent.putExtra(EXTRA_MESSAGE, message);
startActivity(intent);
}
}
Which comes along with XML like this
All you need to do is declare which activity is the logical parent in the AndroidManifest.xml file. So open the file at app >
manifests > AndroidManifest.xml, locate the <activity> tag for DisplayMessageActivity and replace it with the following:
<activity android:name=".DisplayMessageActivity"
android:parentActivityName=".MainActivity" >
<!-- The meta-data tag is required if you support API level 15 and lower -->
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
This is before trying to get radios working, beacons, etc. Just text, a button and "back".
For something exciting and interesting, I'd rather not see "paste the following XML" anywhere in the instructions.