Wandering Nude in a Forest

What goes into making an Android application?   Java for the computing.  Pictures, Icons and other resources for the eye/ear candy. A place to put all your button and title labels for easy language translation.  And a bunch of  XML to bind it all together.

The granddaddy of the binding files is “AndroidManifest.xml”

AndroidManifest.xml is the connector between the xml resource files and java programming.   For example. If you create a new screen(Activity) called “about”.  You will define the screen layout in the res/layout/about.xml file.   You will also create a new activity called  AboutActivity.java.  If tried to run it before updating the manifest,  the about screen would not be available.   Remember to add a new activity called .AboutActivity under the Application tab of the manifiest editor.

 

 

Their Words Not Mine…OK…Mine

Because I am learning and this is my blog, I reserve the right to be wrong, very wrong, or just plain Wrong!  Consider this your one and only apology.  Sorry about that.

Getting familiar with Android terminology and structure…

A bit about their design philosophy.  The have two:  Connecting things.  No need to invent the wheel over and over. If you need an email app, don’t roll your own, just ask Android if there is a suitable app to handle it.  Customize it.  The user is not locked into a single way of getting a job done.   Is the default browser crappy?  Get a different one.  They also really like protecting data.  Each application runs in its own space. To gain access to other data,  permission must be granted.

Pick that app apart.

At any one time, applications typically either collect or present data.  A user can’t handle more than one screenfull at a time.   Applications that require more than one screen, must provide a method.

Applications may do more than one thing.

Activities represent a unit of work within an application – typically one screen full.   It may be data entry, it may be streaming netflix.

Services represent the background processing where the user’s active participation is not required.   When I turn on my gps,  that is a service.  So is streaming Pandora audio while I surf using the browser.

Broadcast Receivers will perform a task for you.  When I tap on an url link inside e-mail, it starts in Opera.  Email declares a need and Opera, being registered as a Broadcast Receiver for for web pages, performs the task.  Does that mean that all broadcast-receivers are content providers?  I think one is data the other is program.   Android describes the situation where an app needs a picture, spins the task off to the camera, and when done it returns to the app -photo in cache ready to go.  Powerful stuff.

Content providers  – handle the chore of managing common data.  When you start a new instant message,  the contact manger provides the default list of who you can talk to.

These four categories of components represent the core of Android structure.   But how do they talk?   Mostly through a message passing system known as an Intent.  The intent is the binding agent between application bits.  For example, once the contact is selected, the uri is returned to the originating app.

With broadcast recievers, you don’t know exactly where the application is going next, so it uses the ContentResolver to provide a way for apps to respond.

Each of these components has a variety of ways they are called, but all use intent as the conduit for communication between.

 

Rich’s Take on Android Development

In early 2012 I had the opportunity to explore Android development as related to industrial controls for Automation Solutions.  I immediately found the android developers website at google, but the dizzying array of options and terminology left my head spinning.  I wanted to get the information I needed fast without getting bogged down.  There are a couple ways to get across the techno-chasm, build a bridge using the tools at hand or go to school.  Because I am a techno explorere, I took the former.    This blog helps me unwind the material I’ve collected and, with luck, will be a benefit to future explorers.

Why is it so hard?  Cracking into Android world is no harder than any other.  It is largely a matter of getting into the “Android developer’s” head.    When I did development on the Palm Pilot, lo those many years ago, I faced the same learning challenge.  Same with Flash, and Java.  Learn their terminology.  Learn the framework.  Create a few experimental applications that get you into the tech, but not so much you lose your way and fail.  The key here is to take a bunch of baby steps so you never need a great leap into a techno black hole.

When I did development on the Palm Pilot, lo those many years ago, I faced the same learning challenge.  Same with Flash, and Java.

What about the literature?  Since I am a late-comer to the Android environment, there many books out there.  I took all the useful books I could find from the main branch of the Portland public library.

  • Android development for dummies
  • Developers guide to Android Development

 

