• Save
Android part1
Upcoming SlideShare
Loading in...5
×
 

Android part1

on

  • 606 views

summer school daiict

summer school daiict

Statistics

Views

Total Views
606
Views on SlideShare
606
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Android part1 Android part1 Presentation Transcript

    • Android Development LabBy – Mr.Prajyot Mainkar ( @prajyotm)!
    • I Don’t Have Specific TalentI am just Passionately Curious…About Android !!
    • About Me
    • SOWHAT’s IN PLATEKEY TOPICSTopics   Time  Dura.on  Introduc)on   15  mins  Ge2ng  Started   15  mins  Android  app  Fundamentals   15  mins  User  Interface  and  Controls   60  mins  Working  with  Text  Controls   60  mins  Graphic  and  Styling   30mins  Employing  Selec)on  Widgets   30mins  
    • THE FLAVORSABOUT ANDROID OSSource : developer.android.com
    • JELLY BEAN FEATURESDOYOU KNOW ANY ?
    • A Little About Jelly Bean• Everything in Jelly Bean feels fast, fluid, and smooth.• More reactive and uniform touch responses. Boot up time 34compared to Nexus’s 54• improved performance throughout the system, includingfaster orientation changes, faster responses when switchingbetween recent apps• Introduction of PDK, Project Butter, Google Now and manymore features
    • GOOGLE NOW
    • TALK TO TEXT• It too allows natural queries, providesequally natural responses (much likeSiri), and the voice output sounds muchmore human-like than any other.• Improved both in accuracy and turnaround time• Understands Indian accent to muchlarger scale• No data connection required as wholevocabulary library is ember red withinJelly Bean
    • SMART APP UPDATES• Starting with Android 4.1 Jelly Bean,each paid app is encrypted with adevice specific key. Google hasenabled “smart updates” – basically,they only send the part of the APK filethat has changed, not the whole app allover again.• Saves time and bandwidth
    • PROJECT BUTTER• Frame rate for animation is not set at60FPS• Reduces touch latency not only bysync, but now VSync timing• Triple buffering in graphic pipeline formore constancy in rendering thatmakes smoother from scroll to pagingand animation
    • ACTIONABLE NOTIFICATIONS• The new notifications come packed with moreinformation and actions, enough to help youperform all essential tasks from within thenotification drawer, without having to actuallylaunch each individual app.• You will be able to drag down on a notificationwith two fingers to expand it for extra info andoptions• Disable Notifications for individual apps
    • ANDROID PDK• PDK is hardware equivalent of an SDK for manufactures• PDK is supposed to help manufacturer to make devices for latestversions of android before that version actually launches• Fragmentation - would be tackled
    • TYPE PREDICTION• Yes !! It serves are Mini-Swiftkey of Android• Accuracy is yet unknown, but certainly is betterthan default keyboard.
    • SMARTER HOME SCREEN• The JB home screen takes a page out of theiOS book with the addition of auto-arrange. Thisfeature will automatically arrange both icons andwidgets for you as you move them around andbetween different home screens.• For example, if you move a widget to a homescreen that doesn’t have enough space for it,the widget will be resized to fit within the emptyspace on said screen.
    • IMPROVED CAMERA APP• The Camera app has been improved to facilitate faster switching betweenthe camera viewfinder and captured photos.• You can swipe in from the right of the screen to jump to your capturedphotos and pinch to switch to a new film strip view, where you can quicklyswipe a photo up off the screen to delete it. Accidental deletes can beundone.
    • ANDROID BEAM• you will be able to tap two NFC-enabled Android devices together to sharephotos and videos as well.
    • CHOOSEWHICH SUITSApp Designed Using Local Resourcesand is mobile os centric  NATIVE APPLICATIONIntegrating app functionality with webdevelopment techniques  MOBILE WEB APPLICATIONWri)ng  minimal  na)ve  UI  and  loading  web  services  for  data  transmission  over  server  NATIVE & WEB APPLICATIONUsing  the  respec)ve  model  to  create  cross  na)ve   apps   that   works   on   all   intended  targets  CROSS PLATFORM DEV TOOLSTYPES OF APPS
    • FINDING THEWAYANDROID ECOSYSTEM• Eclipse• SDK• Android Plug-in For Android• Other Components and Platform Integration
    • APP DEVELOPMENTKICKSTART APP STRUCTUREDefault Activity Other ActivityLibrariesServicesContent ProvidersAndroid ManifestLayout Values AssetsDrawableIntent
    • SOMETHINGABOUT ANDROIDFacts That very Few KnowAndroid  is  a  soJware  stack  for  mobile  device  which  includes  OS,  middleware  and  key  component/features.Google,  Google  Services,  IDE’s  and  Programming.Google  has  many  acquisi)on  and  it  is  soon  making  into  Cloud  Arena  
    • THE KICKSTARTABOUT FIRST ANDROIDSeptember 2008
    • THE TEXTVIEWEXECUTING TEXTVIEWFeatures of Edittext boxElement  to  View  Text  on  GUI.  textStyle,  textColor  are  some  of  its  element  type.  Import  android.widget.EditText  <?xml version="1.0" encoding="utf-8"?><TextView xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="wrap_content"android:text=”I’m at Goa University"/>  
    • THE EDITWAYEXECUTING EDITTEXTFeatures of Edittext boxEditText  is  a  thin  veneer  over  textview  that  configures  itself  to  be  editable    Import  android.widget.EditText  <?xml version="1.0" encoding="utf-8"?><EditText xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/field"android:layout_width="fill_parent"android:layout_height="fill_parent"android:singleLine="false"/>  
    • THE EDITWAYEXECUTING EDITTEXTFeatures of Edittext boxpackage com.edittext;importandroid.app.Activity;importandroid.os.Bundle;import android.widget.EditText;public class EdittextActivity extends Activity{@Overridepublic void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState);setContentView(R.layout.main);EditText E=(EditText)findViewById(R.id.field);E.setText("Lets Have a Edit Text Demo.Have agreat day ahead. Cheers!");  
    • THE IMAGEVIEWEMPLOYING IMAGESFeatures of Edittext box<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><ImageViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="@string/hello"android:src="@drawable/img"/></LinearLayout>  
    • THE CHECK(BOX)UNDERSTANDING CHECKBOXAdvance Checkbox FunctionsisChecked()  is  a  func)on  that  is  use  to  check  if  the  checkbox  has  been  checked.  CompoundBuDon.OnCheckedChangeListener()  interface  defini)on  for  a  callback  to  be  invoked  when  the  checked  state  of  a  compound  buTon  is  changed  <?xml version="1.0" encoding="utf-8"?><CheckBox xmlns:android="http://schemas.android.com/apk/res/android"android:id="@+id/check"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="This checkbox is: unchecked" />  
    • THE CHECK(BOX)UNDERSTANDING CHECKBOXpackage com.CB;import android.app.Activity;import android.os.Bundle;import android.widget.CheckBox;import android.widget.CompoundButton;public class CheckboxActivity extends Activity implements CompoundButton.OnCheckedChangeListener {CheckBox cb;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);cb=(CheckBox)findViewById(R.id.check);cb.setOnCheckedChangeListener(this);}public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {if (isChecked) {cb.setText("This checkbox is: checked");}else {cb.setText("This checkbox is: unchecked");}}}  
    • THE BUTTONUNDERSTANDING BUTTONSimplicity UnleasedThere  are  2  simple  buTon  controls  for  use  within  your  layouts:    BuTon  (android.widget.BuTon)    ImageBuTon  (android.widget.ImageBuTon)  <ImageBuTon                    android:layout_width="wrap_content"                    android:layout_height="wrap_content"                    android:src="@drawable/skater"                    android:id="@+id/ImageBuTon01"                    android:layout_toRightOf="@+id/BuTon01"></ImageBuTon>    
    • THE BUTTONUNDERSTANDING BUTTONSimplicity Unleased<TextView android:layout_width="fill_parent"android:layout_height="wrap_content"android:text="@string/hello" /><Button android:id="@+id/button1"android:layout_height="wrap_content"android:text="Button 1"android:layout_weight="0.01"android:layout_width="96dp"/><Button android:id="@+id/button2"android:layout_height="wrap_content"android:text="Button 2"android:layout_weight="0.01"android:layout_width="97dp"/>  
    • THE BUTTONUNDERSTANDING BUTTONSimplicity Unleasedpackage com.Button;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class ButtonActivity extends Activity {public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);Button b1 = (Button) findViewById(R.id.button1);Button b2 = (Button) findViewById(R.id.button2);b1.setOnClickListener(new OnClickListener(){public void onClick(View v){Toast msg = Toast.makeText(getBaseContext(),"You haveclicked Button 1", Toast.LENGTH_LONG);msg.show();}});b2.setOnClickListener(new OnClickListener(){public void onClick(View v){Toast msg = Toast.makeText(getBaseContext(),"You haveclicked Button 2", Toast.LENGTH_LONG);msg.show();}});}}
    • THE RADIO BUTTONMONO SELECTSimple, yet effective<?xml version="1.0" encoding="utf-8"?><RadioGroupxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><RadioButton android:id="@+id/radio1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Session" /><RadioButton android:id="@+id/radio2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="In" /><RadioButton android:id="@+id/radio3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text=“My Department" /></RadioGroup>  My Department
    • THE TOGGLE BUTTONUNDERSTANDING ON/OFFExtension to Button via XML<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" ><ToggleButtonandroid:id="@+id/toggleButton2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:textOn="toggle_turn_on"android:textOff="toggle_turn_off"android:checked="true" /></LinearLayout>  
    • LINEAR LAYOUT CONCEPTVarious Linear Layout ParametersFill  Model  (  layout  :width  and  layout  :  height)    OrientaJon  (  Row  /  Colomn  )  Weight  (  How  are  the  spacing  between  two  widgets?)  Gravity(layout_gravity)  Padding(padding  leT,padding  right,padding  top,padding  boDom)  THE CONTAINERS
    • OTHER LAYOUT CONCEPTVarious Linear Layout ParametersRela.ve  Layout  Frame  Layout  Table  Layout  Absolute  Layout  
    • LINEAR LAYOUT<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent" ><RadioGroup android:id="@+id/orientation"android:orientation="horizontal"android:layout_width="wrap_content"android:layout_height="wrap_content"android:padding="5px"><RadioButtonandroid:id="@+id/horizontal"android:text="horizontal" /><RadioButtonandroid:id="@+id/vertical"android:text="vertical" /></RadioGroup><RadioGroup android:id="@+id/gravity"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="wrap_content"android:padding="5px"><RadioButtonandroid:id="@+id/left"android:text="left" /><RadioButtonandroid:id="@+id/center"android:text="center" /><RadioButtonandroid:id="@+id/right"android:text="right" /></RadioGroup></LinearLayout>
    • LINEAR LAYOUTpackage com.LinearLayout;import android.app.Activity;import android.os.Bundle;import android.view.Gravity;import android.widget.LinearLayout;import android.widget.RadioGroup;public class LinearLayoutActivity extends Activityimplements RadioGroup.OnCheckedChangeListener {RadioGroup orientation;RadioGroup gravity;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);orientation=(RadioGroup)findViewById(R.id.orientation);orientation.setOnCheckedChangeListener(this);gravity=(RadioGroup)findViewById(R.id.gravity);gravity.setOnCheckedChangeListener(this);}public void onCheckedChanged(RadioGroup group, intcheckedId) {switch (checkedId) {case R.id.horizontal:orientation.setOrientation(LinearLayout.HORIZONTAL);break;case R.id.vertical:orientation.setOrientation(LinearLayout.VERTICAL);break;case R.id.left:gravity.setGravity(Gravity.LEFT);break;case R.id.center:gravity.setGravity(Gravity.CENTER_HORIZONTAL);break;case R.id.right:gravity.setGravity(Gravity.RIGHT);break;}}}
    • THE OUTPUT
    • LET’s MERGE<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="wrap_content"android:padding="5px"><TextView android:id="@+id/label"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Name"android:layout_alignBaseline="@+id/entry"android:layout_alignParentLeft="true"/><EditTextandroid:id="@id/entry"android:layout_width="fill_parent"android:layout_height="wrap_content"android:layout_toRightOf="@id/label"android:layout_alignParentTop="true"/><Buttonandroid:id="@+id/ok"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_below="@id/entry"android:layout_alignRight="@id/entry"android:text="OK" /><Buttonandroid:id="@+id/cancel"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_toLeftOf="@id/ok"android:layout_alignTop="@id/ok"android:text="Cancel" /></RelativeLayout>  
    • NOW,CHECK THE OUTPUT
    • SCROLL AND COLOR BACKGROUND<?xml version="1.0" encoding="utf-8"?><ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="wrap_content"><TableLayoutandroid:layout_width="fill_parent"android:layout_height="fill_parent"android:stretchColumns="0"><TableRow><Viewandroid:layout_height="80px"android:background="#ffffaa"/><TextView android:text="#ffffaa"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow><TableRow><Viewandroid:layout_height="80px"android:background="#884400" /><TextView android:text="#884400"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow><TableRow><Viewandroid:layout_height="80px"android:background="#ffffff" /><TextView android:text="#ffffff"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow><TableRow><Viewandroid:layout_height="80px"android:background="#aa8844" /><TextView android:text="#aa8844"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow><TableRow><Viewandroid:layout_height="80px"android:background="#ffaa88" /><TextView android:text="#ffaa88"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow>
    • LET’s MERGE<TableRow><Viewandroid:layout_height="80px"android:background="#ffffaa" /><TextView android:text="#ffffaa"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow><TableRow><Viewandroid:layout_height="80px"android:background="#aa8844" /><TextView android:text="#aa8844"android:paddingLeft="4px"android:layout_gravity="center_vertical" /></TableRow></TableLayout></ScrollView>
    • LETS USE FLIPPER<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent"><Button android:id="@+id/flip_me"android:layout_width="fill_parent"android:layout_height="wrap_content"android:text="Check This Out!!"/><ViewFlipper android:id="@+id/details"android:layout_width="fill_parent"android:layout_height="fill_parent"><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:textStyle="bold"android:textColor="#FFFF0000"android:text="Thank you one and all"/><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:textStyle="bold"android:textColor="#FF00FF00"android:text="For Joining in"/><TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:textStyle="bold"android:textColor="#FFFFFF33"android:text="For This Android Workshop"/></ViewFlipper></LinearLayout>
    • LETS USE FLIPPERpackage com.flipper;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.ViewFlipper;public class FlipperActivity extends Activity {ViewFlipper flipper;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);flipper=(ViewFlipper)findViewById(R.id.details);Button btn=(Button)findViewById(R.id.flip_me);btn.setOnClickListener(new View.OnClickListener() {public void onClick(View view) {flipper.showNext();}});}}
    • FONTSADDING EXTRA FLAVOR<?xml version="1.0" encoding="utf-8"?><TableLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:stretchColumns="1"><TableRow><TextViewandroid:text="sans:"android:layout_marginRight="4px"android:textSize="20sp"/><TextViewandroid:id="@+id/sans"android:text="Hello, Goa!"android:typeface="sans"android:textSize="20sp"/></TableRow>
    • FONTSADDING EXTRA FLAVOR<TableRow><TextViewandroid:text="serif:"android:layout_marginRight="4px"android:textSize="20sp"/><TextViewandroid:id="@+id/serif"android:text="Hello, Goa!"android:typeface="serif"android:textSize="20sp"/></TableRow><TableRow><TextViewandroid:text="monospace:"android:layout_marginRight="4px"android:textSize="20sp"/>
    • ABOUT THE CLUBANDROCIDGoa’s Only ANDROID CLUBandIndia’s Only Android Community Blogwww.gaug.inwww.androcid.com
    • GET IN TOUCHCONTACT USAddress: SPM Softwares & Designers, Zarina Towers,St.Inez,Panaji GoaPhone: +91-9822987513Email: prajyotm@msn.comhttp://facebook.com/prajyotmainkarhttp://twitter.com/prajyotmhttp://linkedin.com/in/prajyotm+ Prajyot Mainkar