Hello,

The final project idea submission deadline was last night, and we have one submission. Since there is only one submission, and it's a great idea, that submission automatically will receive the chance to earn the Udacity certificate. If there are any objections, please voice them by tonight,  04/26/2015.

Post has attachment
Hello Android Enthusiasts,

As discussed during the final project planning meeting, we will use Google Moderator to vote on the best project.

http://goo.gl/dp4u35

All final project participants have until April 25, 2015 @ midnight to submit their final project idea via Google Moderator. GDG Sacramento members have until April 28, 2015 @ midnight to cast their vote for the best project.

The final project submission should include the following:
- Problem Description (one page)
- Mockups for all user-facing screens including tablet mockups
- GitHub link to your project (if applicable)

You can use google Drive to make the above resources available via a link in your Google Moderator entry.

Here is the link to the Udacity ud853 course final project page:
https://www.udacity.com/wiki/ud853/project

Here is a list of Android Fundamentals Study Jam Sacramento participants, who are eligible for the final project contest:


- Alain
- Corey
- Forrest
- Greg
- Lance
- Marc
- Oleg
- Om
- Sudd

Please let me know if you have any questions.

Good Luck,
-- Thomas

Post has attachment
Just a quick reminder that we will have our project planning meeting at tomorrow's GDG Sacramento meetup.

http://www.meetup.com/gdgsacramento/events/221451436/

Post has attachment
Reminder that we will have the final project planning session at the end of the next  GDG Sacramento monthly meetup on April 09, 2015:

http://www.meetup.com/gdgsacramento/events/221451436/

Post has attachment
Lesson 6 Notes: 03/24/2015
- Run app in background

- AsyncTask is tied to activity life-cycle
-- VM holds on to Activity as long as AsyncTask is running, event after the activity called onDestroy

- App should get regular updates in the background without draining the battery

- Services
-- Start services like activities via an intent
-- startService()
-- stopService()

- Services have no UI and are running at a higher priority than background activities

- Life-cycle 
-- onCreate
-- onStartCommand
-- onDestroy

- Typically you only need to override the onStartCommand method

- Service can be run in foreground by calling startForeground(notification)
-- e.g. music player, maps navigation
-- foreground service runs at same priority as Active Activities 

- Only run services as long as necessary and then stop them

- Service runs on Main Thread. Run long running tasks in AsyncTask or Background Thread. 

-- IntentService
--- Intent Queue : onHandleIntent(Intent intent)

- Service: IntentService or SyncAdapter

- App Priority
-- Critical
-- High
-- Low

- SunshineService extends IntentService
-- Register service in manifest
-- doInBackground (FetchWeatherTask) code goes into onHandleIntent
-- Call service from ForecastFragment.updateWeather

- Alarm Manager
-- BroadcastReceiver : registers an intent receiver for certain broadcasts
-- PendingIntent
--- Special intent that is handed from one app to another : "permission propagation"

- AlarmReceiver extends BroadcastReceiver
-- onReceive(Context, Intent)
-- Register in manifest : Special syntax to reference static inner class

- ForecastFragment->updateWeather()
-- new alarmIntent(getActivity(), SunshineService.AlarmReceiver.class);
-- alarmIntent.putExtra(SunshineService.LOCATION_QUERY_EXTRA, mLocation);
-- Wrap alarmIntent in PendingIntent

- Clicking on refresh now, will trigger the alarm (wait for alarm period e.g. 5 sec. for data to show up)

- Transferring Data Efficiently
-- Smaller number of big downloads or large number of small downloads?
-- Big Cookie App
--- Minimize state transitions
--- Prefetch 2-5 mins ( 1 - 5 mb) of data
--- Batch non time-critical transfers
--- Bundle time-sensitive/insensitive transfers

- Cell Radio state 
-- Radio Standby : Radio Low Power : Radio Full Power
https://www.youtube.com/watch?v=cSIB2pDvH3E&list=PLWz5rJ2EKKc-VJS9WQlj9xM_ygPopZ-Qd

- SyncAdapters (Introduced API 5)
-- Checks network connectivity : retries, etc.
-- Schedules your network jobs with other apps
-- Uses account manger

- SunshineSyncAdapter extends AbstractThreadedSyncAdapter
-- onPerformSync

- Schedule Synchronization
-- Have a ContentProvider marked as syncable
-- Enable automatic sync for the SyncAdapter
-- Set an interval in seconds and not milliseconds

- Still pooling server at some frequency 

- Use Google Cloud Messaging
-- http://developer.android.com/google/gcm/index.html

- Notifications
-- NotificationCompat.Builder(...)
-- Notification manager can be used from any thread

- Weather Notification Preference

- Delete weather data that is more than one day old.

- Update Map

Post has attachment
We are ready to go over the last lesson. Please don't forget to signup here: http://www.meetup.com/gdgsacramento/events/220097527/