What they do:   Install developer tools,  Create and run  a “hello world” app that shows how the simulator and IDE work together.  Next they talk about UI basics.  How to put stuff on a screen or Start talking about UI basics, yadda yadda yadda.

What I am going to do.  Not much different.  The projects should be multifaceted meaning they will implement a series of experimental applications.  Only the first is a throw-away. All others should be heading toward what a commercial application would need in terms of functionality and look-and-feel.

Uncover Android’s UI elements without getting overwhelmed.  Get in the habit of writing programs the Android way.   For example, use Strings.xml so translation from one language to another becomes nothing more than a linguistic exercise.  I will use XML based screen layouts, themes  and inline subclasses for button responses.

Project 1:  Hello World Application

  • Hello World
  • Add “About” screen
  • Add “preferences” screen (save the theme)
  • Add context menu

Project 2:  Save Data Locally

Project 3:  Background Services

Project 4:  getting data from external sources

Project 5:  game-time – super labrynth

Project 6:  Dear Abbey, jumble daily crossword puzzle app.

 

 

Lunch Time Sunday Morning

Question of the day: Is Tolkien’s Hobbit story a retelling of Stevenson’s Treasure Island?

There was this man.  And a table.  Then there was the blank white page.  The all absorbing white of nothing and everything.  Then there is a voice.  The gentle words of a young female.   When he focuses his attention on her, she is just finishing a statement, but the words don’t make sense.  The eyes are waiting for a response though.  Nod and smile, frown.  Was she talking about something good?  He paused hoping she would telegraph some sort of prompt, some indication, of what she expected.  A moment frozen in time.  Without changing expression, he nods almost impercepibly.  It is enough and she continues her verbal stream of conciousness.

At his feet, another female.  Not so young, and of a completely different character.  Both are outgoing. This one is both younger and older at the same time.  Today she chooses the guise of matron-de-maison.  Her words are emphatic and expressive, but he cannot comprehend what they mean.  Their eyes lock and he meets two green eyes that express everything and nothing.  He tries to nod, but she just stares.   He blinks, but when his eyes open the direct gaze confronts and confounds.  Perhaps she only needs reassurance and reaches to give a gentle pat.  You are not alone.   She opens her mouth again and the sound of a symphony rumbles forth.  It is short, but in that space there is a theme, a statement of fact, that his coffee soaked mind cannot comprehend.  She stares.  He gazes,  but does not try to pry deeper.  She is patient, but being older now, she knows her mind and needs.  She softly pads off.  He hears the strains of the same symphony seconds later, distant, from another room.  Now he has time to contemplate.

For a second they are in distant Egypt standing in front of four monstrous statues of ruler kings or gods.  Man, God?  They argue the grosser points, but conclude nothing.  They’ve been down that path before and decide not to waste an afternoon quibbling over trifles.  At least that is what he thinks.  And they are gone before she has a chance to change his mind.

This is the edge of reality.   The west.  It is the place where the setting sun dips unto the endless sea and all things are possible.  Kings and paupers ride the same rails; tracks laid down by their great-grandfathers completing an epic journey from every corner of the world.   Kings look like beggars and beggars are wraiths of the winds.  No difference.  More on that later.

His jeans were not too worn.  His cheeks, while red with exposure, were clean.  He had delicate hands and wrung them nervously as he paced back and forth in the park.  He was nervous.  He was like an animal trapped, but there were neither bars nor locks.  This was a trap of his making, his choosing, his will.  He simply made up his mind one day that inside was better than out, because if he remained out any longer, he would become the lonesome wind itself.

She was there too.  She sat in a box inside a box inside a box that held glimpses of fragments of ideas caught at the moment of formation.  The glass barrier that separated her from the outside world provided a safe glimpse of reality.  The glass that held the empty aquarium was so thick that even sound was muted to almost silence.   Someone had bored a couple small holes for meager communication and exchange.  Some communication, some exchange.  She watched his pacing because the world outside excited and scared her.  Her vantage, like a housecat’s staring at the world through a suburban picture window, provided the stimulation without the terror.

