• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
First Steps in Android Development with Eclipse and Xamarin
 

First Steps in Android Development with Eclipse and Xamarin

on

  • 1,089 views

Presentation from the Toronto TechHub user group on Android development. Introducing basic development concepts with Eclipse and then switching to Xamarin.Android and Visual Studio.

Presentation from the Toronto TechHub user group on Android development. Introducing basic development concepts with Eclipse and then switching to Xamarin.Android and Visual Studio.

Statistics

Views

Total Views
1,089
Views on SlideShare
1,077
Embed Views
12

Actions

Likes
1
Downloads
10
Comments
0

2 Embeds 12

http://lanyrd.com 11
http://www.slideee.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

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
  • Folders structure:Src – hold all the source filesGen – holds auto-generated filesRes – holds the resources of the application. Subfolders (like drawable-*) holds graphics optimized for different resolutionsRes/layout – holds the layout definition XML filesRes/values – holds XML files with predefined values, such as string resource dictionaries, constants, etc.Android (2.3.3) – holds a reference to JAR file with Android APIsReference Libraries/”MyLibrary” holds a reference to 3rd party libraries and JARs referenced in the projectAsses – holds other static application’s assets which will be deployed onto deviceAndroidManifest.xml – application manifest file describing the application being built and what components—activities, services, etc.—are being supplied by that application Res folder can hold additional directories such as menu, raw, xml with XML-based specifications of various parts of the application.

First Steps in Android Development with Eclipse and Xamarin First Steps in Android Development with Eclipse and Xamarin Presentation Transcript

  • Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net First Steps in Android Development © Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
  • (Relevant) Android Versions Froyo Gingerbread Honeycomb •Android 2.2 •Android 2.3.x •Android 3.x Ice Cream Sandwich •Android 4.0 Jelly Bean KitKat •Android 4.1-4.3 •Android 4.4
  • Android Development Environment Native Android Xamarin (C#) • Eclipse/Android Studio • Android plugin for Eclipse (ADT) • Android SDK • Visual Studio • Xamarin.Android extension • Android SDK
  • Hello World Demo
  • Project Structure src gen res layout values assets Android X.X.X Libraries AndroidManifest.xml
  • What Makes an Android Application? • • • • Presentation layer Derive from Activity Use Views Similar to forms in the desktop world • Worker processes in application • Invisible • Responsible for updating data sources, activities, notifications • Shareable data store • Preferred way to share data across applications Activities Services Content Providers • Message-passing framework • Broadcast messages to target activity/service • Broadcast consumers • Filtered by criteria • Listen to intents that match the criteria • Enables notifications without interrupting the current activity • Device notification area Intents Broadcast Receivers Notifications
  • Resources Resources are non-code application parts Android resources include images, strings, simple values, animations, themes, etc. Best to keep separated/external from code External resources are easier to maintain, upgrade, and manage (…and localize!) Created under the res folder
  • Layout Resources Layouts specify the UI Decouple presentation layer from code Enable designing UI in XML Can be referenced as any other resource from other layouts Usually, each layout XML file = view
  • Code and User Interface Separation Strive to define most of the UI in XML files, and write only code in Java files Clean code/UI separation provides flexibility and easy maintenance Makes it easier to adjust for various types of hardware devices (similar to resource localization) UI elements can be manipulated from code Use findViewById to get UI element instance from code
  • Connecting UI to Code Demo
  • Localization Resources make localization easy Create a language-specific folder structure alongside the main folder structure Folder name includes qualifiers + res + values + strings.xml + values-fr + strings.xml + values-fr-rCA + strings.xml
  • What Is an Activity? An activity represents a screen Using Views to provide UI Extends the Activity class To navigate screens, start a new activity using an intent By default, activities occupy the entire screen Can create semi-transparent/floating activities Last-in-first-out activity stack New activity pushes foreground activity down into stack Navigating back or finishing an activity pops from the stack the previous activity
  • Creating Activities Extend the Activity class The base class presents an empty screen Encapsulates window display handling functionality User interfaces are created using Views Can create UI from layout or from View-derived instances //Using a layout resource identifier: setContentView(R.layout.main); //Using a View-derived instance: TextView text = new TextView(this); text.setText("New text!"); setContentView(text);
  • Multiple Activities All activities must be declared in the application manifest <activity android:name=".SecondaryActivity"/> Span a sub-activity using an Intent Intent launch = new Intent(this, SecondaryActivity.class); startActivity(launch);
  • Layouts Most commonly used layouts Layout Description FrameLayout Pins child views to the top left corner. Adding multiple children stacks each new child on top of the previous, with each new view obscuring the last. LinearLayout Adds each child view in a straight line, either vertically or horizontally. RelativeLayout Enables defining the positions of each of the child views relative to each other and the screen boundaries. TableLayout Lay out views using a grid of rows and columns. Multiple layouts can be mixed together
  • Selectors and Lists ListView provides a convenient UI for value selection from a long list Presents multiple items on screen Spinner provides UI for value selection Presents only a single value at a time Drop-down overlay of selectable items
  • Multiple Activities and ListView Demo
  • Xamarin: C# on 3 Billion Devices Xamarin provides a .NET runtime for iOS and Android development in C# Proprietary IDE: Xamarin Studio Full Visual Studio integration
  • Xamarin.Android Demo
  • Summary Android development environment Resources, layouts, views It’s just another {language, IDE, UI framework} The rest is just details: data, networking, preferences, styling, …
  • Questions Sasha Goldshtein CTO, SELA Group @goldshtn blog.sashag.net