. , .

,
, ? , ? , ? ? .

Log-in.ru© - . , , -.

!  ? …    
, .

 

 

?     
...

7 420000 .

   [X]

 0 

: 1500 Android ( )

 : 1500      Android




:

30 50 Android. .

: 0000

: 396 .



: 1500 Android :

: 1500 Android

: 1500 Android

30 50 Android. .


: 1500 Android

, 2015

Ridero.ru

1

:
Linux
MAC
Unix
WindowsCE
WindowsXP

2
:
, , , , Linux.
, , , , Linux.
, , , .
, , , Linux.
, , , Linux.

3
:
.
.
Layout Drawing.
View Viewgroups.
Widgets.

4
Java :
NET Framework
Dalvik
Forth Virtual Machine
Juke Virtual Machine
Parrot Virtual Machine

5
APK?
.
.
.
.
.

6
Layout :
/res/
/res/anim
/res/drawable
/res/jpg
/res/layout

7
assets :
ASCII
DOS
FAT
JPEG
raw file

8
:
.
.
.
.
.

9
bmgr :
.
.
.
.

10
?
.
, .
.

11
?
AsyncTask Activity, , .
ȠAsyncTask UI thread.
ȠAsyncTask UI thread.

12
?
AsyncTask UI , . UI Handler.
AsyncTask .
ȠAsyncTask .

13
Foreground Service:
foreground().
.
, foreground.

14
A1, A2, A3A4 , , . Backstack A1-A4-A2 A3. A4 A2 FLAG_ACTIVITY_NO_HISTORY. finish () A3, ?
A1
A4
A3
A2

15
A1, A2, A3A4 , , . Backstack A1-A2-A4 A3. A2 A4 FLAG_ACTIVITY_CLEAR_TOP. finish () A3, ?
A4
A3
A2
A1

16
A1, A2, A3A4 , , . Backstack A1-A2-A3-A4. A3 A4 . finish () A4, ?
A2
A3
A4
A1

17
(+) android: id="@+id/my_id :

XML- ID

18
, , , :
START_NOT_STICKY
START_REDELIVER_INTENT
START_STICKY
START_SERVICE_INDEFINITELY

19
Android , :
.
.
.

20
:
Normal broadcast
Ordered broadcast

21
, , :
NullPointerException
illegalArgumentException
ArrayIndexOutOfBoundsException
SQLException

22
, getFromLocationName () :
2
3
4
5

23
startForeground () stopForeground () API level:
2.0
3.0
1.5
2.2

24
:
isCheckable()
isAvailable()
isValuable()
isCaview()

25
, , :
<supportmultiple-screens>
<supports-screens>
<supportall-screens>
<supportevery-screen>

26
onBind():
, .
startService () onBind().
, NULL.
, Ibinder

27
Android :
GnusGPL
ASL2.0
OSS
Sourceforge

28
Android?
Oracle Technology
Dalvik
Open Handset Alliance
Google

29
Google Android?
.
iPhone.
.
Google .

30
AndroidOS?
Google gPhone
T-MobileG1
Motorola Droid
HTCHero

31
, Android?
, Android , .
Android .
Android iPhone Apple.
Android .

32
Android?
.
Android .
Android , .
Android , .

33
Open Handset Alliance?
2005
2006
2007
2008

34
Android Android.
True
False

35
Android _____ , , , .

36
Google .
True
False

37
Android ?
Linux.
. .
.
.
.

38
Google Android?
2007
2005
2008
2010

39
Android 1.5 ?
.
.
w/A.
.

40
Andriod?
cupcake
Gingerbread
Honeycomb
Muffin

41
Android - , .
True
False

42
Android 2011?
1.1
1.5
2.3
3.4

43
, Android ?
WiFi.
.
.

44
Android Java Micro Edition (J2ME).
True
False

45
Android?
Webkit
Dalvik
OpenGL
SQLite

46
Android Linux :
.
.
.
.

47
Android ?
Linux.
Windows.
Java.
XML.

48
Dalvik?
2003
2005
2007
2006

49
Android ?
Apple App Store.
.
.
Android Market.

50
Android OS, Java byte :
Java
Dalvik application
Dalvik byte
C

2

. apk?
Application Package
Application ProgramKit
Android ProprietaryKit
Android Package

2
, .
True
False

3
Google Android Market?
.
Google.
Google .
Android Market Google.

4
IntentService?
IntentService , , .
createPendingResult IntentService.
ResultReceiver IntentService.
IBinder IntentService.
Messenger IntentService.

5
APK?
Dalvik.
.
Native Libraries
Webkit

6
, Java byte Dalvik byte ?
Android Interpretive Compiler (AIC)
Dalvik Converter
Dex compiler
Mobile Interpretive Compiler (MIC)

7
Android :
,

8
AWT Swing Android.
True
False

9
R. java .
True
False

10
manifest xml?
, .
, .
.
.

11
Layout xml?
, , .
, .
, .
, .

12
Android :
, , .
Android .
, , .

13
Java Android .
True
False

14
Android Android , :
.

15
?
,
Android SDK, .
, .
, .

16
R :

17
:
Java
Java

18
AVD. ?
Android Virtual Display
Android Virtual Device
Active Virtual Device
Application Virtual Display

19
Android SDK .
True
False

20
________ .
Layout file
Manifest file
StringsXML
Rfile

21
, .
True
False

22
Android Software Development Kit (SDK) , Android .
True
False

23
Android Dalvik ?
Java .
R-file.
.
SDK.

24
Android , :
, AndroidSDK.
Android .
.
.

25
, , ?
NEW_TASK_LAUNCH startActivity().
FLAG_ACTIVITY_NEW_TASK startActivity().
FLAG_ACTIVITY_SINGLE_TOP startActivity().
<category android: name=android. intent. category. LAUNCHER/>.

26
Android ?
network speed gsm
network speed 14.480
network speed3g
network speed edge

27
Android SDK Manager AVD Manager?
1.6SDK. 1.5 AVD , SDK.
AVD, .
android , "<SDK install folder> /tools .
, Android SDK Manager AVD Manager, SDK Android-, NDK-, USB- .

28
android. content. Context. sendBroadcast android. content. Context. startActivity?
.
.
.
Intent.

29
ProgressDialog?
ProgressDialog AlertDialog.
ProgressDialog : STYLE_HORIZONTAL
STYLE_SPINNER.
ʠProgressDialog XML setContentView().
ProgressDialog Drawable .

30
Traceview?
.
.
.
UI .

31
GPS?
Layout file
Manifest file
Source file
Property file

32
?
<uses-permission> <manifest> AndroidManifest. xml.
<add-permission> <manifest> AndroidManifest. xml.
<uses-permission> <application> AndroidManifest. xml.
<permission> <application> AndroidManifest. xml.

33
SQLite?
.
-.
SQLOpenHelper.
ContentProvider.

34
, ?
res/anim
res/files
res/raw
res/values

35
DDMS?
, , .
, .
.
.

36
?
Intent intent = new Intent (FirstActivity. this, SecondActivity. class);
startActivityForResult (intent);
.
-.
.
.

37
, , .
Intent resolution
Intent declaration
Intent overloading
Intent transition

38
MenuItem?
MenuItem add () Menu.
MenuItem Intent .
MenuItem .
MenuItem checkbox.

39
SD-?
SD- FAT.
SD java.io.File.
SD- Environment. getExternalStorageDirectory().
Linux SD-.

40
DalvikVM core :
JavaME
JavaSE
JavaEE
JAX-WS

41
- , ?
onBind
onDestroy
onStartCommand
onCreate

42
ListView?
ListView ListActivity.
ListView, , .
, ArrayAdapter ListView, ArrayList.
ListView View , TextView.

43
Toast?
-.
- .
-, .
- : Toast. LENGHT_SHORT Toast. LENGTH_LONG.

44
ContentProvider, Android?

45
Android?
onCreateOptionsMenu()
onCreateMenu()
onMenuCreated()
onCreateContextMenu().

46
Android id XML ?
findViewByReference (int id);
findViewById (int id)
retrieveResourceById (int id)
findViewById (String id)

47
Android ?
Service
Activity
Layout
Content Provider

48
Activity, ?
onStop()
onStart()
onCreate()
onRestore()

