SlideShare uma empresa Scribd logo
1 de 31
Android application
development basics
     Anton Narusberg
Hello, I’m Anton.

• Developer since 2006
• Android developer since 2010
• Partner at Cannedapps
Topics

• Getting up and running with Android SDK
• "Hello World!"
• Deeper dive into Android application
  components
Android SDK
• Speed, Power, Control
• Standardized user experience
• Ability to be on the edge
• Integration
Getting started

• Java Development Kit (JDK)
• IDE (Eclipse recommended)
• Android SDK
• Android Development Tools (ADT)
ADT plugin for Eclipse
• SDK Tools Integration
• Code Editors
• Layout Refactoring Support
• Android Virtual Devices Manager
• DDMS
• ...
more at http://developer.android.com/guide/developing/tools/adt.html
“Hello eSport!”
Android application
         components

• Activity
• Layouts & Views
• Service
• Intent
• AndroidManifest.xml
Activity
Activity
UI concept that represents a single screen on your app
Activity
UI concept that represents a single screen on your app




DashboardActivity                TrainingActivity
Activity lifecycle
DashboardActivity
public class DashboardActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.dashboard);

        preferences = PreferenceManager.getDefaultSharedPreferences(this);

        initViews();
        initShadows();
        attachEvents();
    }

    @Override
    protected void onResume() {
      shadower.turnOn();
      super.onResume();
    }

    @Override
    protected void onPause() {
      shadower.turnOff();
      super.onPause();
    }

    ....

}
Dashboard layout
Dashboard layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="@drawable/background_gradient">

  <ImageView
    android:layout_width="40dp"
    android:layout_height="36dp"
    android:layout_marginTop="18dp"
    android:layout_marginLeft="15dp"
    android:background="@drawable/logo_run"/>



  <RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="170dp"
    android:layout_alignParentBottom="true">

    <ImageView
      android:id="@+id/dashboard_history_button_shadow"
      android:layout_width="100dp"
      android:layout_height="97dp"
      android:layout_marginLeft="110dp"
      android:background="@drawable/menu_history_shadow"/>

    <Button
      android:id="@+id/dashboard_history_button"
      android:layout_width="100dp"
      android:layout_height="97dp"
      android:layout_marginLeft="110dp"
      android:background="@drawable/menu_history"/>

    .......

  </RelativeLayout>

</RelativeLayout>
Service
Background process that can run for a long time
Service
Background process that can run for a long time
Binding the Service from Activity
public class TrainingActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate();
      Intent intent = new Intent(this, RunningSessionService.class);
      bindService(intent, sessionConnection, BIND_AUTO_CREATE);
    }

    @Override
    protected void onDestroy() {
      unbindService(sessionConnection);
      super.onDestroy();
    }

    private ServiceConnection sessionConnection = new ServiceConnection() {

         public void onServiceDisconnected(ComponentName name) {}

         public void onServiceConnected(ComponentName name, IBinder serviceBinding) {
           RunningSessionService.SessionBinder binding = (RunningSessionService.SessionBinder) serviceBinding;
           session = binding.getService();
         }
    };

    public void onStartTrackingClicked() {
      if (session != null) {
        session.startTracking();
      }
    }

}
Binding the Service from Activity
public class RunningSessionService extends Service {

    @Override
    public void onCreate() {
      super.onCreate();
      init();
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {}

    @Override
    public void onDestroy() {}

    @Override
    public IBinder onBind(Intent intent) {
      binding = new SessionBinder(this);
      return binding;
    }

    @Override
    public boolean onUnbind(Intent intent) {
      stopSelf();
      return super.onUnbind(intent);
    }

    public void startTracking() {
      ...
    }

    public void stopTracking() {
      ...
    }
}
Intent


•   An "intention" to do some work:

    •   Broadcast a message

    •   Start a Service

    •   Launch an Activity

    •   Display a web page or a list of contacts

    •   dial a phone nr. or answer a call

    •   etc.
Launching next Activity with an Intent




DashboardActivity         TrainingActivity
Intent
public class DashboardActivity extends Activity {

    private void initViews() {
      runButton = (Button) findViewById(R.id.dashboard_run_button);
      historyButton = (Button) findViewById(R.id.dashboard_history_button);
    }

