Android Applications Introductory Course (Java/XML) –
Creative, Serious and Playful Science of Android Applications
Link to
Android Apps class files
- We used XML, Java and Android to create applications
for Android based devices emulated as Virtual Machines on
Eclipse (often done with Android Studio now, which I've
used too), with either an ARM or Intel microprocessor
emulated device.
- We used the Android Development Kit and Eclipse
programming tools to build introductory yet complete and useful
apps during this course.
- Fundamental computer science principles and
programming ideas that power today’s
smartphone and tablet apps were covered too.>/li>
The Happy Birthday Valentine App - final app of this introductory class on Android Applications using Java and XML
Link
to Happy Birthday Valentine Android App class files
Android libraries and concepts for this app are:
- ScrollView
- LinearLayout
- OnClickListener
- TextView
- ImageView
- Simple Animation
- Intents
- EditText
- Button for email
How the Happy Birthday Valentine App works:
- If you click on the first picture, of Peter and Sophie
with party hats and noise makers in their mouths, it
animates, moves to the right and then comes back.
- If you click on the Send Email button, you can send a
happy birthday email to my incognitodiscforums@gmail.com email account.
- If you hit the ESC key, you come back to the app.
- You hear the Beatles "Happy Birthday Song - Live
Version" playing in the background once the app opens,
and only stops to send an email, or if you click the bottom image, of Peter with his saxophone.
- If you click that image of Peter playing his saxphone,
it takes you to a You Tube video of a monkey singing happy birthday.
- If you hit the ESC key, you come back to the app, and
the Beatles happy birthday song starts to play again.
- I chose to make this because it happened to be my
eldest child's 11th birthday on Valentine's day 2014 during this class.
The Playing With Music Android App:
Link
to Playing With Music Android App class files
Android libraries and concepts for this app are:
- Web View
- Separate Activities
- Interactivity
- Button Presses for Music
- onClick
- listeners
- raw music from local files rather than from you tube
How the Play With Music App works:
- This application simply "plays with music" using web views and separate activities.
- There are 2 activities outside main, one that has buttons that take you to the You Tube video page for
those musical songs.
- The other activity uses a raw mp3, but also has buttons that start and stop the raw mp3 song.
- The interactivity is the button presses that the user
must press, that are responded to in the Java code.
- Unlike the first app in this assignment, I used the
"onClick" properties in the XML code to specify the Java
routine to respond to the button press, since I used
"listeners" in the onCreate code to respond to those in the first app.
- The music I chose was really randomly chosen trying to
find music that may appeal to all sorts of people's tastes in the class who evaluated the apps.
- For the raw musical section, I chose "Happy New Year",
since we just started a new year, and also, because this
version is a mix of opera and rock.
- The app demonstrated interactivity.
War of Worlds, Jabberwocky, Univ. of Illinois NASA group, Round Ball Game - different pages of app using
different acitivities:
Link
to War of Worlds, Jabberwocky, Univ. of Illinois NASA group
and the Round Ball Game Android App class files
Android libraries and concepts for this app are:
- Using 5 separate activities, 4 of which take you to different
app pages.
- Separate Activities
- Interactivity
- Button Presses for Music
- listeners rather than onClick
How the War of Worlds, Jabberwocky, Univ. of
Illinois NASA group, and Round Ball Game App works:
- I decided to use 5 activities for this assignment,
using the first one just to direct the person running it
to go back to the main menu, to see the icons to run the
activities for JabberWocky, RoundBall, War of the Worlds
and Univ. of Illinois at NASA.
- I also embedded the jabberwocky image as an IMG
element within the poem html page given by the professor.
- It was challenging at first for me to get the buttons
for Jabberwocky to work correctly within the separate
XML layout using the web view defined in the main XML
file.
- Rather than make the buttons respond to the onClick
property in the XML file, in my web search, I found
another way of doing that, by making a listener for the
button within the onCreate activity code.
- I also searched and searched but could not find a
short enough mp3 clip for the jabberwocky poem,
and finally found one as a phone ring, but it was not
that great, so instead, used a 30 second music
clip I had laying around that has nothing to do with
that poem, called "Nutrocker", from Emerson,
Lake and Palmer in the 1970's, since I had no other 30
second clip, and no time left to find one that
would match better with the Jabberwocky poem!
- I had no issues with the other activities,
incorporating the provided RoundBall game in one
activity, Univ. of Illinois at NASA's web page in
another activity, and War of the Worlds web page in
another activity.
Our First Android App, Part 1, Displaying in both
portrait and landscape modes, Ada Lovelace and Grace Murray
Hopper as my 2 historically famous computer scientists (since
from the suggested list, these 2 were the only women, and
women continue to be a minority in this field), with photos
and scrolling blurbs, portrait and landscape modes.
Link
to the Displaying 2 Famous Women Computer Scientists (Ada
Lovelace and Grace Murray Hopper) in
History in landscape and portrait modes with scrolling blurbs, Android App class files
How the Part 2 simple app that displays photos
and scrolling blurbs in both landscape and portrait modes works:
Grace Murray Hopper (1906-1992): Grace was an American computer scientist and United States Navy rear admiral. A pioneer in the field, she was one of the first programmers of the Harvard Mark I computer, and developed the first compiler for a computer programming language. She conceptualized the idea of machine-independent programming languages, which led to the development of COBOL, one of the first modern programming languages. She is credited with the term "debugging" for fixing computer glitches (inspired by an actual moth removed from the computer). The U.S. Navy named a ship after her and Cray named a supercomputer after her at NERSC.
Ada Lovelace (1815-1852, England): Ada's mathematical talents led her to an ongoing working relationship and friendship with British mathematician Charles Babbage, and in particular Babbage's work on the Analytical Engine. She translated an article by Italian military engineer Luigi Menabrea on the engine, which she supplemented with a set of her notes, simply called Notes-- containing what many consider to be the first computer program—that is, an algorithm designed to be carried out by a machine. She also developed a vision on the capability of computers to go beyond mere calculating or number-crunching while others focused only on those capabilities.
Our First Android App, Part 2, to display photos and scrolling blurbs in both landscape and portrait modes, switching backand forth.
Link
to the Displaying Some Sweaty But Adventurous Family Photos
(Warwick Castle climb in England, and bike ride in park) in
landscape and portrait modes with scrolling blurbs, Android
App class files
How the Part 2 simple app that displays photos
and scrolling blurbs in both landscape and portrait modes works:
- It is similar to the first application, in that there
is a portrait photo with caption, and you use CTRL-F11
to switch to the landscape version of another photo with
caption, but the theme was from our prior summer
vacation and the history we toured along with a bike
ride near home.
Android Wear Watch App – Created a Watch Face Lab, Done at
Google's offices at 5 Cambridge Center, Cambridge, MA, on
March 19th, 2015 – The International Women's Day Summit with
Google's Women Tech Maker's Group
In this lab at the summit, we created an analog
watch face, customized to our individual needs, while
keeping the best practices for the platform in mind.
There was a bonus section on using the Palette API to
automatically choose the color of the watch
face.
The lab was split in the following sections at
Google:
- Concepts and Setup
- Change the background
- Change the Watch Hands
- Account For Ambient Mode
- Automatic Color Selection Using the Palette API
Purpose of the Android Wear Tutorial and Lab:
- Android Wear is a wearable platform designed for small, powerful devices, worn on the body.
- It is designed to deliver useful information when you
need it most, intelligent answers to spoken questions,
and tools to reach fitness goals.
- Being a personal Device, style is a big part of it.
- Aside from offering a choice of manufacturers,
customizable watch faces give users even more ways to
express their personal style.
- That is what we created in this lab.
About The Android Wear Watch Face
Link
to the Android Wear Watch Face App,
International Women's Day Summit at Google Cambridge,MA,
files from tutorial lab
- A Watch Face is essentially a native service that runs
in the background on an Android Wear device.
- Within this service, there is an engine that renders each screen.
- This can be thought of as an animator flipping through the pages of a book with cartoon drawings.
- The watch face code we created filled each of these pages, making the watch face move.
- In this lab, Android Studio with the Android Wear SDK
was used rather than Elclipse with the Android SDK that
I used in the smart phone Anroid Apps described above
from an online course.
Overview of Key components Used and how we connected
Android Wear to an emulator and ran the app:
- MyWatchFaceService.java – This is the watch face and it's engine, MyWatchFaceService.Engine.
- Within the Engine class, we created 3 methods:
- onCreate() – we initiated new classes, such as the
bitmap image object for the background, etc, run when
the Engine is first started
- onSurfaceChanged() – This is the first time that we
have the dimension of the screen.
- Armed with this new information, we can resize any
screen element for drawing. This code was run only
once at the start.
- onDraw() – This is the core of the lab that we did.
It renders every frame on the watch face canvas.
Since it runs on every frame, it had to be as fast as
was possible, so no image resizing or object creations
were done here. This allows us to have a higher frame
rate which results in smoother animations. No intense
computations should be done here. Image loading and
resizing was done in onCreate() and onSurfaceChanged()
only for this reason.
- res/drawable-nodpi/ - directory where image files
were placed.
- We connected our Android Wear to an emulator, and hit the run button, which installs the app to run on the emulated Android Wear device (instead of a real device). We selected “Do Not Launch Activity” followed by run, since Activity is a program that users launch, and watch faces run in the background automatically, so there is no activity to run.
After the app is installed, you do a long tap on the watch face or emulator
and scroll across until you see a watch face labelled
“Analog Watch Face”, and select it by tapping on
it.