49
BroadcastReceiver?
, BroadcastReceiver , , .
BroadcastReceiver , getReceive().
BroadcastReceiver .
BroadcastReceiver .

50
?
Layout file
Property file
Java source file
Manifest file

3

:
Intent intent = new Intent (FirstActivity. this, SecondActivity. class);
.
.
.
.

2
Intents?
Activity.
Service.
Broadcast receiver.
SQLite DB Connection.

3
Android?
mylayout. xml
myLayout. xml
my_layout. xml
mylayout1.xml

4
?
Non-visible
Visible
Foreground
Background

5
VideoView?

MediaController .
MediaPlayer .
URI .
XML .

6
, R. java?
src
res
bin
gen

7
AndroidManifest. xml?
AndroidManifest. xml , .
AndroidManifest. xml .
Android , AndroidManifest. xml.
API AndroidManifest. xml.
, AndroidManifest. xml, .

8
Android SDK Emulator?
Android , , AndroidAPI.
Android Market.
.
IP- , -, .
, .

9
?
, .
.
3 , .
100, Google .
Google Android, , .

10
?
<?xml version=1.0 encoding=utf-8?>
<RelativeLayout
xmlns: android="http://schemas.android.com/apk/res/android"
android: id="@+id/relative1
android: layout_width=fill_parent
android: layout_height=fill_parent>
<TextView
android: id="@+id/text1
android: layout_width=fill_parent
android: layout_height=wrap_content
android: text=Text1
/>
<TextView
android: id="@+id/text2
android: layout_width=fill_parent
android: layout_height=wrap_content
android: text=Text2
/>
<LinearLayout
android: id="@+id/linear1
android: layout_width=fill_parent
android: layout_height=wrap_content
android: layout_below="@id/text1>
<TextView
android: id="@+id/text3
android: layout_width=fill_parent
android: layout_height=wrap_content
android: text=Text3
/>
</LinearLayout>
<LinearLayout
android: id="@+id/linear2
android: layout_width=fill_parent
android: layout_height=fill_parent>
<TextView
android: gravity=bottom
android: id="@+id/text4
android: layout_width=fill_parent
android: layout_height=fill_parent
android: text=Text4
/>
</LinearLayout>
</RelativeLayout>
4 , .
Text 2 , Text 1, .
4 , .
Text 4 relative1.
Text 3Text 4 , relative1.

11
, XML. (1)? (, res/layout/custom_dialog. xml, .)


dialog. getinflate (). inflate (R. layout. custom_dialog);
dialog. setLayout (R. layout. custom_dialog);
dialog. setContentView (R. layout. custom_dialog);
dialog. inflate (R. layout. custom_dialog);

12
Android :
++
VC++
Java

13
Android :
MP4
MPEG
AVI
MIDI

14
Android :
Bluetooth
Video calling

15
Android?
Apple
Google
AndroidInc.
Nokia

16
Android ?
Mobile Interpretive Compiler
Dex compiler
AIC
DIC

17
, , ?
.
.
.

18
values _______, .
XML
Image
Doc

19
Android /?
view
test
util
text

20
ANR?
Application not Recognized.
Android not Recognized.
Application not Responding.
.

21
Android alphabetic shortcuts :
setup()
setQwertyMode()
setContent()
setGroupCheckable()

22
_______ .
android: autoText
android: capitalize
android: digits
android: singleLine

23
APK?
Application package kit
Application package file
Android package kit
Android package file

24
Java ?
res/
assets/
src/
bin/

25
. dex?
Dalvik expansion
Dalvik extension
Dalvik executables

26
ContentProvider :
Cursor.commitUpdates()
ContentResolver. update()
updates()
commit()

27
Android , :
R. style
X. style
manifest. xml
application

28
JVM DVM Android?
JVM
JVM
JVM

29
Android :
Uri,MIME
MIME,HTTP
Uri,HTTP
Uri,FTP

30
UI ?
Services
Simulator
Emulator

31
user-permission :
Manifest. xml
Android. xml
AndroidManifest. xml

32
Android AWT Swing?

33
:
, .
.
.
.

34
_____ .
android: autoText
android: capitalize
android: digits
android: singleLine

35
Android :
JDK
SDK
ADK
MDK

36
Dex , :
Dalvik
Java
Android

37
?
web. xml
manifest. xml
string. xml
text. xml

38
Android .
IPB
IPC
PCB
PCI

39
res :
Java

40
?
ImageView
ImageButton
ImageView ImageButton

41
, :
android: padding
android: digits
android: capitalize
android: autoText

42
Android :
Eclipse
Java XML
Java SQL
Java PL/SQL

43
AAPT?
Android Asset PackagingTool
Application Asset PackagingTool
Android Application PackagingTool

44
?
findViewById()
getRootView()
getParentOfType()
getParent()

45
?
Starting
Paused
Running
Destroyed
Wait
Yield

46
Android?
InflateException
Surface. OutOfResourceException
SurfaceHolder. BadSurfaceTypeException
WindowManager. BadTokenException

47
Android , ?

48
Android?
WiFi

49
Android :
Android
SDK
JDK
winrunner

50
:
Service Provider
Content Provider
Application Provider
Resource Provider

4

Android?
AlertDialog
ProgressDialog
DatePickerDialog
TimePickerDialog
TextInputDialog

2
:

3
AIDL?
String
List
Map
Java
Handle object

4
NotificationManager :

5
AIDL?
Android Interface Data Language
Android Interface Definition Language
Application Interface Data Language
Application Interface Definition Language

6
, ?
StringsXML
Rfile
AndroidManifest
Layout file

7
ContentProvider :
insert()
bulkInsert()
update()
dump()

8
/C++ Android ?

9
Android:
Apache
Oracle
SQLite
MySQL

10
Android Dalvik executable?
SDK
JDK
Java source code
NET source code

11
/C++ :
SDK
JDK
NDK
MDK

12
Bluetooth Serial Port Profile (SPP) Android?

13
:
setup()
setIndicator()
onCreate()
onCreateOptionsMenu()

14
Android?
Object
Class
Android

15
ContentProvider, ?
Create
Read
Update
Delete

16
android: layout_alignParentTop :
Integer
Character
Float
Boolean

17
?

18
 Android :
Notification
NotificationManager
Note
Manager

19
?
res/
assets/
src/
bin/

20
Android ?
text
test
widget
app. admin

21
ExpandableListView :

22
SIP?
Session Initiation Protocol
Session Information Protocol
Server Initiation Protocol
Server Information Protocol

23
Android :
Device driver
Video driver
WiFi driver
Bluetooth driver

24
, , :
PackageManager. NameNotFoundException
Resources. NotFoundException
ParseException
FormatException

25
APK :
Dalvik executable
Java

26
, , :
Service
GUI
Activity
Application

27
TabSpec TabHost :
newTabSpec()
setContent()
setIndicator()
setup()

28
Android SDK Android.

29
View onDraw. ? (, 480× 320).


.


.


.


.


30
ADB?
Android Debug Bridge
Application Debug Bridge
Android Data Bridge
Application Data Bridge

31
BLOB?
Bytes Less Object
Binary Large Object
Binary Low Object
Bit Large Object

32
, Android?
Shared Preferences
Internal Storage
External Storage
SQLite
Network
Intermediate Storage

33
Android?
Toast
Notifications
Dialogs
Email

34
MTP PTP :
MtpConstants
MtpDevice
MtpDeviceInfo
MtpObjectInfo
MtpStorageInfo

35
, -:

36
Android?
Cupcake
Muffin
Honeycomb
Gingerbread

37
Java Android?

38
Android 3D API :
OpenGL
QuickDraw
OpenGLES
Opus

39
Eclipse AndroidSDK:
EMU
DDT
ADT
GDD

40
ADT :
Application Development Tools
Android Development Tools
Android Debugger Tools
Android DevelopmentTest

41
Android :
GDD
EMU
QEMU
AEMU

42
:
AppWidget
View Groups

43
?
Intent
Intent
Intent
Intent

44
Service:
.
,

45
Android ?

46
ViewGroup :
android. view. Viewgroup
View
, AndroidManifest. xml
android. view.View

47
?
Activity. findViewById
ListAdapter
ListAdapter ListView
android. test

