Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting Started in Android Dev 2016

Getting Started in Android Dev 2016

Guest lecture/talk for Comp Sci Bristol University - Nov 2016.

Scott Alexander-Bown

November 07, 2016
Tweet

More Decks by Scott Alexander-Bown

Other Decks in Technology

Transcript

  1. WHO THE HECK IS THIS GUY? ➤ Freelance (remote) Android

    Developer ➤ https://scottyab.com ➤ Google Developer Expert for Android ➤ Founder/Organiser SWMobile Meetup ➤ http://swmobile.org ➤ Co-Author Android Security Cookbook ➤ Follow on Twitter @scottyab @scottyab
  2. AT A GLANCE ➤Tools / IDE ➤Components ➤Dependancies / 3rd

    Party Libs ➤Tips *Reminder LAB - 11am to Midday, Wednesday 9th November 2016 Merchant Venturer's Building 2.11 Linux Computer Lab
  3. ACTIVITY ➤ AKA a Screen ➤ has distinct lifecycle ➤

    onCreate() ➤ onStart() ➤ onResume() ➤ onPause() ➤ onStop() ➤ onDestory() https://play.google.com/store/apps/details?id=name.peterscully.learning.activitylifecycle @scottyab
  4. INTENTS ➤ Action ➤ Extra ➤ Primitives ➤ Parcelables public

    void sendMessage(String message) {
 Intent intent = new Intent(this, DisplayMessageActivity.class);
 intent.putExtra(EXTRA_MESSAGE, message);
 startActivity(intent);
 } @scottyab
  5. @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_display_message);
 
 Intent

    intent = getIntent();
 String message = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
 
 TextView messageText = (TextView)findViewById(R.id.messageText);
 messageText.setText(message);
 }
  6. SERVICES ➤ Background operations ➤ Lifecycle ➤ Service ➤ Bind

    ➤ IntentService ➤ Work thread ➤ Start with Intent @scottyab
  7. LISTS / RECYCLERVIEW ➤ Xml Layout for list <RecyclerView> ➤

    Layout for the row ➤ Adapter ➤ Binding ➤ ViewHolder ➤ RecyclerView.setAdapter(…) @scottyab
  8. .APK AND DISTRIBUTION ➤ Android apps are packaged as .apk

    files ➤ Signed with developer signing key ➤ Upload to the Play Store • $25 one off registration fee • Screen shots • Unique App Id @scottyab
  9. GRADLE ➤ Run from CI and IDE ➤ Easy dependancy

    management ➤ Build variants • types • flavours
  10. INCLUDING DEPENDANCIES ➤ build.gradle dependencies {
 /*
 * Google Play

    services
 */
 compile 'com.google.maps.android:android-maps-utils:0.4.4'
 compile 'com.google.android.gms:play-services-maps:9.6.1'
 compile 'com.google.android.gms:play-services-location:9.6.1' @scottyab
  11. SUPPORT LIBRARY ➤ Backward-compatible versions of framework components. ➤ UI

    elements to implement the recommended Android layout patterns. ➤ Support for different form factors. ➤ Miscellaneous utility functions. @scottyab
  12. TIPS ▸ Lock to portrait ▸ Focus on limited devices

    ▸ Test on demo devices ▸ Target SDK 15+ (or even 21+) @scottyab
  13. FABRIC / CRASHLYTICS ➤ By Twitter ➤ Crash Reporting ➤

    Beta distribution ➤ Analytics ➤ https://get.fabric.io @scottyab
  14. THANKS swmobile.org github/scottyab @scottyab [email protected] QUESTIONS? LAB - 11am to

    Midday, Wednesday 9th November 2016 Merchant Venturer's Building 2.11 Linux Computer Lab