Post has attachment
Following up on our conversation, make sure you're using v2 of Sunshine repo.

Post has attachment
Lesson 5 Notes: 03/17/2015

- Android Open Source Projects
- Release updates via Google Play (Google Play Services)
-- https://developer.android.com/google/play-services/index.html
-- Location, Ads, Cast, Games, Maps, Drive, Fit, Wallet, In-app Billing, Google Cloud Messaging, ...

- Rich and responsive layouts

- Principals of great design
-- Less is more

- View and ViewGroups
-- ViewGroups are for example layouts
--- LinearLayout
--- RelativeLayout
--- GridLayout

- Every View requires width and height (wrap_parent, match_parent)

- Gravity
-- gravity=center ( Centers content in TextView )
-- layout_gravity=center ( Centers View within parent )

- Padding vs margin

- Visibility Property
-- visible, invisible, gone

- Wire frame
-- Main activity
-- List Item : Horizontal LinearLayout
--- ImageView | Vertical Linear Layout | Vertical Linear Layout
--- First vertical layout uses layout:weight = 1 and width=0dp (uses up all available space)


- ForecastAdapter (extends CursorAdapter)
-- Binding cursor data onto the view

- Helper methods for date formatting
-- getFriendlyDateString

- Use adapter's "Item View Types" to show different UI types in list
-- e.g. show a more detailed view for today
-- getViewTypeCount() -> 2
-- getItemViewType() : VIEW_TYPE_TODAY or VIEW_TYPE_FUTURE_DAY

- View Holder Pattern
-- Avoid having to lookup/resolve UI elements by ID

- Formatting Strings
-- e.g. add the degree symbol to temperature
-- Mark message parts that should not translate
--- Use <xliff:g> placeholder tag
--- https://developer.android.com/distribute/tools/localization-checklist.html

- Inflating context layout can be expensive
-- Keep layouts shallow
-- Should not have more than 10 texted views
-- Should not have more than 80 views total

- Use Hierarchy Viewer to inspect UI elements

- Use the Android Studio lint tool to find Layout related issues

- Responsive Design
-- Phone vs Tablet

- Screen widths (size)
-- Phones : < 600dp
-- 7in Tablets : > 600dp
-- 10in Tablets : > 720 dp

- Screen density
-- LDPI : 120 DPI
-- MDPI : 160 DPI
-- HDPI : 240 DPI
-- XHDPI : 320 DPI
-- XXHDPI : 480 DPI
-- XXXHDPI : 640 DPI

- cannot use px as unit
-- Use density-independent piles (dip or dp)

- Resource folder qualifiers
-- res/values
-- res/layout

-- layout-land
-- values-fr
-- drawable-xhdpi
-- layout-sw720dp (smallest with qualifier)
-- layout-desk

- Provided bitmaps for different densities

- Tablet UI design
-- Master detail flow
-- http://developer.android.com/training/basics/fragments/fragment-ui.html

- Activities & Fragments
-- Fragment transactions
-- NonUIFragment
--- setRetainInstance(true)
--- onCreateView() -> return null

- Setup resource folder for Sunshine App
-- res/layout/main_activity.xml # for handsets
-- res/layout-sw600dp/main_activity.xml

- Static vs dynamic fragments
-- ForecastFragment : static
-- DetailFragment : dynamic

- Handle list item click
-- Communicate between fragments via MainActivity
-- Implement callback interface

- Handle weather location change
-- MainActivity detect if location changed in onResume()
-- ForcastFragment.onLocationChanged()
-- DetailFragment.onLocationChanged()

- After selecting settings make sure to use existing MainActivity.
-- Override getParentActivityIntent() (only API 16+)

- State list drawable to mark selected list item

- Use styles to group attributes of views

- List mode : singleChoice
-- Set choice mode via styles instead of layout file duplication

- Save position of selected item in savedInstanceState bundle

- Layout Aliasing to avoid code duplication

- Visual Mocks
-- redlines
-- Use Android design guide
-- Material design
--- color primary and primary dark

- Font : Roboto / font sizes -> visual hierarchy
-- Micro : 12sp, Small : 14sp, Medium : 18sp, Large : 22sp
-- sp = scaled pixels 

- Phone Developer Options
-- Show layout bounds

- Accessibility
-- Content description (ImageViews, etc.)

- Custom View
-- MyView extends
--- View
--- SurfaceView (used for rapid drawing, e.g. OpenGL etc.)
-- 3 constructors and onMeasure() method
-- onDraw(Canvas canvas)
-- <com.myapp.MyView android:height="" android:width=""/>
-- Keep in mind accessibility 
--- contentDescription
--- sendAccessibilityEvent
-- Input events in custom views

Post has attachment
Please don't forget to signup for Study Jam 6 where we will cover Lesson 5 of the course material.

http://www.meetup.com/gdgsacramento/events/220097504/