    private void attachEvents() {
      runButton.setOnClickListener(new View.OnClickListener() {

          public void onClick(View v) {
            Intent intent = new Intent(DashboardActivity.this, SelectTrackActivity.class);
            startActivity(intent);
          }
        });

        ...

    }

    ...

}
AndroidManifest.xml
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.cannedapps.runner"
  android:versionCode="1"
  android:versionName="1.0">

  <uses-sdk android:minSdkVersion="3"/>

  <application
    android:name="Runner"
    android:label="@string/app_name"
    android:icon="@drawable/ic_launcher_run"
    android:theme="@android:style/Theme.NoTitleBar">

    <activity
      android:name="DashboardActivity"
      android:label="@string/app_name"
      android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name=".SettingsActivity"/>
    <activity
      android:name="TracksActivity"
      android:screenOrientation="portrait"/>
      ...

    <service android:enabled="true" android:name=".tracking.RunningSessionService"/>
  </application>

  <uses-permission   android:name="android.permission.INTERNET"/>
  <uses-permission   android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission   android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission   android:name="android.permission.WAKE_LOCK"/>

</manifest>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.cannedapps.runner"
  android:versionCode="1"
  android:versionName="1.0">

  <uses-sdk android:minSdkVersion="3"/>

  <application
    android:name="Runner"
    android:label="@string/app_name"                                                   Describe Activities & Services
    android:icon="@drawable/ic_launcher_run"
    android:theme="@android:style/Theme.NoTitleBar">

    <activity
      android:name="DashboardActivity"
      android:label="@string/app_name"
      android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name=".SettingsActivity"/>
    <activity
      android:name="TracksActivity"
      android:screenOrientation="portrait"/>
      ...

    <service android:enabled="true" android:name=".tracking.RunningSessionService"/>
  </application>
                                                                                           Describe Permissions
  <uses-permission   android:name="android.permission.INTERNET"/>
  <uses-permission   android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission   android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission   android:name="android.permission.WAKE_LOCK"/>

</manifest>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"                        General setup
  package="com.cannedapps.runner"
  android:versionCode="1"
  android:versionName="1.0">

  <uses-sdk android:minSdkVersion="3"/>

  <application
    android:name="Runner"
    android:label="@string/app_name"                                                   Describe Activities & Services
    android:icon="@drawable/ic_launcher_run"
    android:theme="@android:style/Theme.NoTitleBar">

    <activity
      android:name="DashboardActivity"
      android:label="@string/app_name"
      android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name=".SettingsActivity"/>
    <activity
      android:name="TracksActivity"
      android:screenOrientation="portrait"/>
      ...

    <service android:enabled="true" android:name=".tracking.RunningSessionService"/>
  </application>
                                                                                           Describe Permissions
  <uses-permission   android:name="android.permission.INTERNET"/>
  <uses-permission   android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission   android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission   android:name="android.permission.WAKE_LOCK"/>

</manifest>
Publishing to the Market

1. Sign up at https://market.android.com/publish
     - 25$ fee

2. Prepare your application Package
    - Test it
    - Build it
    - Sign it

3. Upload promotional material

4. Publish
Questions?

   Anton Narusberg
anton@cannedapps.com
   @antonnarusberg
Resources
Android resources
http://developer.android.com


Android Developers Google group
http://groups.google.com/group/android-developers


Online Tutorials
http://anddev.org
Community

