Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, October 2, 2014

Android Mobile Coursera class has started

I am signed up with 140,000 other students for  the "Programming Mobile Applications for Android Handheld Systems" training class starting now.

The teacher is Dr. Adam Porter

Preview lectures

Asignments

Lecture 1 slides

3 Applications
2 Application Framework
1 Native System Libraries (Native DK) / Runtime (Davlik - Core Libraries)
0 Linux Kernel

3 : Contacts, Phone, Browser, Home app, etc

2: reusable software that many applications will need like Package Manager , Window Manager, View System (common user interface elements such as Tabs, Lists, grids, text boxes, buttons, textview ), Resource Manager (non-compiled code resources: strings, graphics, & layout files), Content Providers, Activity Manager,  Location Manager

1 : core performance sensitive activities on device (native dev kit) such as C library, surface manager, media manager webkit etc. / File packaged with other resources and installed on device. Dalvik VM executes the Dex Bytecode file when invoked on device. Dalvik VM designed to be resource constrained environment with slower cpu, less memory, limited battery life System C library .

0 : Standard services - Provides infrastructure mechanisms to manage mobile device resources. Android specific such as power management, Android Shared memory, Binder, etc

Use the Hierarchy Perspective after the program is launched :


here is some sample output(click on your activity on the left):



The Traceview within DDMS can be pressed to start when a debug tracepoint is hit, which starts the profiling. After profiling is started, let it run through, and then click the same button to end the profiling.  The botton to start/stop is shown:



After hitting the end button, the output is shown (timeline view on top and profile view on bottom):



Method profiling - select class, start it, then do something on device with app, click stop:



This first week includes:
 1. The Week 1 Quiz. Sixteen or so questions to help you make sure you've followed my lectures.

2. Two Labs.
 a) Lab - Learn to Submit - A very simple assignment designed to make sure that you can submit work to the Coursera system for grading

"To do this assignment, simply create a one-line text file with the name of your home country and nothing else. Make sure you are creating a real text file, not, for example a .rtf file" Then click on the submit button to select and upload that text file."

 b) Lab - Development Environment - A more involved Lab to help you set up your Development Environment and to familiarize yourself with it.



Intel Hardware Accelerated Execution Manager(HAXM)


AndroidManifest.xml:

Define your package :
package="course.examples.theanswer"

Define your Actvity:
<activity
            android:name="course.examples.theanswer.TheAnswer"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>



Define your layout in answer_layout :
<RelativeLayout...
<TextView
        android:id="@+id/answer_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textSize="24sp" />"


set your layout and access your widget
   setContentView(R.layout.answer_layout);
   TextView answerView = (TextView) findViewById(R.id.answer_view);
   answerView.setText("The answer to life, the universe and everything is:\n\n"+ output);


calculator  with 2 EditText , TextView widgets and a Button with on click listener:
        final EditText value1 = (EditText) findViewById(R.id.value1);
        final EditText value2 = (EditText) findViewById(R.id.value2);

        final TextView result = (TextView) findViewById(R.id.result);

        Button addButton = (Button) findViewById(R.id.addValues);
        addButton.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                try {
                    int val1 = Integer.parseInt(value1.getText().toString());
                    int val2 = Integer.parseInt(value2.getText().toString());

                    Integer answer = val1 + val2;
                    result.setText(answer.toString());
                } catch (Exception e) {
                    Log.e(LOG_TAG, "Failed to add numbers", e);
                }
            }
        });