How does a balloon that floats free to the uncharted reaches of space tether itself to earth again?  To look into his eyes was to see a raging storm on the sea.  Dark, ominous – terrifyingly powerful.  How can a man, that has eaten such a storm, walk into a building without scrubbing the walls bare and drown all within.  Yet, here he stood outside the fortress pondering that very notion.  The wind that howled in his ears merely yearned to  bring back the thing lost.  A thing that had, for him, no name.

It might as well have been petticoats.  He might as well have been in knee length pants.  He held her hand and she pulled him through a crystal maze.  She knew about his penchant for destruction and pulled him back anytime he floated too near one of the blazing cases.  The cases was like ice on fire.  The items they contained were like golden flames.  Each one was a burning question.  Desire, mystery, truth.  Behind the thin glass he saw answers, but they were not sensible as they had been described to him.  The images were crazy, dappled drops of color, like a lens out of focus.   The words of the adults as they walked from one dazzling room to another were scattered.  It was like taking a drink from a torrential waterfall, opening his mouth for a sip, and being rewarded with the crashing of ton-upon-ton of liquid.  Smothering and refreshing he allowed his senses to be battered while trying to allow there merest particles drip into him.   He closed his eyes to the merest slits and let her carry him along. He’d let her carry him anywhere.

Her name was Cleo.  Like Cleopatra.  Her father, being a student of history, loved all things Egyptian.  Although he died never having seen the mother country.  He dedicated too many hours to the study to the exclusion of all else.  Alas, he was not a man of letters and could not afford the leather bound volumes that great historians had devoted countless hours to. He had, in his desire for knowledge of this mysterious land, traveled to the lending library of the largest town in their county.   He found, in a poorly lit section, a number of books whose opening pages promised to describe in great detail the history of one of the worlds great civilizations in the detail worthy of a poet historian.  The trouble, he found, with poet historians, was they were just that, only more-so.

The tomes stopped him in his tracks.  He had come up against a wall of epic proportions that he knew he could never scale. Instead, he had to take satisfaction from travel-logues.  He drank in the pictures of men in pith-helmets standing in front of heiroglyphic walls and statues of ebony men with the heads of animals.  He learned about the popular voyages of the later day explorers and retold them to his daughter in the evening before turning out the lights to sleep for the night.

His studies changed one day when he read a small advertisement in the margin of a pulp magazine called “unexplained worlds”   The magazine published works of fiction as if they were fact, and described the mystery such topics the “Donner party”, “Lizzy Borden” and how the pyramids were built, well as the location of treasures buried around the world throughout time.    The advertisement read, “Strange but True, the lives and loves of the pharaohs alive at your fingertips.  Send 5 cents and Self addressed Stamped Envelope to …”

Although skeptical, he found the price of admission not too high, and so sent for the prize.  Several weeks later he received a response.  His block writing unmistakable on the front.  On the back, where the flap touched, was a stamp seal of an Eye.  Inside were three page manuscript retelling of the story of how[edit – boy god cut up – girl god  finds all the pieces -] and a single hand stamped heirogiyphic symbol – the eye of horus – and its meaning.  It concluded with an ad to obtain more secrets of Egypt by sending 5 cents and a Self-addressed-stamped-envelope to the same p o box as before.  They further instucted them to draw the “seal”, eye-of-horus, on the inside flap of the envelope.

He sent off his money immediately, but it was weeks before a response arrived.  He was not disappointed when he opened the response several weeks later. His hands shook as he turned the envelope over in his hands.  There on the was another heiroglyphic symbol that looked like a bird facing the reader.  Like the owl, it promised mystery and secret knowledge, and her father finally had a source for his lifelong pursuit.

