AndroidSU-Course-Projects

Created: 2014-05-19 14:23
Updated: 2014-06-05 22:12

readme.md


The projects throughout the Android basics course in SU.

A short description of what each one contains.

##AndoridSU_02.BasicUi

  • example of how to use a ScrollView
  • shows attaching an event listener to a button
  • adding a view dynamically
  • displaying a Toast

##AndroidSU_03.AdvancedUI

  • switching between activities through options menu
  • shows how to start activities without multiple stacking /intent flag: Intent.FLAG_ACTIVITY_REORDER_TO_FRONT

LogIn/LoggedIn Activity

  • an example for a login page which is skipped (the user is redirected) if already logged
  • shows usage of shared preferences
  • passing data between intents
  • creating/reading a/from text file and parsing it (onto external storage)
  • checking external storage state

Calculator Activity:

  • an example for relative layout positioning of buttons (note that relative layout is not the best option for designing a calculator!)
  • not a working calculator
  • shows usage of styles (and style inheritance);
  • usage of different resource folders for layouts and styles: proper rendering for different device dimensions and DPIs

Mail Client Activity:

  • an example for using a Chooser for sending a mail

##AndroidSU_04.UserInteraction

  • an example for a custom list adapter and interaction with its data through its ListView
  • support for older devices using the support library: ActionBarActivity instead Activity, @style/Theme.AppCompat.Light for a base theme
  • the ViewHolder pattern
  • overriding back button behavior
  • retaining list data and position after rotation
  • retrieving existing drawables from the resources

##AndroidSU_06.WorkingInBackground

Shall Crash Activity

  • example why we better not modify views directly from a different thread; whether this activity will crash varies by manufacturer (it's a bad thing for sure)

AsyncTask Demo Activity

  • an example of using an AsyncTask for long running operation
  • canceling AsyncTask
  • the AsyncTask is not retained accross configuration change - for the correct implementation of this a Fragment must be involved

##AndroidSU_07.AccessingTheWeb

  • uses the public Stackoverflow API to display the answers of a user by ID in a ListView (title and score)
  • executing a GET request via HTTPClient
  • uses the support library
  • accessing external API
  • parsing JSON via the GSON library
  • uses the StringEscapeUtils (from org.apache.commons) to unescape html entities for TextView;
    /as the answer body is retrieved in markdown format it is suitable for visualisation in a TextView - the only thing to touch is the unescaped html entities such as < and > /
    Another way would be to use WebView for rendering pure html or using another library for converting markdown to html.
  • loading more items when the bottom of the list is reached
  • creating and adding a ProgressBar bar dynamically

##AndroidSU_08.Fragments

  • a simple fragments demo
  • uses NavigationDrawer from the support library (which is also a Fragment);

##AndroidSU_09.AccessingDB

  • an example of a simple SQLite Database interaction
  • vanilla android SQLite example
  • executing queries over a database
  • the DBAdapter pattern is used, providing abstraction over database functionality

##AndroidSU_11.WebViewInteraction

  • a simple WebView example;
  • loading .html pages
  • handling WebView events through WebViewClient
  • executing Javascript from Java and vice versa

##AndroidSU_12.SoftwareGroup

###PreferencesActivity

  • shows the usage of built-in functionality towards preferences (uses PreferenceFragment)
  • shows a way to set a fragment on activity start (if no other is currently set)

###CompositeDrawables

  • custom buttons demo
  • composition of multiple drawables
  • usage of selectors, shapes, layer lists, 9-patch drawables

###SelectorsDemo

  • the activity has a layout that demonstrates uses of selectors

##AndroidSU_13.Leftovers

###CameraActivity

  • simplest camera demo

###ReceiverDemoActivity

  • a demo for a BroadcastReceiver
  • using custom a intent filter and a system intent filter
  • executing a long operation in the Receiver (through service with AsyncTask)
Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more