Week 11
Projects Due
Usability Testing
http://developer.android.com/tools/building/building-cmdline.html
Filter Definitions/Dismissing dialogue <---Also dialogue boxes need to be dismissed.
http://www.dummies.com/how-to/content/android-application-development-for-dummies-allino.html
Publishing
http://developer.android.com/distribute/googleplay/quality/core.html
-
Unit test: Specify and test one point of the contract of single method of a class. This should have a very narrow and well defined scope. Complex dependencies and interactions to the outside world are stubbed or mocked.
-
Integration test: Test the correct inter-operation of multiple subsystems. There is whole spectrum there, from testing integration between two classes, to testing integration with the production environment.
-
Smoke test: A simple integration test where we just check that when the system under test is invoked it returns normally and does not blow up. It is an analogy with electronics, where the first test occurs when powering up a circuit: if it smokes, it's bad.
-
Regression test: A test that was written when a bug was fixed. It ensure that this specific bug will not occur again.
- Acceptance test: Test that a feature or use case is correctly implemented. It is similar to an integration test, but with a focus on the use case to provide rather than on the components involved.
Quarter's Files
Next quarter's syllabus/book
Week 10
Project Upload Area
Harvestable project first
A bit about our blog
A backup app with raw queries
Image caching examples (see performance)
Debugging and testing week
http://developer.android.com/training/best-performance.html
Many types of breakpoints in eclipse
JUnit Testing
Resources:
Next week: Signing your apps, planning for the winter quarter, exchanging apks, Possible troubleshooting, but let's hope not.
Week 9
CRUDCreate: insert into locassessments (userid,sleep,energy) values (3,5,3);
Read: select * from locassessments where userid = 3;
Update:update locassessments set sleep = 8, energy = 4 where userid =3;
Delete:delete from locassessments where userid = 2;
http://developer.android.com/reference/android/util/LruCache.html
http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html
http://square.github.io/picasso/
Heavy review over what we breezed over last week.
Forms Example
A deliverable...and something different
Our Error Blog Hope it works
SQLite more in depth
Table Views and Table Rows (Layouts that often work with Databases)
Review of Camera,Maps, Notes
Maps Demo Issue: Two running projects cannot access the same library!
The difference between execSql and rawsql
Rawsql: Used to select statements and anything that returns data. Runs the provided SQL and returns a Cursor over the result set.
ExecSQL: Used when data is not returned...
Week 8
Awesome http://developer.android.com/training/notepad/index.html
Are the camera and google maps working?
How android accesses form values
Storage
Shared Preferences
File System
SQlite
Week 7
HOW TO LOG A VARIABLE
//Log.v("update","UPDATE locations set photo= '" + picName + "' where _id =" + lastId);
THIS IS A DIALOG WITH BUTTONS THAT HAVE INTENTS
dialog.setTitle("Your picture has been saved");
TextView text = (TextView) dialog.findViewById(R.id.text);
text.setText("Where would you like to go?");
ImageView image = (ImageView) dialog.findViewById(R.id.image);
image.setImageResource(R.drawable.ic_launcher);
Button dialogButtonMap = (Button) dialog.findViewById(R.id.dialogButtonMap);
Button dialogButtonNote = (Button) dialog.findViewById(R.id.dialogButtonNote);
dialogButtonMap.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Intent intentMap =new Intent(LocationPhoto.this,MainActivity.class);
startActivity(intentMap);
}
CHECK FIRST - THIS SHOWS AN IMAGE FROM A GIVEN PATH
String path = Environment.getExternalStorageDirectory().getPath();
File imgFile = new File(path + picName);//assuming picName is in the sqlite db
//works for all externally stored pics...good to save for later.
if(imgFile.exists()){
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ImageView myImage = (ImageView) findViewById(R.id.locationpic);
myImage.setImageBitmap(myBitmap);
}
}
Using the book for things we won't get to in class
How will your project be graded?
Adding libraries without resources
To add a Support Library without resources to your application project:
- Make sure you have downloaded the Android Support Library using the SDK Manager.
- Create a libs/ directory in the root of your application project.
- Copy the JAR file from your Android SDK installation directory (e.g.,<sdk>/extras/android/support/v4/android-support-v4.jar) into your application's project libs/directory.
- Right click the JAR file and select Build Path > Add to Build Path.
Quick word on prototypes
Design Cheats
Screencasts
How to handle Errors and the Log Utility Class:
-
Log.e: This is for when bad stuff happens. Use this tag in places like inside a catch statment. Youknow and error has occurred and therefore you're logging an error.
-
Log.w: Use this when you suspect something shady is going on. You may not be completely in full on error mode, but maybe you recovered from some unexpected behavior. Basically, use this to log stuff you didn't expect to happen but isn't necessarily an error. Kind of like a "hey, this happened, and it's weird, we should look into it."
-
Log.i: Use this to post useful information to the log. For example: that you have successfully connected to a server. Basically use it to report successes.
-
Log.d: Use this for debugging purposes. If you want to print out a bunch of messages so you can log the exact flow of your program, use this. If you want to keep a log of variable values, use this.
-
Log.v: Use this when you want to go absolutely nuts with your logging. If for some reason you've decided to log every little thing in a particular part of your app, use the Log.v tag.
And as a bonus...
- Log.wtf: Use this when stuff goes absolutely, horribly, holy-crap wrong. You know those catch blocks where you're catching errors that you never should get...yea, if you wanna log them use Log.wtf
Dialogue Boxes with Intents
Geo Location
2 Links you need for maps!
Now Let's Play
Week 6
Midterm Retake
Finish Last Week's Stuff
Layouts
Action Bar and Support Library
Camera App
Week 5
Something to read to stay in the know
A constructor in Java is a block of code similar to a method that’s called when an instance of an object is created. Here are the key differences between a constructor and a method:
-
A constructor doesn’t have a return type.
-
The name of the constructor must be the same as the name of the class.
-
Unlike methods, constructors are not considered members of a class.
-
A constructor is called automatically when a new instance of an object is created.
Midterm
Android
How to emulate/workflow
Layouts
Some Sample Apps
Your homework this week is to go to "war" . You will create your project in eclipse, get your manifest, classes and activities ready.
Your prototypes are due for Corey in week 6, so keep that in mind
Week 4
JSON Feeders
Not that we are Pro Java Programmers, but:Interview Questions
2D arrays
Methods
Classes/Objects
Midterm warmup
Week 3
A view from 30,000 feet
Homework goals: Get Variables, Cast those variables, Do something with those variables,
Concepts achieved through the homework: Data typing, Order of Operations
Java Security and Oracle's Response
What's vital, semi important, and frosting in this course. (Android Samples)
Extra Help Sessions/Sharing Code
A review of conditions
A review of loops
String Handling and its methods
Methods and Arrays
Week 2
A bit about Android Studio and early access
Planning our project
More mobile news
Mobile Apps on a larger screen- what does it mean for us?
Recently released Business Apps
A bit on eclipse (formatting and snippets)
- Quick Fix/Suggestions ctrl+1 or cmd+1 on a Mac
- Content Assist: ctrl+space (for Mac and PC) ->try it with a for loop
- Quick Access: ctrl+3 or cmd+3 on a Mac->Docs
- Open Type: shift+ctrl+T or shift+cmd+T on a Mac
Adding Android SDK
Step 1
http://dl.google.com/android/android-sdk_r22.2.1-macosx.zip
Step 2
http://developer.android.com/sdk/installing/installing-adt.html
LAR
Codiqa and what it can do...may help with Corey's class
SSH to test
Passing Arguments via eclipse
Installing the android sdk screencast
eclipse snippets/loops
Strong Homework Examples-we can all learn from
A Great Quote:
Slightly more experienced programmers encounter different design failures. These programmers are aware of OO design techniques but do not yet understand how to apply them. With the best of intentions, these programmers fall into the trap of over design. A little bit of knowledge is dangerous; as their knowledge increases and hope returns, they design relentlessly. In an excess of enthusiasm they apply principles inappropriately and see patterns where none exist. They construct complicated, beautiful castles of code and then are distressed to find themselves hemmed in by stone walls. You can recognize these programmers because of they begin to greet change requests with "No, I can't add that feature; it wasn't designed to do that."
- Sandi Metz, Practical Object Oriented Design in Ruby, Addison-Wesley 2013
Adaptability is a part of the beauty that comes from designing code that will outlive the life of a program. I understand this principle but like many, fall into the thoughts of my own self indulgence. My lack of knowledge comes from not knowing why and when to apply design patterns, but in creating avant-garde trapdoor patterns that solve a single problem before researching the appropriate solutions. Learning is ultimately the inverse of a curse that plagues us all...
Conditionals
Exercises after break
Loops
Exercises
Week 1
Orientation 5:30-6:30 (rooms 117-118)
6:30-7:00 - Course intro (Text/Screencast channel/requirements)
7:00-7:30 The tools/resources (Eclipse/Java/Android SDK/developer.android.com/ideone.com/)
7:30-7:45 Quick break to get refreshed.
7:45-8:15- Install and tour Eclipse (We'll tour the android sdk, but install the tools at a later date)
8:15-9:30- Running Java/Variables/Data/Operators/Conditionals/Scanner Classes Exercises and Homework
The Java we'll need to learn first is:
- The core language
- Collections
- IO
- String handling
We will not need to learn Servlets or Swing or a few other java concepts as this is about developing for android
http://www.sitepoint.com/getting-started-with-android-library-projects-part-1/
