• Save
Migrating JavaME Apps to Android
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
4,505
On Slideshare
4,222
From Embeds
283
Number of Embeds
6

Actions

Shares
Downloads
0
Comments
0
Likes
4

Embeds 283

http://community.developer.motorola.com 264
http://www.slideshare.net 13
http://semanticseed.com 2
http://127.0.0.1:8795 2
http://www.zhuaxia.com 1
http://74.125.93.132 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Hello, Welcome to the second Orange and Motorola Webinar “'Here’s some great tips for migrating your Java ME apps to Android'”. I am the Director of Developer Services for Orange and I’ll be hosting today’s webinar. We know that many of you joined us two weeks ago to learn how to develop Android apps using the MOTODEV studio. So welcome back. We hope you’ve already started using this intuitive tool. For those who didn’t join us, but wanted to, then we’ll follow up with you after the webinar to show you where you can access the slides and the STUDIO. Before I hand over to Eric of Motorola, I’d like begin by saying that making sure your apps work seamlessly is really important to both Orange and Motorola. We want to help you to develop apps with the least effort possible, and we are looking at the ways in which we can help you. These webinars are a start and there is a wealth of resource out there from both MOTODEV and Orange Partner. I’ll explain how you can access this resource a little bit later in the webinar, plus I’ll update you on a testing initiative that Motorola and Orange are involved in for Android apps. But as I said, more about that later. But for now, I’ll hand you over to Eric Hildum, Senior Product Manager at Motorola to talk you what you need to know when migrating your Java ME app to Android. And one last thing, we’d really encourage you to ask us questions. At the end of the webinar we’ll have dedicated time for questions and answers, so please, don’t hold back. Ask away or send us your comments for discussion. If there is anything you want to know specifically about Eric’s session or generally about developing with Orange or Motorola at all then please send them via the chat and we’ll address them at the end of the webinar. There is also a twitter feed to send us your thoughts. Do so using the hash tag “ adevinar ”. Over to you Eric….
  • Android hardware requirements from early Google site describing the Platform Development Kit dated 9-June-2008. Compare Android device requirements with Pismo Powerbook introduced in 2000.
  • Conclusion: Motorola and Orange: working together to help you Motorola is working closely with Orange to ensure that you: the MOTODEV and Orange developer community has the information and resources they need to successfully develop, test, and distribute Android applications. We want to help you. These webinars are a start, we have ongoing support through both our developer programmes: As Eric just touched on, there is a world of a lot of resource through MOTODEV - the Motorola developer network that’s dedicated to opening up the potential of Android to every developer. Just go to the website, to access, tools and documentation, community support. ( developer.motorola.com – we’ll provide the links at the end of the webinar). On the Orange side, all you need to do is go to the Orange Partner website to see what help we can offer you in developing your apps. Testing your apps on the Orange network and devices is really important to us. This is why we have world wide Orange Developer centres. There are also virtual developer centres. You can find device specs and many other tools for testing. (Martin to expand here on the apps support we provide) You’ll see we place a lot of emphasis to help you to test, test, and test again. I wanted to let you know that we're working with Motorola and others to produce - initially - some guidelines / test cases against which developers can test Android apps. We're all aware of the need for this within the industry, and both Orange and Motorola are at the forefront in helping to do something about it. And whatever we do, we're going to do it quickly. But we need your help. We need to know what you feel the problematic areas are: the areas that cause the errors in testing? Let us know and send us your thoughts.
  • AND FOR YOUR DEVELOPED ANDROID APPS, HERE IS THE ORANGE APP SHOP: One click access to apps from the Orange device home screen A small selection of suitable apps, regularly updated Availability on major devices platforms / OS (Blackberry, Java, Android, WM,.. ) Easy discovery and content selection, through an animated store front One-stop experience billed to their Orange bill: no registration required Automatic download & installation of application on devices One click to launch downloaded applications And that’s exactly what we’ve delivered with the Orange App Shop. It’s a straightforward, honest, dynamic, refreshing and friendly shop front housing a comprehensive catalogue of Orange-branded and 3rd party games, applications, wallpapers and ringtones. You can see the latest apps available, search for apps within the catalogue, view the best-sellers, and store your downloaded apps in your ‘my stuff’ folder. It’ll be available across multiple platforms and on numerous devices. And we’re particularly pleased with the ‘my stuff’ folder, and you’ll see why in a minute ... Let’s take a look at the App Shop client, but before we do, it’s important to stress that the other distribution points for apps are still available in the countries. People can still download apps from Orange World in the UK, France, Spain and Belgium. It’s available on all java devices and most Symbian, Android, WM devices. So, the new App Shop client won’t necessarily replace the existing routes-to-market for applications, it’ll complement them.