           Tallinn Android Developers




http://www.meetup.com/Tallinn-Android-Developers/

Mais conteúdo relacionado

Mais procurados

Basic android development
Basic android developmentBasic android development
Basic android development
Upanya Singh
 
Android application development workshop day1
Android application development workshop   day1Android application development workshop   day1
Android application development workshop day1
Borhan Otour
 

Mais procurados (20)

Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017Android - From Zero to Hero @ DEVit 2017
Android - From Zero to Hero @ DEVit 2017
 
Basic android development
Basic android developmentBasic android development
Basic android development
 
Android development orientation for starters v2
Android development orientation for starters v2Android development orientation for starters v2
Android development orientation for starters v2
 
04 user interfaces
04 user interfaces04 user interfaces
04 user interfaces
 
The Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDKThe Glass Class - Tutorial 3 - Android and GDK
The Glass Class - Tutorial 3 - Android and GDK
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Android Development
Android DevelopmentAndroid Development
Android Development
 
Generating efficient APK by Reducing Size and Improving Performance
Generating efficient APK by Reducing Size and Improving PerformanceGenerating efficient APK by Reducing Size and Improving Performance
Generating efficient APK by Reducing Size and Improving Performance
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Ppt 2 android_basics
Ppt 2 android_basicsPpt 2 android_basics
Ppt 2 android_basics
 
Android Components
Android ComponentsAndroid Components
Android Components
 
Five android architecture
Five android architectureFive android architecture
Five android architecture
 
Android application development workshop day1
Android application development workshop   day1Android application development workshop   day1
Android application development workshop day1
 
Ch2 first app
Ch2 first appCh2 first app
Ch2 first app
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
Android xml-based layouts-chapter5
Android xml-based layouts-chapter5Android xml-based layouts-chapter5
Android xml-based layouts-chapter5
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
Android architecture
Android architecture Android architecture
Android architecture
 
Android In A Nutshell
Android In A NutshellAndroid In A Nutshell
Android In A Nutshell
 

Semelhante a Android app development basics

Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
Spike Brehm
 

Semelhante a Android app development basics (20)

android level 3
android level 3android level 3
android level 3
 
Android Workshop
Android WorkshopAndroid Workshop
Android Workshop
 
Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics Angular server side rendering - Strategies & Technics
Angular server side rendering - Strategies & Technics
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Android classes in mumbai
Android classes in mumbaiAndroid classes in mumbai
Android classes in mumbai
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Invading the home screen
Invading the home screenInvading the home screen
Invading the home screen
 
Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015 Android por onde começar? Mini Curso Erbase 2015
Android por onde começar? Mini Curso Erbase 2015
 
Gradle for Android Developers
Gradle for Android DevelopersGradle for Android Developers
Gradle for Android Developers
 
Mini curso Android
Mini curso AndroidMini curso Android
Mini curso Android
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 
Android Froyo
Android FroyoAndroid Froyo
Android Froyo
 
Android N Highligts
Android N HighligtsAndroid N Highligts
Android N Highligts
 
Data binding 入門淺談
Data binding 入門淺談Data binding 入門淺談
Data binding 入門淺談
 
Android in practice
Android in practiceAndroid in practice
Android in practice
 
Native Android Development Practices
Native Android Development PracticesNative Android Development Practices
Native Android Development Practices
 
Introducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and serverIntroducing Rendr: Run your Backbone.js apps on the client and server
Introducing Rendr: Run your Backbone.js apps on the client and server
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
 

Último

Último (20)

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

Android app development basics