JUNIT Test of Layout
 LayoutTests extends ActivityInstrumentationTestCase2<MainActivity>
    public LayoutTests() {
        super("com.mamlambo.article.simplecalc", MainActivity.class);
    }

    protected void setUp() throws Exception {
        super.setUp();

        MainActivity mainActivity = getActivity();


1 – Log.i(…, …) – Sends an INFO LogCat message
2 – Log.d(…, …) – Sends a DEBUG LogCat message
3 – Log.e(…, …) – Sends an ERROR LogCat message
4 – Log.v(…, …) – Sends a VERBOSE LogCat message

http://developer.android.com/reference/android/util/Log.html

import android.util.Log

 private final String TAG = "TheAnswer";

 Log.i(TAG, "Printing the answer to life");


settings custom locale:

http://developer.android.com/training/basics/supporting-devices/languages.html

values/ strings.xml
  <string name="hello_world">Hello world! My Name is David.</string>

values-es/ strings.xml 


   <string name="hello_world">Hola Mundo! Me llamo es David!</string>
layout/activity_main.xml:

TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world" 



https://code.google.com/p/simple-calc-unit-testing/downloads/detail?name=FullCodeDownload.zip&can=2&q=

3. The Getting to Know You Survey - This is only graded activity for the week. We'd like to get some information about you to help us know more about who you are, your background and your expectations for the course.
http://help.coursera.org/customer/portal/articles/1329059-how-can-i-keep-track-of-course-deadlines-
https://class.coursera.org/android-001/api/course/calendar

Tuesday, September 30, 2014

Android information and devlopment resources

The Android javadoc is great reference material:
http://developer.android.com/reference/packages.html

The Android Application components another important resource: 
http://developer.android.com/guide/components/index.html

The Android Welcome page
http://developer.android.com/about/index.html

The Android Open Source Project
http://source.android.com/


Linux Kernel: Standard services - Provides infrastructure mechanisms to manage mobile device resources
 •  Security
•  Memory, process, & thread management
 • Network & File I/O
 • Device driver framework (pluggable devices)
Android specific includes power management, Android Shared memory, low memory killer, Binder (Inter Process communication) , alarm driver, debugger, logger
http://en.wikipedia.org/wiki/Android_(operating_system)#Linux_kernel


Native System Libraries (C/C++ Native DK) core performance sensitive activities on device
System C library - (std os system calls such as process/thread creation, memory allocation, mathemetical) bionic libc
• Surface Manager  - (updating the display) display management
• Media Framework  - (playback) audio/video streaming
• FreeType  - library for rendering fonts
• Webkit - (rendering and display web pages ) web browser engine
• OpenGL ES, SGL - graphics engines
• SQLite - relational database engine
• SSL  - secure sockets layer
http://developer.android.com/tools/sdk/ndk/index.html

Runtime (part of System libraries layer)
Davlik virtual machine executes the android apps, code written in java compiled into series of bytecode files , Davlik dx program transforms java classes into single Dex bytecode file  (classes.dex). File packaged with other resources and installed on device. Dalvik VM executes the Dex Bytecode file when invoked on device.
Dalvik VM designed to be resource constrained environment with slower cpu, less memory, limited battery life
http://en.wikipedia.org/wiki/Dalvik_(software)
Core Libraries
• Core Java classes (building blocks)
• android.* (application lifecycle)
• java.*, javax.* (data structures, concurrency, I/O)
• junit.* (unit testing)
• org.*  (internet/ web services)
org.json.*, org.xml.*
http://en.wikipedia.org/wiki/Comparison_of_Java_and_Android_API

Application Framework - reusable software that many applications will need
Package Manager  - Manages application packages on device such as info about apps
Window Manager  - Manages top-level window’s look & behavior (notification bar, main application window, sub-menus/dialogs)
View System  - common user interface elements such as Tabs, Lists, grids, text boxes, buttons, textview
Resource Manager - Manages non-compiled code resources: strings, graphics, & layout filesContent Providers  - Inter-application data sharing (i.e. databases)
Activity Manager - Application lifecycle & common navigation stack
Telephony Manager - State of telephony services
Location Manager - Access to system location services
Notification Manager - Notify users when events occur
https://sites.google.com/site/io/inside-the-android-application-framework

Application - built in apps. Can substitute apps.
Home, Contacts, Phone, Browser, Email

Activity : Represents a single screen with a user interface (view user interface) - see Activity class
activity lifecycle or http://developer.android.com/reference/android/app/Activity.html
- Can be started by creating an Intent object & passing it to startActivity()
- Parameters can be passed as “extras” to the Intent used to start the Service
- Apps can have multiple Activities

Service -operation in background, can bind to other services or Activities. For performing long-running operations or to access remote resources. Extends the Service class.
Started Service – Often performs a single operation & usually doesn’t return a result to the caller directly
Bound Service – Offers a client-server interface that allows components to interact with the Service
http://developer.android.com/guide/components/services.html

Content Provider - Manages a shared set of application data , Never accessed directly,
but via a Content Resolver
Consistent access to data (i.e. Rest, Crud operations)
Data store backing options like SQLite, Web, File systems
Can consume data from other content providers
Extends the ContentProvider class
http://developer.android.com/guide/topics/providers/content-providers.html

Broadcast Receiver - A component that responds to system-wide Intent broadcast announcements
- Supports complex Intent filtering
- delivered asynchronously to all receivers
Extends BroadcastReceiver class
http://developer.android.com/reference/android/content/BroadcastReceiver.html

Intents - messages (i.e. events) that link application components together
http://developer.android.com/guide/components/intents-filters.html

https://sites.google.com/site/io/anatomy--physiology-of-an-android


ADT Bundle:
latest android platform
eclipse and ADT plugin
latest image for emulator
additional dev tools
http://developer.android.com/sdk/index.html

Emulator:
network/speed latencies
battery power
location coordinates

telnet localhost port# (i.e. 5554)

slow network:
network speed edge
network speed full
power capacity 5

power status not-charging

geo fix 0.0 40.0

sms send 3015555555 "msg"

call port number other emulator
http://developer.android.com/tools/devices/emulator.html

Davlik debug Monitor service (DDMS) perspective

- file explorer
- logcat
- button in ddms to start and stop profiling at debug tracept

Open perspective -> Hierarchy view





http://developer.android.com/guide/index.html
http://developer.android.com/training/index.html
http://www.androiddevtools.com/
http://www.dre.vanderbilt.edu/~schmidt/cs282/
http://www.cs.swarthmore.edu/~aviv/classes/s13/cs71/
http://www.cs.odu.edu/~cs495/
http://www.vogella.com/tutorials/android.html
http://www.cs.unibo.it/projects/android/2013/index.html#links
http://liisp.uncc.edu/mbapps/
http://www.stanford.edu/class/cs193a/
http://cs76.tv/2012/spring/
https://www.youtube.com/watch?v=RNaOWBBvAGo



Saturday, January 25, 2014

Galaxy Tab 3.7.0 Android page

I am looking into rooting my Samsung tablet so I can run a more recent version of Android. Here is one page that was referred to me as a good resource for doing this. http://forum.xda-developers.com/galaxy-tab-3/development-7

Unfortunately, with a SM-T210R tablet it does not appear like there is any implementations past 4.1.2

However, for the rooting process a good starter document for some of the steps you have to take, and the tools for the job.
  • getting the Samsung USB driver software
  • placing device in USB debugging mode
  • downloading the odin software and using it to load the md5 file
Only thing as a newbie here, I was not so much prepared for the flickering issue after the install.

This video by RootJunky.com made me realize I needed the ClockWorkMod recovery tool for installing zip files from my SD card. I would soon after find out how i get things on sd card. 

In order to mount to the sd card, I found at the command line a tool called adb which can be run at the command line. Its located in sdk from android in the platform_tools directory
  • C:\Java\androidtools\platform-tools>adb devices
  • C:\Java\androidtools\platform-tools>adb push RocketTab3.0.zip /sdcard/Android/


After having the zip on the sdcard, you simply install it using the CWM tool from above. The tool is present when you hold down the power,home, and volume up button and start navigating through the directories.

Yes, I now have Rocket Tab lite installed.



Wednesday, January 8, 2014

Mobile Coursera class starting soon

I am signed up for  the "Programming Mobile Applications for Android Handheld Systems" training class starting this month.


Looks like the teacher is Dr. Adam Porter

Preview lectures


Related Content:
Davlik
Android Guide
Android Training
http://www.cs.umd.edu/class/fall2013/cmsc436/CMSC436/Welcome.html

Saturday, August 24, 2013

Android introduction at RTP Software symposium

Based on Harmony

Oracle bought Java for lawsuits but didn't work out as Google was very careful. Suit scaled down to 7 claims. Google essentially won lawsuit.

Dalvic virtual machine

With iPhone you can make more money on apps where with Andriod it's "Internet of things" where apple is more hardware company, as google is more service company where they want Android on any type of device

Google dashboard shows the state of user base analytics

Development platform changed in 3.2 honeycomb

Ice cream sandwich 4.03, 4.04

Jelly bean 4.1, 4.2

Key lime pie 5.0

http://developer.android.com/index.html

ADT platform based on eclipse moving to android Studio with IntelliJ

Google dashboard - 14 day period

Moving from ANT to gradle (early release of the plugin)

Xavier Ducrohet eclipse plugin spoke at google I/o

http://commonsware.com/Android/ by Mark Murphy

SDK, API by google built on top of SDK

Tools -> Dowload  -> Downlaod the SDK
SDK Manager

Need emulator or connected device

Droid AT screen tool
AVD

Haxm Android emulator

Activity is like a view
Intents are events
http://developer.android.com/guide/topics/ui/index.html
TextView is a label

relative lyout, linear layout

ListView http://developer.android.com/guide/topics/ui/layout/listview.html

http://www.springsource.org/spring-android

Android R

Postman - chrome extension http://www.getpostman.com/

http://www.amazon.com/Android-Programming-Ranch-Guide-Guides/dp/0321804333


https://github.com/kousen/icndb

https://code.google.com/p/google-gson/ - deep query

http://stackoverflow.com/questions/3280051/how-to-enable-logcat-console-in-eclipse-for-android

create, start, on resume, running
pause (can go to resumeor stop), destroy

log.d (TAG,STRING)

rotate - ctrl f11

back button does a destroy

http://developer.android.com/guide/components/processes-and-threads.html