48
AVD?
, .
, Android.
, Android ,

49
, Intent, , :

50
, App Widget App Widget:
onDisabled (Context)
onDeleted (Context, int[])
onReceive (Context, Intent)
onEnabled (Context)
onUpdate

5

, :
/res/layout
/res/strings
/res/arrays
/res/styles
/res/values

2
Dalvik VM :
Core Libraries
Libraries
Application
Kernel
Android Runtime

3
Content Provider :
Application
Core libraries
Application Framework
Kernel
Libraries

4
R. java?
- ViewGroups
-
,
-
-

5
RemoteView :
Viewlayout
LinearLayout
RelativeLayout
FrameLayout

6
Compound Button?
ON/OFF
: checked unchecked
Qwerty

7
View :
onCreate()
Activity. setServiceView()
Activity. setView()
android. app. Activity
Activity. setContentView()

8
Activity Service?
ApplicationContext
Component
Object
Application
Context

9
SimpleAdapter?
import android. widget;
import android. database;
import android. util;
import android. content;
import android. database. sqlite;

10
, , ?
import android. drivers;
import android. hardware. camera;
import android. util;
import android. camera;
import android. hardware;

11
, Android ?
ProgressItem
ProgressView
ProgressBar
requestWindowFeature
ProgressDialog

12
Context ?

13
getApplicationContext () ?
Application
AssetManager

14
setLevel :
Drawable. callback
Drawable
Color
Image
Bitmap

15
InputMethod?
, .
, UI.
, .
, , , .
, , .

16
, Android ?
Activity. onDestroy()
Activity. onStop()
Activity. onPause()
Activity. onShutdown()
Activity. onFreeze()

17
Android ?
Activity. onFinish()
Activity. onStop()
Activity. onDestroy()
Activity. onPause()
Activity. onFreeze()

18
?
menu. add (0, MENU_QUIT, 0, Quit). setIcon (R. drawable. menu_quit_icon);
Icon
Icon

19
Dialog :
TextBox
,
,

20
API touch?
View. TouchMode
View. app. Touch()
View. isInTouchMode()
View. TouchMode()
android. app. Touch()

21
?
shutdown()
finish()
finishService()
stop()
stopSelf()

22
NotesDbAdapter ?
SQLite, , .

23
?
Service. stopSelf()
Context. stopService()
StopSelf. Service()
Destroy()
StopService()

24
, , ?
startActivity. Return()
startActivityForResult()
ActivityForResult()
startActivity. Result()
getResult. Activity()

25
?
Intent callNumber = new Intent();
callNumber. setAction (android. content. Intent. ACTION_CALL);
callNumber. setData (Uri. parse (tel:9873719580″));
startActivity (callNumber);
9873719580
9873719580
9873719580
9873719580

26
TimePickerDialog :

27
?
onMenuItem
onMenuItemSelected
onMenuItemClicked
onOptionsItemSelected
CommandAction

28
, notifyPhoneCallState MyReceiver, , ?
public class MyReceiver extends PhoneStateIntentReceiver
{
@Override
public void onReceiveIntent (Context context, Intent intent)
{
if (intent. action == Intent. ACTION_CALL)
{
}
}
}

29
<Some code here>?

MediaPlayer mp = new MediaPlayer();
mp. setDataSource (PATH_TO_FILE);
<Some code here>
mp. start();

:
mp. prepare();
mp. prepareAsync();
mp. loadMedia();
mp. loadSource();
mp. prepare (); mp. loadSource();

30
<Some code here>?

@Override
protected void onStop
{
Super. onStop();
SharedPreferences setting = getSharedPreferences (MyPrefs,0);
SharedPreferences. Editor editor = settings. edit();
editor. putBoolean (MyBool, true);
<Some code here>}

:
editor. save (); editor. close();
editor. save (); editor. finish();
editor.commit();
editor. save();
editor. close();
editor. finish();

31
<MyElement xmlns:http://schemas.androd.com/apk/res/android
android: layout_width = fill_parent
android: layout_height = fill_parent
android: text = Some Text>
</MyElement>
XML ?
XML Android.
XML , View.
(.apk) Android.
xmlns: .
XML , xmlns:
MyElement , , , View.

32
, ?
APK

33
Expansion APK?

34
?
bindService
startService
runService
startActivity

35
, MyView , View MView MyView. MView Android-?
setCurrentView (mView) startApp () .
setContentView (mView) startApp () .
setContentView (mView) onStart () .
setContentView (mView) onCreate () .

36
Screen1 Android MYAndroid. Screen2 Screen1, ?
Screen2 MYAndroid.
Screen2 Android , .
Screen2 .
Screen2 .
Screen2 Screen1 startActivity.
Screen2 Screen1 startActivityForResult.

37
?
public boolean isOnline (){
ConnectivityManager connMgr = (ConnectivityManager) getSystemService (Context. CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr. getActiveNetworkInfo();
return (networkInfo!= null && networkInfo. isConnected());
}
WiFi
Bluetooth
Ethernet

38
?
SensorManager mgr = (SensorManager) getSystemService (SENSOR_SERVICE);
List <Sensor> sensors = mgr. getSensorList (Sensor. TYPE_ALL);
for (Sensor sensor: sensors){
System. out. println (+sensor. getName());
}
,

39
?
try{
String token = GoogleAuthUtil. getToken (this, email, https://www.googleapis.com/auth/devstorage.read_only);
System. out. println (token);
} catch (IOException e){
System. out. println (IOException);
} catch (UserRecoverableAuthException e){
System. out. println (UserRecoverableAuthException);
} catch (GoogleAuthException e){
System. out. println (GoogleAuthException);
}
UserRecoverableAuthException
GoogleAuthException
IOException

40
?
query (), insert (), update (), delete () .
CursorLoader
ContentResolver
ContentProvider
Loader

41
Android-activityCreator android create project?
Android.
unit Android .
Android.
Android - . class.
Android.

42
Android-dx?
Android.
unit Android .
Android.
Android - . class.
Android.

43
Android?
, .
IDE, .
, , .
, Google.

44
GCM Google Cloud Messaging?

45
AsyncTaskLoader AsyncTask?
-
,

46
, -?
Intent takePictureIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE);
startActivity (takePictureIntent);

Intent takePictureIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE);
if (takePictureIntent. resolveActivity (getPackageManager ())!= null){
startActivityForResult (takePictureIntent,1);

Intent takePictureIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE);
startActivityForResult (takePictureIntent,1);