  • 2. Hello, I’m Anton. • Developer since 2006 • Android developer since 2010 • Partner at Cannedapps
  • 3. Topics • Getting up and running with Android SDK • "Hello World!" • Deeper dive into Android application components
  • 5. • Speed, Power, Control • Standardized user experience • Ability to be on the edge • Integration
  • 6. Getting started • Java Development Kit (JDK) • IDE (Eclipse recommended) • Android SDK • Android Development Tools (ADT)
  • 7. ADT plugin for Eclipse • SDK Tools Integration • Code Editors • Layout Refactoring Support • Android Virtual Devices Manager • DDMS • ... more at http://developer.android.com/guide/developing/tools/adt.html
  • 9. Android application components • Activity • Layouts & Views • Service • Intent • AndroidManifest.xml
  • 11. Activity UI concept that represents a single screen on your app
  • 12. Activity UI concept that represents a single screen on your app DashboardActivity TrainingActivity
  • 14. DashboardActivity public class DashboardActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.dashboard); preferences = PreferenceManager.getDefaultSharedPreferences(this); initViews(); initShadows(); attachEvents(); } @Override protected void onResume() { shadower.turnOn(); super.onResume(); } @Override protected void onPause() { shadower.turnOff(); super.onPause(); } .... }
  • 16. Dashboard layout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background_gradient"> <ImageView android:layout_width="40dp" android:layout_height="36dp" android:layout_marginTop="18dp" android:layout_marginLeft="15dp" android:background="@drawable/logo_run"/> <RelativeLayout android:layout_width="fill_parent" android:layout_height="170dp" android:layout_alignParentBottom="true"> <ImageView android:id="@+id/dashboard_history_button_shadow" android:layout_width="100dp" android:layout_height="97dp" android:layout_marginLeft="110dp" android:background="@drawable/menu_history_shadow"/> <Button android:id="@+id/dashboard_history_button" android:layout_width="100dp" android:layout_height="97dp" android:layout_marginLeft="110dp" android:background="@drawable/menu_history"/> ....... </RelativeLayout> </RelativeLayout>
  • 17. Service Background process that can run for a long time
  • 18. Service Background process that can run for a long time
  • 19. Binding the Service from Activity public class TrainingActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(); Intent intent = new Intent(this, RunningSessionService.class); bindService(intent, sessionConnection, BIND_AUTO_CREATE); } @Override protected void onDestroy() { unbindService(sessionConnection); super.onDestroy(); } private ServiceConnection sessionConnection = new ServiceConnection() { public void onServiceDisconnected(ComponentName name) {} public void onServiceConnected(ComponentName name, IBinder serviceBinding) { RunningSessionService.SessionBinder binding = (RunningSessionService.SessionBinder) serviceBinding; session = binding.getService(); } }; public void onStartTrackingClicked() { if (session != null) { session.startTracking(); } } }
  • 20. Binding the Service from Activity public class RunningSessionService extends Service { @Override public void onCreate() { super.onCreate(); init(); } @Override public int onStartCommand(Intent intent, int flags, int startId) {} @Override public void onDestroy() {} @Override public IBinder onBind(Intent intent) { binding = new SessionBinder(this); return binding; } @Override public boolean onUnbind(Intent intent) { stopSelf(); return super.onUnbind(intent); } public void startTracking() { ... } public void stopTracking() { ... } }
  • 21. Intent • An "intention" to do some work: • Broadcast a message • Start a Service • Launch an Activity • Display a web page or a list of contacts • dial a phone nr. or answer a call • etc.
  • 22. Launching next Activity with an Intent DashboardActivity TrainingActivity
  • 23. Intent public class DashboardActivity extends Activity { private void initViews() { runButton = (Button) findViewById(R.id.dashboard_run_button); historyButton = (Button) findViewById(R.id.dashboard_history_button); } private void attachEvents() { runButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(DashboardActivity.this, SelectTrackActivity.class); startActivity(intent); } }); ... } ... }
  • 25. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.cannedapps.runner" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="3"/> <application android:name="Runner" android:label="@string/app_name" android:icon="@drawable/ic_launcher_run" android:theme="@android:style/Theme.NoTitleBar"> <activity android:name="DashboardActivity" android:label="@string/app_name" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".SettingsActivity"/> <activity android:name="TracksActivity" android:screenOrientation="portrait"/> ... <service android:enabled="true" android:name=".tracking.RunningSessionService"/> </application> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> </manifest>
  • 26. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.cannedapps.runner" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="3"/> <application android:name="Runner" android:label="@string/app_name" Describe Activities & Services android:icon="@drawable/ic_launcher_run" android:theme="@android:style/Theme.NoTitleBar"> <activity android:name="DashboardActivity" android:label="@string/app_name" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".SettingsActivity"/> <activity android:name="TracksActivity" android:screenOrientation="portrait"/> ... <service android:enabled="true" android:name=".tracking.RunningSessionService"/> </application> Describe Permissions <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> </manifest>
  • 27. AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" General setup package="com.cannedapps.runner" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="3"/> <application android:name="Runner" android:label="@string/app_name" Describe Activities & Services android:icon="@drawable/ic_launcher_run" android:theme="@android:style/Theme.NoTitleBar"> <activity android:name="DashboardActivity" android:label="@string/app_name" android:screenOrientation="portrait"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".SettingsActivity"/> <activity android:name="TracksActivity" android:screenOrientation="portrait"/> ... <service android:enabled="true" android:name=".tracking.RunningSessionService"/> </application> Describe Permissions <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.WAKE_LOCK"/> </manifest>
  • 28. Publishing to the Market 1. Sign up at https://market.android.com/publish - 25$ fee 2. Prepare your application Package - Test it - Build it - Sign it 3. Upload promotional material 4. Publish
  • 29. Questions? Anton Narusberg anton@cannedapps.com @antonnarusberg
  • 30. Resources Android resources http://developer.android.com Android Developers Google group http://groups.google.com/group/android-developers Online Tutorials http://anddev.org
  • 31. Community Tallinn Android Developers http://www.meetup.com/Tallinn-Android-Developers/

Notas do Editor

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. \n
  14. \n
  15. \n
  16. \n
  17. \n
  18. \n
  19. \n
  20. \n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n