Transcript

  • 1. hello “ Here’s some great tips for migrating your Java ME apps to Android” Eric Hildum, Motorola Martin Wrigley, Orange
  • 2. Transitioning to Android Android for Java ME developers Eric Hildum Senior Product Manager Motorola
  • 3. PRESENTATION FOCUS
      • Experienced Java ME Developers
        • Familiar with MIDP Java
        • Experienced in designing mobile applications
          • Understand the implications of battery power, slow processor
        • Want to know what Android is about
      • Overview of Android
        • Key terminology
        • Application structure
        • Differences from MIDP Applications
      • Not an Android development training course
      • Not about converting a Java ME application to Android
  • 4. MINIMUM DEVICE MODEL
    • MIDP 2 Model (JSR-118)
      • Display: 96x54, 1-bit
      • One or more of the following user-input mechanisms: one-handed keyboard, two-handed keyboard, or touch screen
      • 128 kilobytes of volatile memory for the Java runtime
      • 256 kilobytes of non-volatile memory for the MIDP implementation.
      • 8 kilobytes of non-volatile memory for application-created persistent data
      • Two-way, wireless, possibly intermittent, with limited bandwidth
      • The ability to play tones, either via dedicated hardware, or via software algorithm.
    • Android Model (Jun-2008)
      • Display: QVGA, 16-bit color
      • 5-way navigation with 5 application keys, power, camera, and volume controls
      • 128 MB RAM
      • 256 MB Flash
      • Mini or Micro SD card
      • 2MP Camera
      • Standard mini-B USB interface
      • Bluetooth 1.2
    • Optional
      • QWERTY keyboard
      • WiFi
      • GPS
  • 5. APPLICATION MODEL
    • Java ME MidLET
      • Monolithic collection of classes with single entry point
      • Single process in JVM
      • UI typically via code on Canvas
      • Fixed display size
      • Record Store for data
      • Localization difficult
    • Android Task
      • Collection of Activities, Services, etc.
      • Execution may span process boundaries
      • UI from XML descriptions
      • Display size depends on orientation
      • Content Provider, SQLlite, Preferences for data
      • Localization simple
  • 6. ROUGH COMPARISON
      • Dalvik and Java ME: Java (really)
      • Android Manifest and JAD: Description of Application Suite
      • APK and JAR: Application container/distribution
      • XML and lcdui: GUI
      • Signing, permissions, development environment, etc.
  • 7. ANDROID MANIFEST <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <!-- Copyright (C) 2007 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Copyright (C) 2009 Motorola, Inc. --> <!-- Declare the contents of this Android application. The namespace attribute brings in the Android platform namespace, and the package supplies a unique name for the application. When writing your own application, the package name must be changed from &quot;com.example.*&quot; to come from a domain that you own or have control over. --> <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.example.android.helloactivity&quot;> <!-- The application tag supplies the name as presented to the end user. Note that this name is specified by a resource id. This allows you to localize the name in the appropriate strings.xml file. --> <application android:label=&quot;@string/application_name&quot;> <!-- The application contains an activity named HelloActivity --> <activity android:name=&quot;HelloActivity&quot;> <intent-filter> <!-- MAIN indicates that this activity is the one that should be started when the application is started --> <action android:name=&quot;android.intent.action.MAIN&quot;/> <!-- LAUNCHER indicates that this is the activity that should be shown in the application Launcher --> <category android:name=&quot;android.intent.category.LAUNCHER&quot;/> </intent-filter> </activity> </application> </manifest>
  • 8. MANIFEST <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.example.android.helloactivity&quot;> <application android:label=&quot;@string/application_name&quot;> <activity android:name=&quot;HelloActivity&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot;/> <category android:name=&quot;android.intent.category.LAUNCHER&quot;/> </intent-filter> </activity> </application> </manifest>
  • 9. APPLICATION STRUCTURE 1
      • Android applications are:
        • Collection of Activities, Services, and Content Providers executing together to accomplish a task
        • Not necessarily in the same Android process
        • May be your own, Android, or other third party components
        • Activities, Services, etc. have a lifecycle, not the application
        • Communication is by Intents, which are essentially messages on the Activity, Service, etc.
      • Android application model is quite different than monolithic MIDP Java applications
        • Highly modular MVC model MIDP apps will be easier to port
  • 10. APPLICATION STRUCTURE 2
      • Activities are visible components
        • Encapsulates all the interactions on a single screen
          • Layout, display of information
          • Menus, contextual menus
          • Input from keyboard, navigation, touch screen
        • Exist on a stack
        • Topmost Activity is foreground and currently displayed
        • Pressing back key finishes current Activity and pops stack
      • Services are invisible components
        • Exist in background
        • May be shared among Activities/applications
        • For long running operations
        • Similar to Unix daemons or Windows Services
  • 11. APPLICATION STRUCTURE 3
      • Content Providers
        • Source or sink of data
        • Only way to share data across applications
        • Expose data as a table in a database
          • Data organized in columns
          • Accessed/updated by rows grouped in row sets
          • Queries use SQL
      • A preference mechanism exists for applications
      • Broadcast Receivers
        • Receive and act on system and other events
          • Low battery, etc.
        • Generally will invoke a Service to deal with the event
  • 12. ACTIVITY
      • A single screen in an application
      • Consists of
        • Code
        • Resources
          • XML layout
          • XML menu
          • Values
          • Drawables
      • Localization fully supported
        • Internationalize your applications even if you do not plan on localization
        • Same system used for orientation support
      • Orientation changes restart Activity
        • Activities on stack are restarted when they become top of stack
  • 13. HELLO WORLD EXAMPLE <manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; package=&quot;com.example.android.helloactivity&quot;> <application android:label=&quot;@string/application_name&quot;> <activity android:name=&quot;HelloActivity&quot;> <intent-filter> <action android:name=&quot;android.intent.action.MAIN&quot;/> <category android:name=&quot;android.intent.category.LAUNCHER&quot;/> </intent-filter> </activity> </application> </manifest>
  • 14. HELLO WORLD LAYOUT <EditText xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; android:id=&quot;@+id/text&quot; android:layout_width=&quot;fill_parent&quot; android:layout_height=&quot;fill_parent&quot; android:textSize=&quot;18sp&quot; android:autoText=&quot;true&quot; android:capitalize=&quot;sentences&quot; android:text=&quot;@string/hello_activity_text_text&quot; />
  • 15. VALUES FROM STRING.XML English Localization <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <resources>      <string name=&quot;hello_activity_text_text&quot;>Hello, World!</string> <string name=&quot;application_name&quot;>Hello World</string> </resources> Japanese Localization <?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?> <resources>      <string name=&quot;hello_activity_text_text&quot;> こんにちは世! </string>      <string name=&quot;application_name&quot;> こんにちは世 </string> </resources>
  • 16. HELLO WORLD JAVA /* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an &quot;AS IS&quot; BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Copyright (C) 2009 Motorola, Inc. */ package com.example.android.helloactivity; import android.app.Activity; import android.os.Bundle; /** * A minimal &quot;Hello, World!&quot; application. */ public class HelloActivity extends Activity { public HelloActivity() { } /** * onCreate is called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set the layout for this activity. You can find it // in res/layout/hello_activity.xml by default, or in a localized // version in the res/layout_* directories. // Notice that the view is referenced by id. This allows the correct // layout to be selected based on local, geometry, and orientation. // Many sample applications in tutorials will show the layout being // specified by a string - a reference to a specific file. // DO NOT do this! Always use an id instead. setContentView(R.layout.hello_activity); } }
  • 17. ENGLISH
  • 18. 日本語
  • 19. INTENTS
      • Messages passed between Activities and Services
      • Activities, Services, and Broadcast Receivers
        • Register through the Manifest the Intents that they respond to via an Intent filter
        • Create Intents and request the system to launch the appropriate Activity, Service, or Broadcast Receiver for the Intent
      • Intents may be explicit or implicit
        • Implicit intents will fire any Activity or Service that matches following well defined matching criteria
        • Explicit will only fire a specific Activity or Service
      • Contain a MIME type and URI
        • Caution: Intents take Uri type, not URI or URL type!
      • Have an Action and Category
        • Actions: CALL, EDIT, MAIN, PICK, VIEW, etc.
        • Category: DEFAULT, LAUNCHER, etc.
      • May also have a bundle of data or key value pairs
  • 20. INTENT FRAGMENT
    • OnClickListener mViewListener = new OnClickListener() {
    • public void onClick(View v) {
    • try {
      • new URL(mEditor.getText().toString());
      • Uri uri = Uri. parse (mEditor.getText().toString());
      • Intent intent = new Intent(Intent. ACTION_VIEW , uri);
      • startActivity(intent);
      • } catch (Exception e) {
        • Toast toast = Toast. makeText (getApplicationContext(),
        • R.string. Invalid_URL , Toast. LENGTH_SHORT );
        • toast.show();
        • }
      • }
    • };
  • 21. MORE INTENTS
      • Intents are also used to return results from Activities to invoking Activity
      • User prompted if multiple Activities can respond to Intent
      • Intent filters specify
        • Action (required)
        • Category
        • URI & MIME type, wildcards are allowed
      • May request a list of Activities, Services, Broadcast Receivers that are able to respond to Intent
        • Allows your application to dynamically add functionality depending on software installed on device
        • Not restricted to System components
  • 22. BOTTOM LINE Bottom line: many concepts are directly transferable, but the application model, UI framework, display characteristics, and data persistence are different enough that most applications will need to be significantly rewritten for Android
  • 23. REFERENCES
      • Android Essentials
        • ISBN 978-1-4302-1064-1
      • The Busy Coder's Guide to Android Development
        • ISBN 978-0-9816780-0-9
      • Professional Android Application Development
        • ISBN 978-0-470-34471-2
      • Unlocking Android
        • ISBN 978-1-933988-67-2
      • MOTODEV web site: http://developer.motorola.com/
      • Android web site: http://developer.android.com/
  • 24. Legal Copyright (2009), Motorola, Inc. All rights reserved except as otherwise explicitly indicated. The information offered in this presentation is offered on an  &quot;AS IS&quot; basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. In addition, Motorola disclaims all liability from the use or inability to use the information provided. The entire risk as to the quality and performance of the information in this presentation is with you. The presentation may contain certain sample source code in the form of example applications and code fragments.  Motorola grants you a limited personal, non-exclusive, and revocable license to: (i) use the sample source code internally to develop, test, evaluate and demonstrate software applications for use solely with or on Motorola wireless handset products, and (ii) incorporate the sample source code into the applications and distribute the applications in binary form only, provided that you include any copyright notice that appears in the sample source code.
  • 25. Legal Copyright (C) 2007 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
  • 26. #adevinar Orange & Motorola: working together to help you
  • 27.
      • One click access to apps from the Orange device home screen
      • A small selection of suitable apps , regularly updated
      • Availability on major devices platforms
      • Easy discovery and content selection, through an animated store front
      • One-stop experience billed to their Orange bill : no registration required
      • Automatic download & installation of application on devices
      • One click to launch downloaded applications
    Orange App Shop France and UK and then Spain, Poland, Romania, Switzerland closely followed by Slovakia, Belgium, Austria, Moldova and Portugal UK ES FR PL RO SK CH BE AT PT MD Access to the Orange customer base:
  • 28. how to submit newly developed apps www.orangepartner.com
  • 29. #adevinar please address your questions to the ‘host’ using the ‘chat’ to the right of your screen. OR use Twitter and send us your comments or questions using the following hash tag #adevinar questions?
  • 30. #adevinar thank you tell us what you thought #adevinar @OrangePartner @Motodev www.orangepartner.com developer.motorola.com