By Drew Lopreiato
java.io
java.lang
java.util
etc...
The structure of Android.
The structure of an app.
Efficiently use Android documentation.
I don't know everything about Android.
Common Sense should prevail.
The color orange enrages me.
I don't know everything about Android.
Common Sense should prevail.
The color orange enrages me.
NFC (Near Field Communication)
Wi-Fi Peer-to-Peer
Provides a screen with which users can interact in order to do something
Collection of Activities
Saved Back Stack
Start an Activity
Start a Service
Broadcast a Message
Does background processing
Music Playing
Network Transactions
<stuff_i_hate>
<thing>
<name>Pitbull</name>
<description>
For writing the lyrics "Or should I say, I saw, I conquered, I came"
</description>
</thing>
<thing>
<name>XML</name>
<description>
Extremely lengthy, could have used quotation marks but NOOOOOO that'd be too convenient.
</description>
</thing>
<thing>
<name>West Cookies</name>
<description>
Under-cooked Cookies != Good Cookies
</description>
</thing>
</stuff_i_hate>
Well defined and can describe both hierarchy and properties
Separation of View and Model
Configurability
public class MainACMActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_acm);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main_acm, 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();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
@Override
public void onStop() {
super.onStop();
System.out.println("Hammer time");
}
userNameField = (EditText) findViewById(R.id.userName);
userNameField.getText().toString();
public static final String PREFERENCE_FILE = "MyPrefsFile";
int toYourAddress = distanceCalculator(...);
SharedPreferences settings = getSharedPreferences(PREFERENCE_FILE, 0);
SharedPreferences.Editor prefEditor = settings.edit();
prefEditor.putInt("toYA", toYourAddress);
SharedPreferences uptownFunk = getSharedPreferences(PREFERENCE_FILE, 0);
int distanceToYourAddress = uptownFunk.getInt("toYA", DEFAULT_INT);
// Don't beleive me? Just watch.
FileOutputStream fileStream =
openFileOutput(FILENAME, Context.MODE_PRIVATE);
fileStream.write(data.getBytes());
fileStream.close();
FileInputStream fileStream =
openFileInput(FILENAME, Context.MODE_PRIVATE);
something = fileStream.read();
fileStream.close();
new File(
getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES),
"myPicture.png");
Knowledge Required: SQL
java.net.*
android.net.*
private ListView listView;
private ArrayList<String> footballGamePlaylist;
@Override
protected void onCreate(Bundle savedInstanceState) {
...
// fill data
footballGamePlaylist = new ArrayList<String>();
for (int i = 0; i < 50; i++) {
footballGamePlaylist.add("We Dem Boyz");
}
// prepare adapter
ArrayAdapter<String> adapter;
adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, footballGamePlaylist);
// connect adapter
listView.setAdapter(adapter);
}
Not everything needs to extend an Android class.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="us.lopreiato.acm_presentation" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainACMActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Visit my Github for the source where I left more comments.
http://github.com/dLopreiato
Made with reveal.js