Intent takePictureIntent = new Intent (MediaStore. ACTION_IMAGE_CAPTURE);
if (takePictureIntent. resolveActivity (getPackageManager ())!= null){
startActivityForResult (takePictureIntent, 1);

47
, GPS_PROVIDER SecurityException?
ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION
INSTALL_LOCATION_PROVIDER

48
Google Play , ?
<uses-feature android: name=android. hardware. camera/>
<uses-feature android: name=android. hardware. camera android: required=true/>
<uses-feature android: name=android. hardware. camera. front android: required=true/>
<uses-permission android: name=android. permission. CAMERA/>

49
Spannable ?
, .
, TextView.
, .
.

50
ListActivity ?
, .
, Android .
, Android .
, IntentFilter .

6

APK ( ) Google Play Store?
50MB
2GB
30MB

2
Google Play Store?
50MB
2GB
30MB

3
ContentProvider?
-.
.
Android.
.
.

4
4- ?
ApplicationInfo, SyncInfo, ActivityInfo, PackageInfo
:
ApplicationInfo
SyncInfo
ActivityInfo
PackageInfo

5
Android ?
Debug mode
Release mode
Production mode
Development mode

6
Bluetooth ?
Adapter
Manager
Matcher
BluetoothAdapter

7
/ Activity?
onCreateOptionsMenu / Android .
onPrepareOptionsMenu / Android .
onShowOptionsMenu / Android .
Android .

8
Intent. ACTION_CALL Intent. ACTION_DIAL?
.
Intent. action == Intent. ACTION_CALL , .
Intent. action = Intent. ACTION_CALL , , .
Intent. action = Intent. ACTION_DIAL , , .
Intent. action = Intent. ACTION_CALL , , .
Intent. action = Intent. ACTION_DIAL , , .

9
PhoneStateListener. onCallStateChanged?
PhoneStateListener. onCallStateChanged .
PhoneStateListener. onCallStateChanged , .
PhoneStateListener. onCallStateChanged .
PhoneStateListener. onCallStateChanged , .
PhoneStateListener. onCallStateChanged , .

10
?
startActivity startActivityForResults .
startActivity startActivityForResults .
startActivity , startActivityForResults .
startActivity , startActivityForResults .

11
?
startActivity startActivityForResult , .
startActivityForResult .
startActivity (myIntent); startActivityForResult (myIntent, 1); .
startActivity (myIntent); startActivityForResult (myIntent, 0); .
startActivity , , .
startActivityForResult , , .

12
, Android ?
TextBox
TextView
TextField
TextElement
EditText
RichText

13
requestWindowFeature?
FEATURE_NO_TITLE
FEATURE_NO_ICON
FEATURE_RIGHT_ICON
FEATURE_NO_MENU
FEATURE_TRANSPARENT_WINDOW

14
Android ?
adb install /path/to/apk , USB .
, .
IDE, USB .
.

15
Google Play Store ( )?
android: versionName
android: targetSdkVersion
android: maxSdkVersion
android: versionCode

16
PhoneNumberUtils?
.
.
.
.
.

17
SQL ListView Android ?
SimpleCursor
SimpleCursorAdapter
SimpleAdapter
SQLiteCursor
SQLLiteAdapter

18
Android ?
Binder
Flow
Navigate
Intent
ApplicationContext

19
, ?
Activity. onCreate
Activity. onCreateOptionsMenu
Activity
Activity. onCreateMenu
Activity. onStart
Activity. onPrepareOptionsMenu

20
- HTML Android ?
WebBrowser
BrowserView
WebView
Browser
HtmlView

21
?
SQLiteOpenHelper
SQLiteDatabase
ContentProvider
DatabaseHelper

22
Message Message?
tag
what
arg1
arg2
userData

23
-?
List <ProviderInfo> returnList = new ArrayList <ProviderInfo>();
for (PackageInfo pack: getPackageManager (). getInstalledPackages (PackageManager. GET_PROVIDERS)){
ProviderInfo [] providers = pack. providers;
if (providers!= null){
returnList. addAll (Arrays. asList (providers));
}
}
return returnList;

return getContext (). getPackageManager (). queryContentProviders (com. google, Process. myUid (),0);

List <ActivityInfo> returnList = new ArrayList <ActivityInfo>();
for (PackageInfo pack: getPackageManager (). getInstalledPackages (PackageManager. GET_RECEIVERS)){
ActivityInfo [] providers = pack. receivers;
if (providers!= null){
returnList. addAll (Arrays. asList (providers));
}
}
return returnList;


24
, ?
AsyncTask
IntentService
Sync adapters

25
, ?
onCreate
onInit
onCompleteThaw
onRestart

26
Content Provider?
Contacts
Shared Preferences
MediaStore
Bookmarks
Settings

27
, , Android NETWORK_PROVIDER GPS_PROVIDER?
Android :
<uses-permission android: name=android. permission. ACCESS_FINE_LOCATION/>
Android :
<uses-permission android: name=android. permission. ACCESS_FINE_LOCATION/>
<uses-permission android: name=android. permission. ACCESS_COARSE_LOCATION/>
Android :
<uses-permission android: name=android. permission. ACCESS_FINE_LOCATION/>
Android :
<uses-permission android: name=android. permission. CONTROL_LOCATION_UPDATES/>

28
Android , ?
MIDLet
AndroidApp
Activity
AppLet
Application

29
Android ?
Activity. onFreeze()
Activity. onPause()
Activity. onStop()
Activity. onDestroy()

30
Bluetooth Android ?
android. hardware
android. bluetooth
android. bluez
Org. bluez

31
GCM ?
com. google. android. c2dm. permission. RECEIVE
android. permission. INTERNET
android. permission. GET_ACCOUNTS
android. permission. WAKE_LOCK
applicationPackage +. permission. C2D_MESSAGE

com. google. android. c2dm. intent. RECEIVE, , applicationPackage. com. google. android. c2dm.SEND

32
?
INTERNET
ACCESS_NETWORK_STATE

33
APK?
package <manifest> .
pm list packages f ADB .
PackageManager Android .
AAPT , aapt dump badging apkName. apk.

34
Google GCM Connection?
HTTP
XMPP
SOAP
RMI

35
?

36
StrictMode?
StrictMode
StrictMode , UI
StrictMode

37
GoogleAuthUtil. getToken()?
getToken ()
getToken () AsyncTask

38
-?
- .
- AndroidManifest. xml.
.

39
Google Play?
android: versionCode APK .
android: versionCode APK .
android: versionCode APK .

40
Sync Adapter?
Sync Adapter .
Sync Adapter , , , , .
.

41
Android ?
.
.
, Android SDK build tools .
.

42
, APK?
ProGuard
zipalign
etc1tool
lint

43
Content Providers?
, -
,

44
Android :
8-
Windows

45
Drawable?
,
View

46
FreeType :
Application Framework
Applications
Linux kernel
Android Runtime
Libraries

47
FreeType :
JPEG
3D-

48
TableLayout :

49
ViewGroup draw ():

50
?
android.R
android. R. resource
android. R. resource-type. resource-name
android. resource_type
android. resource_name

7

?
,
,
, ,

2
:
Broadcast class
Receiver class
ApplicationBroadcast class
MessageBroadcast class
BroadcastReceiver class

3
JetPlayer ?

JET .
mp3.
MPEG .
JET .
.

4
Dalvik Opcode?
OP_ADD_LONG
OP_ADD_FLOAT
OP_GET_BYTE
OP_ADD_DOUBLE
OP_ADD_INT

5
, ?
PACKAGE_ADDED PACKAGE_REMOVED
PACKAGE_ADDED PACKAGE_REMOVED.
PACKAGE_ADDED PACKAGE_REMOVED
PACKAGE_ADDED PACKAGE_REMOVED
PACKAGE_ADDED PACKAGE_REMOVED

6
JPG- SD ImageView?
Bitmap.decodeFile()
BitmapFactory.decodeFile()
JPEGFactory.decodeFile()
GIFFactory.decodeFile()
JPG.decodeFile()

7
?
finishActivity()
shutdown()
stop()
finish()
stopSelf()

8
?
finishService()
shutdown()
stop()
finish()
stopSelf()

9
app. AlertDialog?
,
,
,

10
DateFormat?
/.
/.
/.
/.
/.

11
Relative Layout ViewGroup, :
View

12
MediaRecorder?
recorder = recorder. start();
recorder = new MediaRecorder();
recorder = recorder. Create();
recorder = recorder. prepare();
recorder = onCreate. MediaRecorder;

13
ImageButton ?
,

14
Android ?
Application .
Activity ( , ).
.
getBaseContext().
.
.

15
ANR?
.
AsyncTask .
Thread HandlerThread .
.

16
?
AsyncTask
Handler
Activity.runOnUiThread (Runnable)
View. post (Runnable)
View. postDelayed (Runnable, long)

17
Binder
Binder , IPC.
, BinderIPC.
, IPC, Binder IPC
, Binder, Android.

18
Thread Handler Thread Android?
Thread Looper Message Queue. Looper .
Handler Thread Looper MessageQueue, Looper .
. , HandlerThread Thread.
. , HandlerThread Thread.

19
?
Android , - . . , .
Android , - . . Android , , . .
Android , - . . Android , , . .
Android , . . , .

20
?
onStartCommand.
Intent Service.
nCreate().
onStartCommand AsyncTask .

21
startservice bindservice?
startservice , - . . bindservice , - . bindservice , .

startservice , - . startservice , . bindservice , - , , , , , .

startservice . bindservice , - .

startservice , , . bindservice , , , .

22
Activity Fragment? ?
Activity . Fragment , Activity.

. , , , .

, .

.

23
?
ListView, GridView, Spinner, ViewPager . AdapterView . .

AdapterView. OnItemClickListener.

.

.

24
View ?
View , .
LinearLayout.
<merge> <include>.
.

25
ViewHolder ? ? ?
ViewHolder View. findViewById().

View. findViewById () , ( ) , View .

JIT Android 2.2(Froyo), View. findViewById () .

ViewHolder , , Separation ofConcerns Principle Single Responsibility Principle.

View View View.

.

26
Dont Keep Activities?
Dev Tools App Immediately destroy activities , , onSaveInstanceState (Bundle) / onCreate (android. os. Bundle).

.

, .

.
.

27
:
Top Level View ( , , Action Bar , floating action button ).
Category View ( , , ).
Detail/Edit View ( , ).
.

28
:
Tabs
Fixed tabs
Scrollable tabs
Navigation drawer
Navigation drawer +tabs
Navigation in content
Nested navigation drawer
Nested navigation drawer +tabs
Expanding navigation drawer
Cascading navigation drawer
Spinners
Split ActionBar
Contextual ActionBar

29
Android?
Intent email = new Intent (Intent. ACTION_SEND);
email. setType (message/rfc822);
email. putExtra (Intent. EXTRA_EMAIL, new String [] {"info@skillgun.com});
email. putExtra (Intent. EXTRA_SUBJECT, Hi, This is a test mail..);
startActivity (Intent. createChooser (email, Choose an Email Client));

Intent email = new Intent (Intent. ACTION_EMAIL);
email. setType (message/rfc822);
email. putExtra (Intent. EMAIL, new String [] {"info@skillgun.com});
email. putExtra (Intent. SUBJECT, Hi, This is a test mail..);
startActivity (Intent. createChooser (email, Choose an Email Client));

Intent i= new Intent (Intent. ACTION_SEND);
i.setType (message/rfc822);
i.putExtra (Intent. EXTRA_EMAIL, new String[]{"info@skillgun.com});
i.putExtra (Intent. EXTRA_SUBJECT, test mail);
i.putExtra (Intent. EXTRA_TEXT, Did you get this mail? if so please reply back);
startActivity (Intent. createChooser (i, Send mail"));


30
HTTPClient Android?
connection management
authentication management
cookies management
.

31
HTTP Android ?
HttpGet .
HttpPost .
, , HttpGet .

32
HttpClient, Android ?
android. permission. INTERNET
android. permission. READ_CONTACTS
android. permission. FINE_LOCATION

33
HTTP-, ?
, IOException
, IOException
, CLientProtocolException

34
URL- HttpGet , Android ?
, IOException
, IOException
, CLientProtocolException

35
HttpClient?
httprequests (get/post).
httprequests (get/post) .

36
 RESTful API httpget () httppost () Android?
httpget () , URL.
httppost () , , URL.
httpget () , URL.
httppost () , , URL, .

37
httpclient. execute () ?
HttpResponse
HttpEntity
Boolean
void

38
JSONObject, JSONArray?
com. android. json
org. json
net. json
com. json

39
HTTPClient?
com. android. http. client
org. apache. http. client
org. http
om. http. client

40
XML xml , Android ?
XMLResource .
XMLPullParser .
layoutinflater XML , .

41
XMLPullparser?
XMLPullParser. START_DOCUMENT
XMLPullParser. START_TAG
XMLPullParser. START_TEXT
XMLPullParser. END_TAG

42
MapView ?
android. location
android. hardware
com. google. android. maps

43
MapView, :
MapActivity MapView com. google. android. maps. .
MapActivity MapView com. google. android. maps. . Google, md5 .
MapActivity MapView com. google. android. maps. . Google, md5 , .
, Android .

44
- , HTTPRequest, Android -?
HTTPEntity, HttpResponse.
HTTPEntity , .
HttpResponse, HTTPEntity.

45
?
AJAX
HTML

46
JSONObjects JSONArrays .
ontacts JSONArray JSONObject?
{
contacts:[
{
id: p001,
name: Satish,
email: "satish@gmail.com,
address: Bangalore,
gender: male,
phone:{
mobile: "+919740000000,
home: 0804164536x,
office: 0804144232x
}
}
]
}
:
2json objects, 1json array. contacts json array
3json objects, 1json array. contacts json object.
3json objects, 1json array. contacts json array.
2json objects, 1json array. contacts json object.

47
Satish?
{
contacts:[
{
id: p001,
name: Satish,
email: "satish@gmail.com,
address: Bangalore,
gender: male,
phone:{
mobile: "+919740000000,
home: 0804164536x,
office: 0804144232x
}
}
]
}
JSONObject root = new JSONObject (str);
JSONArray arr = root. getJSONArray (contacts);
String ph = arr. getJSONObject (0). getString (mobile);

JSONArray root = new JSONArray (str);
String ph = arr. getJSONObject (0). getJSONObject (phone). getString (mobile);

JSONObject root = new JSONObject (str);
JSONArray arr = root. getJSONArray (contacts);
String ph = arr. getJSONObject (0). getJSONObject (phone). getString (mobile);

JSONObject root = new JSONObject (str);
JSONObject obj= root. JSONObject (contacts);
String ph = obj. getJSONObject (phone). getString (mobile);

48
username?
{
id: 676248615,
name: Satish Reddy,
first_name: Satish,
last_name: Reddy,
link: "http://www.facebook.com/satish.ice",
username: satish. ice,
locale: en_US
}
JSONObject root = getJSONObject (str);
String name = root. getString (username);

JSONObject root = new JSONObject (str);
String name = root. getString (username);

JSON, JSON . JSON, . .

49
Android?
GPS , .
LocationManager LocationListener . requestLocationUpdates locationlistener locationmanager .
, onLocationChanged () locationlistner.
ACCESS_FINE_LOCATION ACCESS_COARSE_LOCATION .
.

50
SensorManager ?
Sensor s = new Sensor();
SensorManager s = new SensorManager (this);
SensorManager s = (SensorManager) getSystemService (Context. SENSOR_SERVICE);
Sensor s = (Sensor) getSystemService (Context. SENSOR_SERVICE);

8

?
sm = (SensorManager) getSystemService (Context. SENSOR_SERVICE);
List <Sensor> ls = sm. getSensorList (Sensor. TYPE_ALL);

, , , .
, , , .
, , Android.
.

2
, Y, Z .
: , Sensoreventlistener.
: , .
public void onSensorChanged (SensorEvent event){
}
event. x, event. y, event. z, .
event [0] , event [1] , event [2] z.
event. values [0] , event. values [1] , event. values [2] z.
.

3
(X, Y,Z)?
Accelerometer
GyroScope
Proximity sensor

4
?
Accelerometer
GyroScope
Proximity sensor
Magnetometer

5
?
Humidity sensor
GyroScope
Proximity sensor
Magnetometer

6
?
Accelerometer
GyroScope
Proximity sensor
Magnetometer

7
, , ?
Android .
, . .
.
.

8
? GPS?
.
WiFi , .
, . .
, GPS, , GPS, .

9
, ? ?
Network Provider WiFi.
Network Provider WiFi.
GPS.
Network Provider WiFi lastKnownLocation.

10
GPS ?
GPS , onProviderDisabled () .
GPS , onStatusChanged () .
, .

11
GPS , , , - . ?
, , onProviderEnabled () . .
onStatusChanged () AVAILABLE , .
onStatusChanged () TEMPORARILY_UNAVAILABLE , .
, , . , , .

12
, NETWORK_PROVIDER?
ACCESS_FINE_LOCATION
ACCESS_COARSE_LOCATION
.

13
GeoCoder ?
android. location
android. hardware
om. google. android. maps

14
, , ?
.

SMS, .

String locationProvider = LocationManager.NETWORK_PROVIDER;
Location lastKnownLocation = locationManager. getLastKnownLocation (locationProvider);

String locationProvider = LocationManager. GPS_PROVIDER
Location lastKnownLocation = locationManager. getLastKnownLocation (locationProvider);

15
Sensor?
android. kernel
android. hardware
android. sensor
ndroid. framework. sensor

16
, GPS, , WiFi ?
.
-, .
GPS.
lastKnownLocatoin .

17
Android?
small
normal
large
extra large
.

18
?
Activity
Content Provider
Services
Broadcast Receiver

19
, ? ?

20
Android ?
src, gen, bin, res, values
src, images, screens, designs
code, icons, libs, admin

21
?
dp (density independent pixels) .
drawable mdpi, hdpi, xhdpi, xxhdpi.
nine-patch .
, .
, , .
.

22
DVM JVM? Android DVM?
DVM , JVM, DVM .
Oracle Google JVM. Google DVM Android.
JVM , Android DVM.
JVM Java . Android Java, JVM. Android DVM.

23
versionCode versionName ?
.
. google play store.
.

24
Android ?

25
setContentView (R. layout. main) XML-?

26
Android?

27
?
. .
. .
, .

28
?
action
data, data type
ategory, extras

29
, ?
.
.
. 0 .

30
, ?
.
. 0 n
. , .

31
putExtra () setData()?
putExtra () setData () , .
setData () , . putExtra () .
setData () . putExtra () , .
, setData () putExtra () .

32
Broadcast , ?
.
BroadcastReceiverNotFoundException , .
, - .
, - .

33
, , - ?
, .
, - .
, .
, . .

34
, ?
.
activityNotFoundException , .
, - .
, - .

35
Android ?
Intent in= new Intent (); in. setAction (Intent. ACTION_DIAL); in. setData (Uri. parse (tel:12345)); startActivity (in);
Intent in= new Intent (); in. setAction (Intent. ACTION_CALL); in. setData (Uri. parse (tel:12345)); startActivity (in);
Intent in= new Intent (); in. setAction (Intent. ACTION_CALL); in. setData (12345); startActivity (in);
Intent in= new Intent (); in. setAction (Intent. ACTION_DIAL); in. setData (12345); startActivity (in);

36
intent, sticky intent pending intent?
Android; sticky intent Android ; pending intent , - , .
Android, Content Provider; sticky intent Android ; pending intent , - , .
Android, Content Provider; sticky intent Android ; pending intent , - , , .

37
Android?
Java
++
, ++ Java

38
Android ?
Java
++
, ++ Java

39
Android ?
Samsung
HTC
LG
Google

40
Android ?
Android Apache License
Android GPL .
Android , Apache, GPL .
Android , GPL, Apache.

41
Android?
Micro kernel
Monolithic kernel
Hybrid kernel

42
Android?
AndroidInc
Apple
Samsung
Google

43
. apk ?
. dex , , class .
. dex, , class , Java.
. dex, , Java.
. dex , , Java.

44
Android - ?
Internet Explorer
Google Chrome
WebKit
Safari

45
raw Android ?
assets.
MP3 assets R. java .
. xml.
.

46
Android?
8MB
16MB
32MB
64MB

47
SMS Android, ?
SmsManager s = SmsManager. getDefault();
s.sendTextMessage (9741200300, null,
Hi how are you?, null, null);

SmsManager s = SmsManager. getDefault();
s.sendTextMessage (null, 9741200300,
Hi how are you?, null, null);

SmsManager s = SmsManager. getDefault();
s.sendTextMessage (9741200300, 9741200300,
Hi how are you?, null, null);

SmsManager s = new SMSManager();
s.sendTextMessage (null, 9741200300,
Hi how are you?, null, null);

48
Android, xml.
<application>
<manifest>
<activity>
<uses-sdk>

49
rooting?
, Android, ( ).
rooting , Android , , Android .
rooting , , . rooting .
.

50
Android?
.
Eclipse, DDMS, , (), , , .
Android.

9

Android?
.
USB.
, Android SDK .
, OEM-.
.

2
Android?
1.5cupcake
1.6donut
2.0, 2.1eclair
2.2froyo
2.3.x ginger bread
3.x honey comb
4.0.x ice cream sandwitch
4.1jelley bean
4.2kitkat

1.5cupcake
1.6donut
2.0, 2.1eclair
2.2froyo
2.3.x ginger bread
3.x honey comb
4.0.x ice cream sandwitch
4.1, 4.2, 4.3jelley bean
4.4kitkat

1.5cupcake
1.6donut
2.0eclair
2.1, 2.2froyo
2.3.x ginger bread
3.x honey comb
4.0.x ice cream sandwitch
4.1, 4.2, 4.3jelley bean
4.4kitkat

1.5cupcake
1.6donut
2.0, 2.1eclair
2.2froyo
2.3.x ginger bread
3.x honey comb
4.0.x ice cream sandwitch
4.1, 4.2, 4.3jelley bean
4.4key lime pie

3
permission uses-permission Android?

permission uses-permission .
uses-permission , .
permission , , , .
.

4
AndroidSDK?
Android SDK , API, , , Android Android .
Android SDK JDK.
.

5
Android ?
, Android , . Android , .
Android , Android .
Android Android SDK . emulator. exe android-sdk\tools.
.

6
Android ?
Android Google, ( ).
, . Google .
Google.
. Android Device Manager https://www.google.com/android/devicemanager.
.
.

7
MODE_PRIVATE ?
, , . .
, , . .
, , . .
, , . .

8
?
getPreferences (MODE_PRIVATE);
getSharedPreferences (name, MODE_PRIVATE);
getSharedPreferences (name, MODE_WORLD_READABLE);
getSharedPreferences (name, MODE_WORLD_WRITABLE);

9
?
in. setAction (Intent. ACTION_GET_CONTENT);
in. setType (image/*);
startActivityForResult (in,1);
, .
, .
, URI .

10
Android?
empty process(5)
background process priority(4)
foreground process(1)
service process priority(3)

11
?
getPreferences (MODE_PRIVATE);
getPreferences (MODE_WORLD_READABLE);
getSharedPreferences (name, MODE_WORLD_READABLE);
.

12
this context getapplicationcontext?
, , , Application Context.
, , , this .
this , , ActivityName. this.
.

13
binder , ?
Binder
aidl
Messenger

14
service intentservice Android?

intentservice . startservice intentservice .
service . startservice .
service, nCreate (), onStartCommand () nDestroy().
IntentService onHandleIntent().
IntentService, , startservice.
service, stopSelf () stopService () .
UI IntentService onHandleIntent (), . ( ).
.

15
binder service Android?
- , binder service , .
bounded service started service.
onBind () , binder service.
serviceconnectionobject bind service, .

16
, ?
bindedservice
startedService
content provider
.

17
started service?
oncreate> onstart ()> onBind ()> onUnbind ()> onDestroy()
oncreate> onstart ()> onDestroy()
oncreate> onstartCommand ()> onBind ()> onUnbind ()> onDestroy()
oncreate> onstartCommand ()> onDestroy()

18
, , ?
service exported=false; service LocalServiceManager.
service LocalServiceManager.
service imported=false; service LocalServiceManager.
exported=false; service LocalServiceManager.

19
, ?
, .
, , , . , , , , Android . .
, . .
, .

20
?
, nreate, onstartcommand .
, nreate, onstartcommand . , .
, , .
, .

21
, - onHandleIntent () IntentService?
. IntentService.
, .
, . , . , .
.

22
?
, .
startForeground (int id, Notification notification);
startService (Intent intent)
.

23
binder service?
, .
, , aidl .
, , Messenger, .
Binder Parcel.

24
Binder?
Binder IPC , LinuxIPC.
Binder Parcels .
Binder , IPC .
Binder Parcels .

25
binder service, , ?
Binder .
Binder Messenger.
. aidl .
.

26
binder service?
bindservice () . .
onBind () , bindservice.
onServiceDisconnected () ServiceConnection , unbindeservice().
bindService () , . , .

27
bounded service, , Binder?
, Binder, , .
, Binder, , .
, Binder, , .
.

28
Binder Android?
Binder , .
Binder aidl, , .
Binder , .
.

29
extras intent-filter?
.
, extras .
, intent-filter extras .
intent-filter extras , .

30
Android?
XML, .
, .
.

31
Android?
SubMenu, OptionsMenu
SubMenu, DialogMenu, ContextMenu
SubMenu, OptionsMenu, ContextMenu
SubMenu, DialogMenu

32
getPreferences getSharedPreferences Android? Android , getpreferences () getsharedpreferences()?
getPreferences()
getSharedPreferences()
getPreferences (), , .
getSharedPreferences (), , .

33
, , . Gmail. ?
.
.
, , .
, , .

34
Android?
Android, -.
.
.

35
, ?
, , .
, , .
, , .
, , .

36
, Android, ACTION_CALL?
android. permission. CALL_PHONE
android. permission. DIAL_PHONE
Intent. permission. CALL_PHONE
intent. permission. DIAL_PHONE

37
Android? , ?
action test
category test
data test
.
action test, data test, category test.

38
, , ?
, - , .
, .

39
?
,
, .
, n .
, n .

40
, / ()?
getIntent().
getAction () .
getIntent (), getAction () .
getIntent (), getAction () . .

41
Android , , Gmail . ? ?
.
.
.
, .

42
?
heap
data segment
hard disk
stack

43
TextView Android?
, TextView t = new TextView (this);
, .
, TextView t = findViewById (R. id. textView1);
, TextView .

44
?
. xml, SD-.
. xml, .
data/data/preferences.

45
, getPreferences?
Default. xml
Settings. xml
<Activityname>.xml
Preferences. xml

46
-, , getWritabledatabase getReadabledatabase?
getReadableDatabase
getWritableDatabase
.

47
nCreate () ContentProvider ?
, - -.
, , -, .
, Android nCreate () - .
nCreate () , - DML -.

48
, ?
Content Provider
Internal Storage
SQLite Database
Shared Preferences

49
cursor. moveToNext()?
, , , .
, , , .
, , , .
, , , .

50
, , cursor. moveToNext()?
, .
-, , .
, cursorfactory, .
.

10

, ?
, Java .
.
. , , , .
, - , , , , .

2
getWritableDataBase () nCreate () ContentProvider?
, .
, , , .
getWritableDataBase () , .
getWritableDatabase () , , , , , .

3
, ContentProvider?
onCreate, insert, update, delete, query, getType.
onCreate () getType.
insert, update, delete, query.
.

4
android: authorities -?
. , - authority.
- Android, authorities, .
Android, -. URI, authorities , authorities -.
.

5
ContentProvider ContentResolver? ?
ContentProvider ContentResolver IPC, .
ContentProvider , ContentResolver.
sharedpreferences ContentProvider.

6
UriMatcher ContentProvider?
URI .
DNS, URL- IP-.
.

7
-, URI ?
, URI .
URI, , URI.
.
.

8
ContentProvider SQLite?
ContentProvider, , .
, , .
ContentProvider, , .
.

9
ContentProvider:
sharedpreferences

10
Content Provider?
Content Provider.
nCreate () Content Provider.
Content Provider .

11
-?

getContext () nCreate()
getApplicationContext () .
- , , .

12
Android :
?
Cursor c1= this. getContentResolver (). query(
ContactsContract. Contacts. CONTENT_URI, null, null, null, null);
if (c1!= null && c1.getCount ()>0)
{
c1.moveToNext();
String n = c1.getString (c1.getColumnIndex (Contacts. DISPLAY_NAME));

}
:
.
.
.
.

13
Android? ?
onCreate-> onStart () > onResume () > onPause () > onStop () > onDestroy().

onCreate-> onStart () > onRestoreInstanceState () > onResume () >
onSaveInstanceState () > onPause () > onStop () > onDestroy().

onCreate-> onStart () > onResume () > onStop () > onPause > onDestroy().

onCreate-> onStart () > onRestoreInstanceState () > onResume () >
onPause () > onSaveInstanceState () > onStop () > onDestroy().

14
nCreate, super. oncreate()?
.
.
.
.

15
nCreate () nStart () ? , ?
.
, supernotcalled.
, .
.

16
UI?
, .

17
, ?
startActivityOnResult()
startActivityForResult()
setResult()
startActivity()

18
, ?
onPause()
onStop()
onSaveInstanceState()

19
, ?
nPause()
nPause () > > nStop()
nPause () > > nStop () > nDestroy()
nPause () > > onSaveInstanceState()

20
, ?
nPause()
nPause () > > nStop () > nDestroy()
nPause () > > nStop()
onResume()

21
startactivityforresult (), . ?
RESULT_OK
RESULT_CANCELLED
RESULT_CRASH
RESULT_FINISH

22
Android?
, ,
,

23
Android ANR ( ). Android, .. ?
5
10
1
2

24
?
<intent-filter>
<action android: name=android. intent. action. MAIN/>
<category android: name=android. intent. category. LAUNCHER/>
</intent-filter>
<intent-filter>
<action android: name=Intent. MAIN/>
<category android: name=Category. LAUNCHER/>
</intent-filter>
<intent-filter>
<action android: name=android. intent. action. LAUNCHER/>
<category android: name=android. intent. category. MAIN/>
</intent-filter>

25
XML ? , XML ?
@Override
public void onCreate (Bundle savedInstanceState){
super. onCreate (savedInstanceState);
setContentView (R. layout. main);
}
@Override
public void onCreate (Bundle savedInstanceState){
super. onCreate (savedInstanceState);
Button b;
setContentView(b);
}
@Override
public void onCreate (Bundle savedInstanceState){
super. onCreate (savedInstanceState);
Button b = new Button (this);
setContentView(b);
}
@Override
public void onCreate (Bundle savedInstanceState){
super. onCreate (savedInstanceState);
Button b = findViewById (R. id. button1);
setContentView(b);
}

26
?
onStop()
onPause()
onSaveInstanceState()

27
nStop () ?
.
, onSaveInstanceState
, nStop
, nStop () .

28
persistent transient ?
, , .
, .
, , , , , .

29
, super. oncreate () nCreate () ?
.
.
, .
, .

30
this context getapplicationcontext? ?
, .
this , .
this , . , , this.

31
, ? , , ?
oncreate()
onstart()
onresume()
onsaveinstancestate()

32
nCreate () . onsaveinstancestate () configurationChanges?
, nPause().
, .
, .

33
, nReceive () , ; ?
service process priority(3)
empty process(5)
foreground process(1)
visible process(2)

34
BroadcastReceiver Android?
Android , .
.
.

35
?
.
.
.

36
, binder service? ?
, .
, , 10, .
.
, - , .

37
?
startService().
, .

38
?
BroadcastReceiver , 10. UI .
, 10. BroadcastReceiver UI .
BroadcastReceiver , 10. UI . , . , .
BroadcastReceiver , 10. UI . , . 10, .

39
, ?
<receiver>
<intent-filter>
<action android: name=android. intent. action. BOOT_COMPLETED/>
</intent-filter>
</receiver>
<receiver>
<intent-filter>
<action android: name=intent. action. BOOT_COMPLETED/>
</intent-filter>
</receiver>
<receiver>
<action android: name=intent. action. BOOT_COMPLETED/>
</receiver>
<broadcastreceiver>
<intent-filter>
<action android: name=intent. action. BOOT_COMPLETED/>
</intent-filter>
</broadcastreceiver>

40
sendbroadcast (), sendorderedbroadcast (), sendstickybroadcast()?
sendbroadcast () .
sendorderedbroadcast () .
sendstickybroadcast () .

sendbroadcast () , .
sendorderedbroadcast () . .
sendstickybroadcast () .

sendbroadcast () .
sendorderedbroadcast () . .
sendstickybroadcast () .

sendbroadcast () , .
sendorderedbroadcast () . .
sendstickybroadcast () .

41
Android?
onReceive()
onCreate () > onReceive()
onCreate () > onReceive () > onDestroy()
onReceive () > onDestroy()

42
?
Worker thread
Kernel thread
Main Thread
.

43
- , ? ?
, , .
, 10.
, .
.

44
?
.
registerReceiver.
.
, .

45
BATTERY_LOW ? sendbroadcast () sendstickybroadcast? ?
sendBroadCast (), sendstickybroadcast , , .
sendStickyBroadCast (), .
.
sendOrderedBroadcast (), .

46
? , .
AlarmManager set (), 2. .
AlarmManager set (), 2. , . .
AlarmManager set (), 2. , . .
AlarmManager set (), 2. , , , , Android .

47
, , ?
, .
.
.
.

48
, .
<uses-permission android: name=android. permission. RECEIVE_BOOT_COMPLETED> </uses-permission>
<receiver android: name=BroadcastReceiver>
<intent-filter>
<action android: name=android. intent. action. BOOT_COMPLETED> </action>
</intent-filter>
</receiver>

<receiver android: name=BroadcastReceiver>
<intent-filter>
<action android: name=android. intent. action. BOOT_COMPLETED> </action>
</intent-filter>
</receiver>

<uses-permission android: name=android. permission. RECEIVE_BOOT_COMPLETED> </uses-permission>
<receiver android: name=BroadcastReceiver>
<intent-filter>
<action android: name=Intent. BOOT_COMPLETED> </action>
</intent-filter>
</receiver>

<receiver android: name=BroadcastReceiver>
<intent-filter>
<action android: name=Intent. BOOT_COMPLETED> </action>
</intent-filter>
</receiver>

49
px, dp, dip sp?
px , dp , dip , sp .
px , dp , dip , sp .
px , dp , dip , sp .
px , dp , dip , sp .

50
android: gravity view?
, ///
, /// .
, ///.
, .

11

?
. .
. .
. .
. .

2
?
finish()
finishActivity (int requestcode)
kill()
.

3
?
onPause () > onSaveInstanceState () > onCreate () > onStart () > onRestoreInstanceState () > onResume().

onPause () > onSaveInstanceState () > onStop () > onCreate () > onStart () > onRestoreInstanceState () > onResume().

onPause () > onSaveInstanceState () > onStop () > onDestroy () > onCreate () > onStart () > onRestoreInstanceState () > onResume().

.

4
Android?
, .
.
.
.

5
nPause () ?
Android .
.
5.
10.

6
onRestart () ?
XML-
- , , .
- , , .
, .

7
?
, .
, .

8
, ?
onCreate (), onStart (), getView()
getCount (), getView (), getItem (), getItemId()
getView()
getView (), getCount()

9
Android?
Adapter.
ListAdapter.
Adapter BaseAdapter.
BaseAdapter.

10
Android?
.
.
ListView View.
.

11
adapterview? Android?
ListView adapterview, : ListView, TableLayout, spinner.
linear layout adapterview, : linear layout, relative layout, frame layout.
, . : ListView, ImageView, spinner, GridView, ..
, . : ListView, gallery, spinner, GridView, ..

12
, ?
, .
, .
, .
, . , , .

13
> > > > . , ?
onPause()
onStop()
onDestroy()
onResume()

14
Bundle? Bundle nCreate () ?
Bundle nCreate().
Bundle savedInstantceState.
Bundle restoredInstanceState.
Bundle , , startActivity().

15
Android?
Intent in= new Intent();
in. setType (image/*);
in. setAction (Intent. ACTION_GET_CONTENT);
startActivityForResult (in,0);

Intent in= new Intent();
in. setType (image/*);
in. setAction (Intent. ACTION_GET);
startActivityForResult (in,0);

Intent in= new Intent();
in. setType (image/*);
in. setAction (Intent. ACTION_PICK);
startActivityForResult (in,0);

Intent in= new Intent();
in. setType (*/*);
in. setAction (Intent. ACTION_GET);
startActivityForResult (in,0);

16
, , , , , nCreate () nStart () onResume () ?
onStart()
onCreate()
onResume()
.

17
, ?
nStop () , .
nStop () , .
nStop () , - .
nStop () , - . 5.

18
? , ?
Intent in= new Intent();
in. setAction (ACTION); //this should match with other activity intent-filter
in. setData (Uri. parse (uid, tech));
in. setData (Uri. parse (city, Bangalore));
in. setData (Uri. parse (pw, android));

Intent in= new Intent();
in. setAction (ACTION); //this should match with other activity intent-filter
in. putExtra (uid, tech);
in. putExtra (city, Bangalore);
in. putExtra (pw, android);

Intent in= new Intent();
in. setAction (ACTION); //this should match with other activity intent-filter
in. putExtra (tech);
in. putExtra (Bangalore);
in. putExtra (android);

Intent in= new Intent();
in. setAction (ACTION); //this should match with other activity intent-filter
in. putExtra (uid);
in. putExtra (city);
in. putExtra (pw);

19
Android?
Android .
Android, , .
. .
.

20
Android?
absolute layout
frame layout
relative layout
linear layout

frame layout
relative layout
linear layout
table layout

absolute layout
frame layout
relative layout
linear layout
table layout

21
? , , .
String path = c. getString (c. getColumnIndex(
MediaStore. MediaColumns. DATA));
File f = new File (path);
String abspath = f. getAbsolutePath();
Bitmap b = BitmapFactory.decodeFile (abspath);
, .
, , , bitmapfactory .
, , .
, , , .

22
Android?
.
, , , . , .
, (this), ApplicationContext. getApplicationContext().
.

23
Android?
, .
, .
. Android .
.

24
pending intent Android?
, Android .
, .
.

25
ViewGroup Layout?
ViewGroup . Layout ViewGroup.
Layout . ViewGroup Layout.
ViewGroup View, Layout ViewGroup.
ViewGroup Layout View.
.

26
Android?
Keyevents UI . , .
Keyevents UI . , , UI , .
Keyevents UI . , UI , .
Keyevents UI . , , UI , . , UI . Android system > Activity > Layout > View > programmer.

27
, , ?
foreground process(1)
service process priority(3)
empty process(5)
visible process(2)

28
, 2 , ?
foreground process(1)
service process priority(3)
empty process(5)
visible process(2)

29
, , ?
foreground process(1)
service process priority(3)
empty process(5)
visible process(2)

30
, , ?
foreground process(1)
service process priority(3)
empty process(5)
visible process(2)

31
?
public class UiprogramActivity extends Activity{
/** Called when the activity is first created.*/
Button b;
@Override
public void onCreate (Bundle savedInstanceState){
super. onCreate (savedInstanceState);
setContentView (R. layout. main);
b = (Button) findViewById (R. id. button1);
b.setOnClickListener (new OnClickListener (){
@Override
public void onClick (View v){
new Thread (){
public void run (){
b.setText (Hacked from other thread..);
} //CalledFromWrongThreadException
}.start();
}
});
}
}
, .
, . .
1, .
.

32
ImageView?
Matrix m=new Matrix();
imageView. setScaleType (ScaleType. MATRIX);
m.postRotate ((float) angle, pivX, pivY);
imageView. setImageMatrix(m);

final RotateAnimation rotateAnim = new RotateAnimation (0.0f, degree,
RotateAnimation. RELATIVE_TO_SELF, 0.5f,
RotateAnimation. RELATIVE_TO_SELF, 0.5f);
rotateAnim. setDuration(0);
rotateAnim. setFillAfter (true);
imgview. startAnimation (rotateAnim);

.

33
Android?
//make a folder &quot; pics&quot; to store pics taken by the camera using this
final String directory = Environment. getExternalStoragePublicDirectory (Environment. DIRECTORY_PICTURES) + &quot;/pics/&quot;;
File nd = new File (directory);
nd. mkdirs();

//what is the picture name?
String file = directory+&quot; myfile&quot;+&quot;.jpg&quot;;
File myFile = new File (file);
try{
myFile. createNewFile();
} catch (IOException e){}

Uri myUri = Uri. fromFile (myFile);

//prepare intent for starting camera
Intent in= new Intent (MediaStore. ACTION_IMAGE_CAPTURE);
in. putExtra (MediaStore. EXTRA_OUTPUT, myUri);

startActivityForResult (in,1);
//////////////////////////////////////////////////////////////////////
//make a folder &quot; pics&quot; to store pics taken by the camera using this
final String directory = Environment. getExternalStoragePublicDirectory (Environment. DIRECTORY_PICTURES) + &quot;/pics/&quot;;
File nd = new File (directory);
nd. mkdirs();

//what is the picture name?
String file = directory+&quot; myfile&quot;+&quot;.jpg&quot;;
File myFile = new File (file);
try{
myFile. createNewFile();
} catch (IOException e){}

Uri myUri = Uri. fromFile (myFile);

//prepare intent for starting camera
Intent in= new Intent (MediaStore. ACTION_CAMERA);
in. putExtra (MediaStore. EXTRA_OUTPUT, myUri);

startActivityForResult (in,1);
/////////////////////////////////////////////////////////////////////
.

34
Android?
Calendar cal = Calendar. getInstance();
SimpleDateFormat sdate = new SimpleDateFormat (dd-MMM-yyyy);
String date = sdate. format (cal. getTime());

Calendar cal = Calendar. getInstance();
int sec = c. get (Calendar. SECOND);

SimpleDateFormat dateFmt = new SimpleDateFormat (yyyyMMdd_HHmmss);
String date = dateFmt. format (new Date());

.

35
?
SQLite

 

2000

     →