diff --git a/9781430247883.jpg b/9781430247883.jpg
new file mode 100644
index 0000000..66d5115
Binary files /dev/null and b/9781430247883.jpg differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim0.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim0.png
new file mode 100644
index 0000000..c2f507a
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim0.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim1.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim1.png
new file mode 100644
index 0000000..5843e11
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim1.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim2.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim2.png
new file mode 100644
index 0000000..f3481ce
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim2.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim3.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim3.png
new file mode 100644
index 0000000..887b20d
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim3.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim4.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim4.png
new file mode 100644
index 0000000..9249c99
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim4.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim5.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim5.png
new file mode 100644
index 0000000..351a040
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim5.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim6.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim6.png
new file mode 100644
index 0000000..a29ed00
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim6.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim7.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim7.png
new file mode 100644
index 0000000..a41c5ae
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim7.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim8.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim8.png
new file mode 100644
index 0000000..3719113
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim8.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim9.png b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim9.png
new file mode 100644
index 0000000..92b204a
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Animation/logoanim9.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffyflac.flac b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffyflac.flac
new file mode 100644
index 0000000..af8c885
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffyflac.flac differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffymp3.mp3 b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffymp3.mp3
new file mode 100644
index 0000000..bf8c9e2
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffymp3.mp3 differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffymp4.m4a b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffymp4.m4a
new file mode 100644
index 0000000..a7b9869
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffymp4.m4a differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffyogg.ogg b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffyogg.ogg
new file mode 100644
index 0000000..338339f
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Audio/mindtaffyogg.ogg differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/MindTaffyLogoAndroidGreen.gif b/AndroidAppsForAbsoluteBeginners/Assets_Images/MindTaffyLogoAndroidGreen.gif
new file mode 100644
index 0000000..d61e626
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/MindTaffyLogoAndroidGreen.gif differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/MindTaffyLogoAndroidGreen.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/MindTaffyLogoAndroidGreen.png
new file mode 100644
index 0000000..3eecbc5
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/MindTaffyLogoAndroidGreen.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_focused.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_focused.png
new file mode 100644
index 0000000..6770fa2
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_focused.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_normal.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_normal.png
new file mode 100644
index 0000000..759d9d7
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_normal.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_pressed.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_pressed.png
new file mode 100644
index 0000000..491935e
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/button1_pressed.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/ic_launcher.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/ic_launcher.png
new file mode 100644
index 0000000..96095ec
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/ic_launcher.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/image1.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/image1.png
new file mode 100644
index 0000000..c4b0259
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/image1.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Assets_Images/image2.png b/AndroidAppsForAbsoluteBeginners/Assets_Images/image2.png
new file mode 100644
index 0000000..6321132
Binary files /dev/null and b/AndroidAppsForAbsoluteBeginners/Assets_Images/image2.png differ
diff --git a/AndroidAppsForAbsoluteBeginners/Content Providers/AndroidManifest.xml b/AndroidAppsForAbsoluteBeginners/Content Providers/AndroidManifest.xml
new file mode 100644
index 0000000..da5ec93
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/Content Providers/AndroidManifest.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/Content Providers/res/layout/activity_main.xml b/AndroidAppsForAbsoluteBeginners/Content Providers/res/layout/activity_main.xml
new file mode 100644
index 0000000..3b11d48
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/Content Providers/res/layout/activity_main.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/Content Providers/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/Content Providers/res/values/strings.xml
new file mode 100644
index 0000000..9052f12
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/Content Providers/res/values/strings.xml
@@ -0,0 +1,10 @@
+
+ ContentProviders
+ Click Buttons Below to Query, Add, Modify or Delete
+ Click to Query Contacts Database
+ Click to Add to Contacts Database
+ Click to Modify Contacts Database
+ Click to Delete Contact in Database
+ Settings
+ MainActivity
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/Content Providers/src/MainActivity.java b/AndroidAppsForAbsoluteBeginners/Content Providers/src/MainActivity.java
new file mode 100644
index 0000000..e9b2d70
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/Content Providers/src/MainActivity.java
@@ -0,0 +1,98 @@
+package sixth.example.contentproviders;
+import android.os.Bundle;
+import android.app.Activity;
+import android.net.Uri;
+import android.provider.ContactsContract;
+import android.provider.ContactsContract.CommonDataKinds.StructuredName;
+import android.provider.ContactsContract.Data;
+import android.provider.ContactsContract.RawContacts;
+import android.content.ContentResolver;
+import android.content.ContentUris;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.view.Menu;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.Toast;
+public class MainActivity extends Activity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Button queryButton = (Button)findViewById(R.id.button1);
+ queryButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) { queryContact(); }
+ });
+ Button addButton = (Button)findViewById(R.id.button2);
+ addButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) { addContact("Steve Wozniak"); }
+ });
+ Button modifyButton = (Button)findViewById(R.id.button3);
+ modifyButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) { modContact("The Woz"); }
+ });
+ Button delButton = (Button)findViewById(R.id.button4);
+ delButton.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View arg0) { delContact("The Woz"); }
+ });
+ }
+ private void queryContact() {
+ Cursor nameCursor = getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
+ while (nameCursor.moveToNext()) {
+ String contactName = nameCursor.getString(nameCursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME_PRIMARY));
+ Toast.makeText(this, contactName, Toast.LENGTH_SHORT).show();
+ }
+ nameCursor.close();
+ }
+ private void addContact(String newName) {
+ ContentValues myContact = new ContentValues();
+ myContact.put(RawContacts.ACCOUNT_NAME, newName);
+ myContact.put(RawContacts.ACCOUNT_TYPE, newName);
+ Uri addUri = getContentResolver().insert(RawContacts.CONTENT_URI, myContact);
+ long rawContactId = ContentUris.parseId(addUri);
+ myContact.clear();
+ myContact.put(Data.RAW_CONTACT_ID, rawContactId);
+ myContact.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
+ myContact.put(StructuredName.DISPLAY_NAME, newName);
+ getContentResolver().insert(Data.CONTENT_URI, myContact);
+ Toast.makeText(this, "New Contact: " + newName, Toast.LENGTH_SHORT).show();
+ }
+ private void modContact(String modName) {
+ ContentValues myContact = new ContentValues();
+ myContact.put(RawContacts.ACCOUNT_NAME, modName);
+ myContact.put(RawContacts.ACCOUNT_TYPE, modName);
+ Uri addUri = getContentResolver().insert(RawContacts.CONTENT_URI, myContact);
+ long rawContactId = ContentUris.parseId(addUri);
+ myContact.clear();
+ myContact.put(Data.RAW_CONTACT_ID, rawContactId);
+ myContact.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
+ myContact.put(StructuredName.DISPLAY_NAME, modName);
+ getContentResolver().update(Data.CONTENT_URI, myContact, null, null);
+ Toast.makeText(this, "Modified Contact: " + modName, Toast.LENGTH_SHORT).show();
+ }
+ private void delContact(String delName) {
+ ContentResolver cresolver = getContentResolver();
+ Cursor cur = cresolver.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);
+ while (cur.moveToNext()) {
+ try {
+ String lookupKey = cur.getString(cur.getColumnIndex(ContactsContract.Contacts.LOOKUP_KEY));
+ Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);
+ Toast.makeText(this, "Deleted Contact URI: " + uri.toString(), Toast.LENGTH_SHORT).show();
+ cresolver.delete(uri, null, null);
+ }
+ catch(Exception e)
+ {
+ System.out.println(e.getStackTrace());
+ }
+ }
+ }
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/EventHandling/res/layout/activity_main.xml b/AndroidAppsForAbsoluteBeginners/EventHandling/res/layout/activity_main.xml
new file mode 100644
index 0000000..5694100
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/EventHandling/res/layout/activity_main.xml
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/EventHandling/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/EventHandling/res/values/strings.xml
new file mode 100644
index 0000000..9f86a78
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/EventHandling/res/values/strings.xml
@@ -0,0 +1,10 @@
+
+ EventHandling
+ CLICK TO GENERATE EVENT
+ LONG-CLICK FOR CONTEXT MENU
+ THIRD BUTTON
+ FOURTH BUTTON
+ Settings
+ MainActivity
+ NO EVENT RECEIVED YET
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/EventHandling/src/MainActivity.java b/AndroidAppsForAbsoluteBeginners/EventHandling/src/MainActivity.java
new file mode 100644
index 0000000..0ffb5e2
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/EventHandling/src/MainActivity.java
@@ -0,0 +1,79 @@
+package fifth.example.eventhandling;
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.ContextMenu;
+import android.view.ContextMenu.ContextMenuInfo;
+import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnLongClickListener;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+public class MainActivity extends Activity implements OnClickListener, OnLongClickListener {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Button button = (Button) findViewById(R.id.button1);
+ button.setOnClickListener(this);
+ button.setOnLongClickListener(this);
+ Button button2 = (Button) findViewById(R.id.button2);
+ registerForContextMenu(button2);
+ Button button3 = (Button) findViewById(R.id.button3);
+ registerForContextMenu(button3);
+ Button button4 = (Button) findViewById(R.id.button4);
+ registerForContextMenu(button4);
+ }
+ public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
+ super.onCreateContextMenu(menu, view, menuInfo);
+ menu.setHeaderTitle("Android Context Menu");
+ menu.add(0, view.getId(), 0, "Invoke Context Function 1");
+ menu.add(0, view.getId(), 0, "Invoke Context Function 2");
+ }
+ public boolean onContextItemSelected(MenuItem item) {
+ if(item.getTitle().equals("Invoke Context Function 1")) {
+ contextFunction1(item.getItemId());
+ }
+ else if(item.getTitle().equals("Invoke Context Function 2")){
+ contextFunction2(item.getItemId());
+ }
+ else {
+ return false;
+ }
+ return true;
+ }
+ public void contextFunction1(int id){
+ Toast.makeText(this, "function 1 invoked!", Toast.LENGTH_SHORT).show();
+ }
+ public void contextFunction2(int id){
+ Toast.makeText(this, "function 2 invoked!", Toast.LENGTH_SHORT).show();
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
+ public void onClick(View arg0) {
+ TextView text = (TextView) findViewById(R.id.textmessage);
+ text.setText("BUTTON HAS BEEN CLICKED. EVENT PROCESSED.");
+ }
+ public boolean onLongClick(View arg0) {
+ TextView text = (TextView) findViewById(R.id.textmessage);
+ text.setText("BUTTON HAS BEEN HELD. onLongClick EVENT PROCESSED.");
+ return true;
+ }
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {
+ textUpdate();
+ return true;
+ }
+ return false;
+ }
+ public void textUpdate() {
+ TextView text = (TextView)findViewById(R.id.textmessage);
+ text.setText("CENTER KEYPAD KEY PRESSED.");
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/anim/text_animation.xml b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/anim/text_animation.xml
new file mode 100644
index 0000000..b5fe9d5
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/anim/text_animation.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/drawable/logo_animation.xml b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/drawable/logo_animation.xml
new file mode 100644
index 0000000..3030e6c
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/drawable/logo_animation.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/layout/activity_main.xml b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/layout/activity_main.xml
new file mode 100644
index 0000000..afa1b74
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/layout/activity_main.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/values/strings.xml
new file mode 100644
index 0000000..0b2cda3
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/GraphicDesign/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+ GraphicDesign
+ Hello world!
+ MainActivity
+ Frame Animation Example
+ Image Transition Example
+ TWEEN ANIMATION!
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/GraphicDesign/src/MainActivity.java b/AndroidAppsForAbsoluteBeginners/GraphicDesign/src/MainActivity.java
new file mode 100644
index 0000000..fb1bd6a
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/GraphicDesign/src/MainActivity.java
@@ -0,0 +1,41 @@
+package fourth.example.graphicdesign;
+import android.app.Activity;
+import android.graphics.drawable.AnimationDrawable;
+import android.graphics.drawable.TransitionDrawable;
+import android.os.Bundle;
+import android.view.Menu;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.widget.ImageView;
+import android.widget.TextView;
+public class MainActivity extends Activity {
+ AnimationDrawable logoAnimation;
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ final ImageView logoAnimHolder = (ImageView) findViewById(R.id.imageView1);
+ logoAnimHolder.setBackgroundResource(R.drawable.logo_animation);
+ logoAnimHolder.post(new Runnable() {
+ public void run() {
+ logoAnimation = (AnimationDrawable) logoAnimHolder.getBackground();
+ }
+ });
+ TextView textAnim = (TextView) findViewById(R.id.animText);
+ Animation textAnimation = AnimationUtils.loadAnimation(this, R.anim.text_animation);
+ textAnim.startAnimation(textAnimation);
+ TransitionDrawable trans = (TransitionDrawable) getResources().getDrawable(R.drawable.image_transition);
+ ImageView transImage = (ImageView) findViewById(R.id.imageTrans);
+ transImage.setImageDrawable(trans);
+ trans.startTransition(10000);
+ }
+ @Override
+ public void onWindowFocusChanged (boolean hasFocus) {
+ logoAnimation.start();
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/res/layout/activity_hello.xml b/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/res/layout/activity_hello.xml
new file mode 100644
index 0000000..84fca37
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/res/layout/activity_hello.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/res/values/strings.xml
new file mode 100644
index 0000000..0ff4627
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+
+ HelloAbsoluteBeginner
+ Hello Absolute Beginner!
+ Settings
+ HelloActivity
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/src/HelloActivity.java b/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/src/HelloActivity.java
new file mode 100644
index 0000000..d90864e
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/HelloAbsoluteBeginner/src/HelloActivity.java
@@ -0,0 +1,20 @@
+package first.example.helloabsolutebeginner;
+
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.Menu;
+
+public class HelloActivity extends Activity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_hello);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_hello, menu);
+ return true;
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/res/layout/activity_alternate.xml b/AndroidAppsForAbsoluteBeginners/IntentFilters/res/layout/activity_alternate.xml
new file mode 100644
index 0000000..c507556
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/res/layout/activity_alternate.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/res/layout/activity_main.xml b/AndroidAppsForAbsoluteBeginners/IntentFilters/res/layout/activity_main.xml
new file mode 100644
index 0000000..1030ede
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/res/layout/activity_main.xml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/IntentFilters/res/values/strings.xml
new file mode 100644
index 0000000..54c4d49
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/res/values/strings.xml
@@ -0,0 +1,14 @@
+
+ IntentFilters
+ You are currently in the MainActivity
+ Go to the AlternateActivity to use a DigitalClock
+ You are currently in the AlternateActivity
+ Go to the MainActivity to use an AnalogClock
+ Settings
+ MainActivity
+ AlternateActivity
+ Start Media Player Service
+ Stop Media Player Service
+ Enter Number of Seconds Here
+ Start Timer Countdown
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/src/AlternateActivity.java b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/AlternateActivity.java
new file mode 100644
index 0000000..3484ccc
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/AlternateActivity.java
@@ -0,0 +1,43 @@
+package seventh.example.intentfilters;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+import android.app.Activity;
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.Intent;
+public class AlternateActivity extends Activity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_alternate);
+ Button activity2 = (Button) findViewById(R.id.button1);
+ activity2.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View arg0) {
+ Intent replyIntent = new Intent();
+ setResult(RESULT_OK, replyIntent);
+ finish();
+ }
+ });
+ Button startTimer = (Button) findViewById(R.id.button2);
+ startTimer.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View arg0) {
+ timerAlert(arg0);
+ }
+ });
+ }
+ public void timerAlert(View view) {
+ EditText textField = (EditText) findViewById(R.id.editText1);
+ int i = Integer.parseInt(textField.getText().toString());
+ Intent timerIntent = new Intent(this, TimerBroadcastReceiver.class);
+ PendingIntent myPendingIntent =
+ PendingIntent.getBroadcast(this.getApplicationContext(), 0, timerIntent, 0);
+ AlarmManager myAlarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
+ myAlarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() +
+ (i * 1000), myPendingIntent);
+ Toast.makeText(this, "Alarm is set for " + i + " seconds!",
+ Toast.LENGTH_LONG).show();
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/src/MainActivity.java b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/MainActivity.java
new file mode 100644
index 0000000..d3e3c52
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/MainActivity.java
@@ -0,0 +1,40 @@
+package seventh.example.intentfilters;
+import android.os.Bundle;
+import android.app.Activity;
+import android.content.Intent;
+import android.view.Menu;
+import android.view.View;
+import android.widget.Button;
+
+public class MainActivity extends Activity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Button activity1 = (Button) findViewById(R.id.button1);
+ activity1.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View arg0) {
+ Intent myIntent =
+ new Intent(arg0.getContext(), AlternateActivity.class);
+ startActivityForResult(myIntent, 0);
+ }
+ });
+ Button startButton = (Button) findViewById(R.id.button2);
+ startButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View arg0) {
+ startService(new Intent(getBaseContext(), MediaPlayerService.class));
+ }
+ });
+ Button stopButton = (Button) findViewById(R.id.button3);
+ stopButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View arg0) {
+ stopService(new Intent(getBaseContext(), MediaPlayerService.class));
+ }
+ });
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/src/MediaPlayerService.java b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/MediaPlayerService.java
new file mode 100644
index 0000000..53baab2
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/MediaPlayerService.java
@@ -0,0 +1,26 @@
+package seventh.example.intentfilters;
+import android.app.Service;
+import android.content.Intent;
+import android.media.MediaPlayer;
+import android.os.IBinder;
+
+public class MediaPlayerService extends Service {
+ MediaPlayer myMediaPlayer;
+ @Override
+ public IBinder onBind(Intent arg0) {
+ return null;
+ }
+ @Override
+ public void onCreate() {
+ myMediaPlayer = MediaPlayer.create(this, R.raw.mindtaffy);
+ myMediaPlayer.setLooping(true);
+ }
+ @Override
+ public void onStart(Intent intent, int startId) {
+ myMediaPlayer.start();
+ }
+ @Override
+ public void onDestroy() {
+ myMediaPlayer.stop();
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/IntentFilters/src/TimerBroadcastReceiver.java b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/TimerBroadcastReceiver.java
new file mode 100644
index 0000000..6d47f6d
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/IntentFilters/src/TimerBroadcastReceiver.java
@@ -0,0 +1,13 @@
+package seventh.example.intentfilters;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.widget.Toast;
+
+public class TimerBroadcastReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(Context arg0, Intent arg1) {
+ Toast.makeText(arg0, "Alarm Notification", Toast.LENGTH_LONG).show();
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/LinearLayouts/res/layout/activity_main.xml b/AndroidAppsForAbsoluteBeginners/LinearLayouts/res/layout/activity_main.xml
new file mode 100644
index 0000000..6689239
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/LinearLayouts/res/layout/activity_main.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/LinearLayouts/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/LinearLayouts/res/values/strings.xml
new file mode 100644
index 0000000..0e94c21
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/LinearLayouts/res/values/strings.xml
@@ -0,0 +1,9 @@
+
+
+ LinearLayout_Example
+ Text Area One!
+ Text Area Two!
+ Settings
+ MainActivity
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/LinearLayouts/src/MainActivity.java b/AndroidAppsForAbsoluteBeginners/LinearLayouts/src/MainActivity.java
new file mode 100644
index 0000000..35d849b
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/LinearLayouts/src/MainActivity.java
@@ -0,0 +1,20 @@
+package second.example.linearlayouts;
+
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.Menu;
+
+public class MainActivity extends Activity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
+}
diff --git a/AndroidAppsForAbsoluteBeginners/Read_Me_First_Please.txt b/AndroidAppsForAbsoluteBeginners/Read_Me_First_Please.txt
new file mode 100644
index 0000000..16c29c6
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/Read_Me_First_Please.txt
@@ -0,0 +1,11 @@
+READ ME FIRST PLEASE!
+
+The folders in this .ZIP file hold the code and assets for the seven example applications in the Android Apps for Absolute Beginners Second Edition book from Apress. The New Media Assets are in the Assets_Folders and are classified by type: Assets_Animation, Assets_Audio and Assets_Images. These new media assets will be placed into Drawable and Raw sub-folders in your Project's Resources folder as instructed in the book.
+
+The other seven folders are named by their Project Name, and contain sub-folders holding the text file format Java and XML files that go under the Source and Resource folders underneath your primary Project Folder. This should be fairly obvious by the folder names that I have used in this ZIP archive. Unzip this archive using the "Use Folder Names" option in order to keep this folder structure intact, or simply pull files out of this ZIP archive as needed.
+
+The files in the Assets_Audio folder need to be renamed based on which type of audio you want to use in your app, all of these formats are supported by Android. If you want to use MP3 then rename mindtaffymp3.mp3 to mindtaffy.mp3 and place the file into the Raw folder under your Project folder. Make sure that you do not have more than one mindtaffy.audio_codec file at a time in that folder, as the Java code references this asset using the first part of the file name only.
+
+Finally, Android 4.2 added an XXHDPI Drawable Classification into Android 4.2, probably to handle 1920 by 1080 HDTV 16:9 Aspect Ratio (GoogleTV) as well as 1920 by 1200 HDTV 16:10 Aspect Ratio (Large Tablets) Content. I did not have time to add this into CH4 and CH8 of the book, so I am mentioning it here, so that you know about it. Enjoy the Book!
+
+Wallace Jackson, Mind Taffy Design
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/UI_Design/res/drawable/button1.xml b/AndroidAppsForAbsoluteBeginners/UI_Design/res/drawable/button1.xml
new file mode 100644
index 0000000..0200f85
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/UI_Design/res/drawable/button1.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/UI_Design/res/layout/activity_main.xml b/AndroidAppsForAbsoluteBeginners/UI_Design/res/layout/activity_main.xml
new file mode 100644
index 0000000..0b2a7f3
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/UI_Design/res/layout/activity_main.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
diff --git a/AndroidAppsForAbsoluteBeginners/UI_Design/res/menu/activity_main.xml b/AndroidAppsForAbsoluteBeginners/UI_Design/res/menu/activity_main.xml
new file mode 100644
index 0000000..52f829c
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/UI_Design/res/menu/activity_main.xml
@@ -0,0 +1,24 @@
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/UI_Design/res/values/strings.xml b/AndroidAppsForAbsoluteBeginners/UI_Design/res/values/strings.xml
new file mode 100644
index 0000000..62ff9c7
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/UI_Design/res/values/strings.xml
@@ -0,0 +1,15 @@
+
+
+ UI_Designs
+ Hello world!
+ Settings
+ MainActivity
+ IMAGE ONE
+ IMAGE TWO
+ USE WHITE
+ USE BLACK
+ SHOW ALERT
+ #FFFFFF
+ #000000
+
+
\ No newline at end of file
diff --git a/AndroidAppsForAbsoluteBeginners/UI_Design/src/MainActivity.java b/AndroidAppsForAbsoluteBeginners/UI_Design/src/MainActivity.java
new file mode 100644
index 0000000..66105df
--- /dev/null
+++ b/AndroidAppsForAbsoluteBeginners/UI_Design/src/MainActivity.java
@@ -0,0 +1,58 @@
+package third.example.userinterfacedesign;
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+public class MainActivity extends Activity {
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_main, menu);
+ return true;
+ }
+ public boolean onOptionsItemSelected(MenuItem item) {
+ RelativeLayout bkgr = (RelativeLayout)findViewById(R.id.uilayout);
+ final ImageView image = (ImageView)findViewById(R.id.imageView1);
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle("Pick an Image!")
+ .setMessage("Please Select Image One or Image Two:")
+ .setCancelable(false)
+ .setPositiveButton("IMAGE 1", new DialogInterface.OnClickListener()
+ {
+ public void onClick(DialogInterface dialog, int id) {
+ image.setImageResource(R.drawable.image1);
+ }
+ })
+ .setNegativeButton("IMAGE 2", new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ image.setImageResource(R.drawable.image2);
+ }
+ });
+ switch (item.getItemId()) {
+ case R.id.buttonone:
+ image.setImageResource(R.drawable.image1);
+ return true;
+ case R.id.buttontwo:
+ image.setImageResource(R.drawable.image2);
+ return true;
+ case R.id.buttonthree:
+ bkgr.setBackgroundResource(R.color.background);
+ return true;
+ case R.id.buttonfour:
+ bkgr.setBackgroundResource(R.color.background2);
+ return true;
+ case R.id.buttonfive:
+ builder.show();
+ return true;
+ default: return super.onOptionsItemSelected(item);
+ }
+ }
+}
\ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..cff6117
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,27 @@
+Freeware License, some rights reserved
+
+Copyright (c) 2012 Wallace Jackson
+
+Permission is hereby granted, free of charge, to anyone obtaining a copy
+of this software and associated documentation files (the "Software"),
+to work with the Software within the limits of freeware distribution and fair use.
+This includes the rights to use, copy, and modify the Software for personal use.
+Users are also allowed and encouraged to submit corrections and modifications
+to the Software for the benefit of other users.
+
+It is not allowed to reuse, modify, or redistribute the Software for
+commercial use in any way, or for a user’s educational materials such as books
+or blog articles without prior permission from the copyright holder.
+
+The above copyright notice and this permission notice need to be included
+in all copies or substantial portions of the software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..bcb30d3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,15 @@
+#Apress Source Code
+
+This repository accompanies [*Android Apps for Absolute Beginners*](http://www.apress.com/9781430247883) by Wallace Jackson (Apress, 2012).
+
+![Cover image](9781430247883.jpg)
+
+Download the files as a zip using the green button, or clone the repository to your machine using Git.
+
+##Releases
+
+Release v1.0 corresponds to the code in the published book, without corrections or updates.
+
+##Contributions
+
+See the file Contributing.md for more information on how you can contribute to this repository.
diff --git a/contributing.md b/contributing.md
new file mode 100644
index 0000000..f6005ad
--- /dev/null
+++ b/contributing.md
@@ -0,0 +1,14 @@
+# Contributing to Apress Source Code
+
+Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers.
+
+## How to Contribute
+
+1. Make sure you have a GitHub account.
+2. Fork the repository for the relevant book.
+3. Create a new branch on which to make your change, e.g.
+`git checkout -b my_code_contribution`
+4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted.
+5. Submit a pull request.
+
+Thank you for your contribution!
\ No newline at end of file