Páginas: 6 (1396 palavras) Publicado: 9 de abril de 2013
Advanced Android Development
review of gReporter open-source project: GPS, Audio / Photo Capture, SQLite, HTTP File Upload and more!

Nathan Freitas, Oliver+Coady

Android Platform Basics

Platform Features
• Application framework enabling reuse and replacement of components • Dalvik virtual machine optimized for mobile devices • Integrated browser based on theopen source WebKit engine • Optimized graphics powered by a custom 2D graphics library; 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional) • SQLite for structured data storage • Media support for common audio, video, and still image formats (MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, GIF) • GSM Telephony (hardware dependent) • Bluetooth, EDGE, 3G, and WiFi (hardwaredependent) • Camera, GPS, compass, and accelerometer (hardware dependent) • Rich development environment including a device emulator, tools for debugging, memory and performance profiling, and a plugin for the Eclipse IDE

What’s in an App?
Libraries Default Activity Other Other Other Activities Activities Activities Android Manifest Drawable Layouts Values Assets Service Content Manifest


/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reportform); ((Button)findViewById(;((Button)findViewById(;

package com.openideals.inaugreport; import import import import import import import import import import import import import import import;; android.content.Intent; android.location.Location; android.os.Bundle; android.os.Handler; android.util.Log; android.view.View; android.view.View.OnClickListener;android.widget.ArrayAdapter; android.widget.Button; android.widget.CheckBox; android.widget.Spinner; android.widget.TextView; android.widget.Toast;


Toast.makeText(getBaseContext(), "There was a problem submitting your report. Wait a second, and then try again!", Toast.LENGTH_LONG).show();

import;; import;


private void showMain () { Intent iMain = new Intent(this, LocationFinderActivity.class); startActivity(iMain); }

Android Application Examples

gReporter: open-source geotagging media capture report client for the Android Platform gReporter: what is it?
• Android client application • Captures text, audio and photo • Finds device location via GPS or Network • Submits captured data + location coordinates to any configured server via HTTP • Displays page of submitted reports or other info • Released under Apache License

Main Menu / LocationManager
• Three Button Main Menu • Activates LocationManager for GPS or Networkbasedlocation lookup • Uses a single PNG background image • Uses “toast” dialogs to display updated location information from callback

Main Menu / LocationManager
((Button)findViewById( Audio)).setOnClickListener(this);

public void startGPS () { //---use the LocationManager class to obtain GPS locations-- if (lm == null) { lm =(LocationManager) getSystemService(Context.LOCATION_SERVICE); } locationListener = new MyLocationListener(); if (lm.isProviderEnabled(LocationManager.GPS_PROVIDER)) { Log.i(TAG, "starting up GPS location provider..."); lm.requestLocationUpdates( LocationManager.GPS_PROVIDER, LOCATION_UPDATE_TIME, LOCATION_UPDATE_DISTANCE, locationListener); currentLocation =...
Ler documento completo

Por favor, assinar para o acesso.

Estes textos também podem ser interessantes

  • Android
  • Android
  • Android
  • Android
  • Android
  • O que é android
  • Android

Seja um membro do Trabalhos Feitos