“Come and sit,” he’d say and pat the wooden chair beside his table. “Look at this,” he said pointing to a crudely stamped symbol.  As she looked, he began… “In the land of the pharaohs, the sun set in two places every night.  The sky disk in the west, and the flaming son on Earth in the temple along the white nile.”…When he first started telling her these stories, he’d read from the page, but after several issues,  he found he had a voice of his own in telling the story.  His words wove a rich tapestry that captivated Cleo.  It was like being transformed into a different world.  It was colorful and described the intrigues of Gods that walked upon the Earth.

He always ended these evenings by asking if she could describe the symbol he showed at the beginning of the story.  She’d describe what she saw, “it was two wavy lines like the water”

“That’s right, but there is more ” he’d reply as he leaned closer.  This was not father telling daughter a story, it was a co-conspirator telling profound secrets.  Since the death of her mother, they’d always been close, but this bound them in an even more special way.  Years later, Cleo could not talk about her father without getting quiet and her voice distant,  until her words faded and she was left in thoughtful silence.

When he died, there was not much of an estate.  He left a small bank account with enough to cover the expenses of his funeral and a few extra dollars.  The remaining amount provided the basis for an impromptu, but creditable wake at her house exactly twenty-one days after his death.

 

Random Thoughts from Southeast Grind on Powell

Bang! Bang! Bang! Bang!  Pause. Bang!  He types as fast forward as he does back.  That is a starting point. Now the wizard tells the user what he is about to do, but when it doesn’t happen the way the novice expects, the wizards face is blank as stone.

Where does this stuff come from?  I wonder and I ponder, but no amount of logic can prevail against the worst, the words.  Blah blah blah says the inoccouous stuff that leaks from the walls.  It is reminicant of music, but not quite.

So, there I was…sitting next to the most beautiful woman I’ve ever seen and she farts.  Not a dainty whoops, but a big ugly frat-boy type fart.  No apologies needed, she turns to me and smiles. Then wrinkles her nose and waves her hand in front of her face.  “Wooh” she says.  A few seconds later I realize why she frowned so.  Wow!  In the moments until the noxious odor dissipates, I sat there stony faced with a goofy smile on my face wishing it had been merely a frat-boy fart.

I was looking for a boat on craigslist the other day.  I wasn’t sure what I wanted, but there was no limit to the beauty and crap out there – all overpriced.  What am I looking for?  Well, I’d like something to bop around the local waterways.  I am not in a hurry.  You may recall that I had a small taste of nautical life when I got that inflatible kayak a couple years ago.  No way to turn it.  I was always careful to fill it using the little air pump I attached to my car’s cigarette lighter. Invariably during summer – the only time I used the thing – it would deflate 10% as soon as it hit the water.    Chris, my nephew-in-law, borrowed it one time, but the water was a mile from the car.   He used the foot-pump to get that sucker filled and lo – when he dipped it into the water it didn’t pucker and dip.  I adopted a new overfill attitude from that moment on.  But it really didn’t last.  The season was over.  By the next year I knew exactly what to do.  When I arrived at the campsite, I went about turning the yurt into my little home-away-from-home.  That accomplished within minutes,  I pulled my kayak bag from the back of the car.  No need to use the car pump.  I was on vacation, therefore I needed to get green and natural and healty and anti-city, so I pumped using the foot pump I kept for emergencies.  Whoosh – whoosh – whoosh.  I know, you are expecting a  “and then it burst on me” type ending.  Nope.  It filled fine and I put it on the side of the yurt to wait until we all went to the lake.  Vacations and gin and tonic being what they are, I didn’t go near the water for two days.  On that third day, in preparation for a nice water outing, I collected the foot pump, water sneakers, paddle and life-vest.  Next was to bring the kayak into the open so I could use it as a basket for my trip to the water. Yup – flat.    Just the bottom, but that is where the stability was.    So, now I think I need a new way around.  I saw a canoe for $400 – see about the price of a new one.  I thought if I got one of those little electric outboards I could putter anywhere.  So much for green, natural healthy and anti-city.  Vacation is over.