Post has attachment
Lesson 4 (a, b, c) Notes:  03/03/2015 & 03/10/2015

Lesson 4A Notes

- Activity Lifecycle and Data

- Android kills low priority apps that run in the background
-- Your app may be killed at any time
-- Activity life cycle : https://s3.amazonaws.com/content.udacity-data.com/course/ud853/Android_Activity_LifeCyle.png
-- Create -> Visible -> Active
-- App may terminate after onPause (pre Honeycomb) and onStop (Honeycomb+)
-- What to stop in onPause / onStop
--- Sensor listeners
--- Location updates
--- Dynamic broadcast receivers
--- Game physics engine
--- etc.

- Save instance state
-- onSaveInstanceState
-- onRestoreInstanceState

- Storing Data in Android
-- The faster users can use the app, the more they will use it
-- Fetching data uses battery
-- Fetching data uses metered data plans $$
-- Limited connectivity

- SQLite tutorial

- Android provided storage solutions on top of the file system
-- SharedPreferneces
-- SQLite Database

- Storage structure
-- Data Contract
-- SQLite
-- ContentProvider
-- Implementation : https://github.com/udacity/Sunshine-Version-2/tree/lesson_4_starter_code

- Data Contract
-- Database column name
-- IDs, URIs, ...
--- e.g. ContactsContract

- Weather and Location Tables
-- Weather table has a column location_id that references a column in the location table

- WeatherContract
-- WeatherEntry extends BaseColumns
-- LocationEntry extends BaseColumns

- SQLiteOpenHelper
-- Create DB
-- Versioning 
-- WeatherDbHelper extends SQLiteOpenHelper

- Testing Framework
-- jUnit : automated test suites
--- http://developer.android.com/tools/testing/testing_android.html
-- test with assertions
--- assertEquals("X should be equal", a, c);

- Create table
-- WeatherDbHelper in onCreate()
-- Also add code to onUpdate()
--- Change version if you update table structure

- Use ContentValues to create new db entry

- Queries return DB cursor

- Test create/insert values
https://github.com/udacity/Sunshine-Version-2/blob/sunshine_master/app/src/androidTest/java/com/example/android/sunshine/app/data/TestDb.java

==========================================================

Lesson 4B Notes

- Content Providers
-- Why: 
--- Widgets
--- Search
--- SyncAdapter
--- CursorLoader

- How to use Content Provider course : https://www.udacity.com/course/ud258

- Build content provider
-- Determine URIs
-- Update contract (URIs)
-- URIMatchers
-- Implement Functions

- URI?
-- content://com.example.android.sunshineapp/weather/95691
-- Content provider returns cursor for provided URI
-- Scheme:
--- content
--- similar to http or https
-- Content Authority
--- Unique string to locate your content provider
--- Use package name of application
-- Path : Location
--- References DB table in application
-- Query
--- /95691 OR ?ZIP=95691

- URIMatchers
-- http://developer.android.com/reference/android/content/UriMatcher.html

- Register content provider in the Android manifest file
-- android:authorities
-- android:name (Matches class)

- ContentResolver locates class via Authority
-- The ContentResolver decides which provider to use based on the authority part of the URI

- Content Provider
-- onCreate
-- query : returns cursor
-- insert : returns URI
-- update : returns # rows modified
-- delete : returns # rows modified
-- getType : returns type (mime type)

-- BulkInsert to use one transaction for all inserts (more efficient)

- Use Content Provider (branch 4.14 -> 4.15)
https://github.com/udacity/Sunshine-Version-2/compare/4.14_update_delete...4.15_refactor_fetchweather
-- FetchWeatherTask
--- long addLocation(...)
-- Use Loaders to load data from DB via content provider

Lesson 4C Notes

- Loaders were introduced in Honeycomb but are available in previous versions via the support library. Loaders are best practices for loading data asynchronously. 

- CursorLoader extends AsyncTaskLoader. It does all the data loading in an AsyncTask for you.
-- http://developer.android.com/reference/android/content/CursorLoader.html

- With loaders, there is not need to directly query the DB from the UI code.
-- Query could take long time and thus may cause frame rate drop
-- Activity could stop fore query completes
-- Data may have to be re-queried if screen rotates

- CursorAdapter -> CursorLoader -> ContentResolver -> WeatherProvider -> WeatherDBHelper -> SQLite DB

- Replace ArrayAdapter with CursorAdapter

- ForecastFragment implements LoaderManager.LoaderCallbacks<Cursorc
- Loader Id constants needs to be unique for every loader used in an activity
- Implement 3 callback functions
-- onCreateLoader(...)
-- onLoadFinished(...)
-- onLoaderReset(...)

- Making Content Provider data available to other apps
-- <provider android:exported="true" ...
-- Add permissions if needed

- Content Providers to access media store
Wait while more posts are being loaded