Home
MayLoon User Manual
Contents
1. 3 In Eclipse IDE Select your project to convert and then right click Click Convert to Mayloon Project MayLoon User Manual r3 v len mg IA w L ani LY sw 4 y I GE w OE New gt 4 E com intel linpack LinpackActivit ne cna mds BA Android 2 3 3 Open Type Hierarchy F4 BA Android Dependencies Show In Alt Shift W gt amp src ds gen Generated Java Files 5 Copy Ctrl C amp settings amp amp Copy Qualified Name Gl assets S Paste Ctrl V amp bin XX Delete Delete D res X classpath Remove from Context Ctrl Alt Shift Down x project Build Path a AndroidManifest xml Sauce Alt Shift S gt proguard cfg project properties Refactor Alt Shift T gt gig Import e5 Export Build Project w Refresh F5 T Close Project Assign Working Sets p pr p ar Run As gt ving e AD Debug As gt g ia Validate es o Convert to Mayloon Project e Team gt Compare With gt Restore from Local History Android Tools Pic8 Convert to Mayloon project 4 Convert Wizard will pop up you can configure partial conversion mode for application Partial Conversion Mode If partial conversion is enabled MayLoon will modify application source code in the following way during conversion It converts JNI method declarations into stub methods that you can later implement in either Java or JavaScript Under this mode MayLoon will also generate stub classes for the Android framework
2. MayLoon User Manual n SS Install ca Available Software Select a site or enter the location of a site Work with type or select a site X Find more software by working with the Available Software Sites preferences type filter text Name MPT Location jar file C tools mayloon MPT MPT_0 3 zip Le jJ ewe jJ V Show only the latest versions of available software E Hide items that are already installed V Group items by category What is already installed E Show only software applicable to target environment Fl Contact all update sites during install to find required software Pic2 Add installation package Install MPT feature as normal eclipse plugin MayLoon User Manual i n te I j Available Software Check the items that you wish to install Work with MPT jar file C tools mayloon MPT MPT 0 3 zip Find more software by working with the Available Software Sites preferences type filter text Name b 000 MPT T Details V Show only the latest versions of available software Hide items that are already installed V Group items by category What is already installed E Show only software applicable to target environment E Contact all update sites during install to find required software lt Back Cne Finish Cancel Pic3 Installation process Note If you get a securi
3. 0 appendChild sxr m LI imam p e print 0t Pic25 Chrome console format 3 You can check Call Stack Watch Expressions Scope Variables and also Step into the function in the Debug Area at the right of the source code panel You can also search methods in the Search Scripts toolbar 26 MayLoon User Manual n te A Search Scri uj gt e T y Paused w Watch Expressions te No Watch Expressions Call Stack El clazz losd Clazz defineMathod Stz se anonymous function e2 Clazz defineMethod viewGroup bin framework android view View js 1881 Clazz overideMethod children bin framework android view ViewGroup js 621 Clazz defineMethod more bin framework sndroid view ViewGroup js 489 Clazz ssem C Java eclipse java junc win22 x86 64 eclipse plugin delegsting C Java eclipse java junc win32 x86 64 eclipse plugin Clazz overrideMethod children bin framework android view ViewGroup js 619 I Clazz defineMethod more bin framework android view ViewGroup js 489 Clazz ssem C Java eclipse java junc win22 x86 64 eclipse plugin delegsting C Javs eclipse java junc vin32 x 86 64 eclipse plugin E Clazz defineMethod viewGroup bin framework android view View js 1885 Clazz defineMethod Sfz bin framework android view ViewRoot js 752 Clazz defineMethod Sfz bin framework android view ViewRoot js 56 1 anonymous function bin framework android view ViewRoot js 778 anonymous funct
4. Profile As Validate Edit js Team ly gt Compare With Replace With 3 Restore from Local History Properties Alt Enter Pic18 Open corresponding JavaScript file MayLoon User Manual Clazz declarePackage com intel linpack c Clazz decorateAsClass function this btni null this mTextView null Undo Ctrl Z Clazz instantialize t com intel linpack Clazz defineMethod cS Save Ctrl S function savedInstance Revert File Clazz superCall this Open With j setContentView 2130903 Show In Alt Shift W gt btni findViewById 2 mIextView findViewBy Cut Ctrl X btni setOnClickListenen Copy Ctrl C Bundle Paste Ctrl V c SLinpackActivity 642 Clazz pu h Shift Right c Clazz declareAnony Shift Left Clazz defineMethod cS function argO0 4 Add to Snippets var result com intel a mTextView setText resu Edit java S View Run As c Clazz pOp Debug As gt Profile As gt sourceURL LinpackAg Validate Team Compare With Replace With gt Preferences Remove from Context Ctri Alt Shift Down Pic19 Open corresponding Java file 2 Syntax Highlighting When you open a JavaScript file in JavaScript editor it will highlight its syntax words with different colors 22 MayLoon User Manual lazz declarePackage android core c Clazz declareType android core Start c main
5. btni findViewById 2131034112 mTextView findViewById 2131034113 btni setOnClickListener Clazz isClassDefined com intel linpack LinpackActivitys Bundle c LinpackActivity 642 function Clazz pu h c Clazz declareAnonymous com intel linpack LinpackActivity 642 Clazz defineMethod c onClick function arg0 var result com intel linpack linpack main mTextView setText result View c Clazz pOp E sourceURL LinpackActivity js Pic22 Content Outline Debuging Application in Browser If you fail to launch your converted application in browser you can follow the below steps to identify the problem 1 Take Chrome Chromium browser as an example press F12 to invoke the Developer Tools view and click Console tab as below to check the console message you can filter it with Errors at the bottom of the Console tab 24 MayLoon User Manual m amp tements Resources Q Network C Scripts og Timeline Profies Q rusts j consoe qa ActivityStack gt gt gt Activity com example animation MainActivity being finished but not in LRU list Activity in startActivityForResult ActivityStack gt gt gt startActivityMayWait PackageManager resolveIntenti PackageManager resolveIntent2 PackageManager 1 ActivityStack gt gt gt startActivityMayWait2 ActivityStack gt gt gt aInfo applicationInfo packageName co
6. notice Do not finalize a design with this information The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications Current characterized errata are available on request Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order Copies of documents which have an order number and are referenced in this document or other Intel literature may be obtained by calling 1 800 548 4725 or by visiting Intel s Web Site Intel processor numbers are not a measure of performance Processor numbers differentiate features within each processor family not across different processor families See http www intel com products processor number for details BunnyPeople Celeron Celeron Inside Centrino Centrino Atom Centrino Atom Inside Centrino Inside Centrino logo Core Inside FlashFile i960 InstantIP Intel Intel logo Intel386 Intel486 IntelDX2 IntelDX4 IntelSX2 Intel Atom Intel Atom Inside Intel Core Intel Inside Intel Inside logo Intel Leap ahead Intel Leap ahead logo Intel NetBurst Intel NetMerge Intel NetStructure Intel SingleDriver Intel SpeedStep Intel StrataFlash Intel Viiv Intel vPro Intel XScale Itanium Itanium Inside MCS MMX Oplus OverDrive PDCharm Pentium Pentium Inside skoool Sound Mark The Journey Inside Viiv Inside vPro Inside V
7. protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout activity main float direction 1 0f 2 0f 3 0f 4 0f h float ambien 1f float specular 1f float blurRadius 1f emf hashCode public static native int add int a int b B emf new EmbossMaskFilter direction ambien specular blurRadius Pic12 Converted MayLoon project without partial conversion If Partial Conversion mode is enabled stub classes functions will be generated for classes not supported by Mayloon and JNI method declarations Refer to section 5 2 for details You can review the generated code before proceeding 5 2 Implementing Stubs If Partial Conversion mode is enabled stub classes functions will be generated for classes not supported by Mayloon and JNI method declarations Here is a comparison between original android project and converted MayLoon project with partial conversion File Edit Run Source Navigate JX5d 0 Search Project Refactor Window Help amp G i0o4 De iti m Lr Freer Y Du l 5 M y S I Package Explo z Project Explor IL E E com example missingclassnormal MainActivity BA Android 2 3 3 BA Android Dep gen Generated Java Files e assets amp bin amp libs E res Xj classpath project AndroidManifest xml ic launcher web png proguard proj
8. Android application and system MayLoon currently does not support any of the predefined Intents for example placing phone call or launching web browser e Bluetooth operation e Networking features e Telephony features e Vibrator e File IO e Sensors 36 MayLoon User Manual i n te 8 Known Incompatibilities and Limitations 8 1 Eclipse plugin On Windows PC if the Eclipse installation and the application are on different disk drives C D the resulting HTML5 application might not be able to run 8 2 Incompatibility between Java and JavaScript This section lists the known incompatibilities when converting with MayLoon Currently the MayLoon porting tool does not prompt the developer that any of the incompatibilities is identified in the original Android application As MayLoon translates between 2 different programming languages some differences are inevitable Function overload Function overloading is a usual feature in Object Oriented languages MayLoon implements majority of function overloading capability However consider the following Java class public class MyClass public static void method int intParam System out println int public static void method float floatParam System out println float j public static void method String strParam System out println String public static void main String args method 0 Call method int method 1 2f
9. Call method float method Hello Call method String MayLoon User Manual One of the differences between JavaScript and Java is the numbering system In JavaScript there is only one Number type for all the numbers Therefore when converted to JavaScript the application is not able to distinguish between method int intParam and method float floatParam When method 0 is invoked in the example the program outputs float instead of int The application is able to distinguish between method String strParam from the other two though 64 bit Bitwise Operators Bitwise operators are also translated from Java to JavaScript in a straightforward way For example bitwise AND a amp b is translated into the same operation In JavaScript all numbers are stored as 64 bit 8 bytes floating point numbers However JavaScript bitwise operators do not work on all 64 bits of the operands Actually they only work on half of the bits 32 bits Therefore when the Android application performs bitwise operations on long integers the behavior of the resulting HTML5 application might be different Multi process and multi thread Due to the single threaded nature of JavaScript MayLoon applications do not support multi process or multi thread Threading behavior of MayLoon applications is undefined 38 MayLoon User Manual 9 Upcoming Features The following are some features we will add in upcoming releases Content Pr
10. Converted application running on Chrome 5 4 Reviewing and Editing JavaScript When you convert Android project to HTML5 project with MPT it will generate JavaScript files in MayLoon specific syntax that general JavaScript editors do not recognize MayLoon JavaScript editor helps application developers examine and edit the generated JavaScript files 1 Open generated JavaScript files If you want to see the corresponding JavaScript file generated from a java file Right click the java file and click Edit js from the popup menu 20 MayLoon User Manual When you open a JavaScript file in an editor if you want to navigate back to its corresponding java file right click on the editor and click Edit java from the popup menu 4 32 linpack intel S v v o 4 9 src 4 BB android core gt New gt gt 8 com in 8 gen Open Type Hierarchy F4 gt BA Android D Show In Alt Shift W gt gt BA Mayloon 0 Open F3 Pal A Open With gt gt amp bin G external Copy Ctrl C amp mayloon_ E Copy Qualified Name ra rm S Paste Ctrl V AndroidM Delete Delete B archive zip Remove from Context Ctri Alt Shift Down linpackhtt Build Path dk pent Source Alt Shift S gt project prc Refactor Alt Shift T gt g Import e Export Refresh F5 Tz Outline XN IB References gt An outline is not availd Declarations Edit Converted js Run As gt Debug As gt
11. information about this The content of the widget is made up of the following external widget section s amp images j2slib Identifier http yourdomain linpack amp Widget Sis Version 100 Features res sys Privileges amp WebContent Name linpack Access a config xml Content linpack html B icon png Localization a index html Icon icon png Browse Preference 0 linpack html Lon Launcher Icon Connection Explorer 3 A EE Tizen Content GB The content of the tizen is made up of the following section s Files X3 Tizen Overview Widget Features Privileges Access Localization Preferences Tizen Source fan MM ma eam STW Pic34 Set Content html file 32 MayLoon User Manual i n te 9 Right click the project and click Run As gt Tizen Web Simulator Application to run the project in Tizen web simulator 10 If you want to run the application on a Tizen device you should build the imported project in Tizen IDE and a Tizen application widget wgt file will be generated Note In order to speed up project build please go to project Properties Builders then unselect Validator and JSLint Builder items If you keep these builder options selected the build process will be much longer There might be compile errors in the project although they will not impact the generated package MayLoon User Manual 6 Supported APIs Please refer to one of the MayloonAPISupport HTML docu
12. per oy emf new EmbossMaskFilter res emf hashCode amp res sys X classpath E J2s p Xj project H pjzaative d Andean ew 7 archive zip Ma ic launcher web png public static int add int a int b B mayloon build properties System out println Stub Function add B proguard project txt return 0 B project properties Pic14 Converted MayLoon project with partial conversion enabled A list of the generated stub methods and stub classes are printed in the Eclipse console You can review the generated stubs and implement them To implement the method add int a int b please remove the comment including the j2sNative just above the method and implement the method using either Java code or JavaScript Intuitively the above method would be implemented as follows public static int add int a int b return a 4 b The generated stub class EmbossMaskFilter contains 3 constructors that once called will error out To implement the stub class please implement all the necessary constructors and methods as in normal Android Java application If the stub class originates from Android framework please refer to the official Android developer documentation http developer android com index html for detailed description of the class In addition to converting Java code to JavaScript MayLoon also offers a hybrid programming model meaning that you can embed JavaScript code int
13. saccade aE pE i naa ER E 27 6 Supported APIS 5 5 eeoaEs e perere E snd NER ERUNME DEDI MESURE NE DO URIM WE SUEDE DOO 34 7 Uns pported Features iore tete tont dares hene dd ace rn Ir e FORE R REA RA ev ERE HR TERRE T ences 35 8 Known Incompatibilities and Limitations ccccece cece cece e eee eee mnn 37 8 1 Eclipse plugiriszzeus sd arta E R 37 8 2 Incompatibility between Java and JavaScript sss 37 9 Upcoming Features aici EEUU 39 PT G 1 MayLoon User Manual Environment Requirements Linux or Windows PC Java JDK 1 6 Eclipse Classical 3 7 2 Indigo SR2 or higher with android ADT 21 or greater and JDT plugin installed MayLoon porting tool installation package MPT zip MayLoon SDK archive file MayLoon zip MayLoon User Manual i n te e Installing MayLoon Porting Tool 1 Open Eclipse IDE Help gt Install New Software then click Add button Select a site or enter the location of a site Work with type or select a site type filter text Name EO There is no site selected Details V Show only the latest versions of available software E Hide items that are already installed Group items by category What is already installed E Show only software applicable to target environment E Contact all update sites during install to find required software Pic1 Install MPT 2 Click Archive then select MPT_xxx zip and OK 3
14. system into an existing project Select an import source type filter text 4 General G Archive File 23 Existing Projects into Workspace 5e E Preferences amp Android amp C C cvs amp Git Install gt Plug in Development gt Run Debug Tasks amp Team m Tizen Q Back Next Finish Pic32 Select import source 8 MayLoon User Manual P omi E NEXELS anos File system Import resources from the local file system P From directory C Share source mayloon qa AndroidAppSource linpack mayloon_bi v Browse mayloon bin I com intel linpack LinpackActivity html Rs icon png Filter Types Select All Deselect All Into folder linpack Browse Options Overwrite existing resources without warning Create top level folder Advanced Pic33 Import from File System Open config xml in created project modify index html in Content tab to the generated html file D Tizen Web li nfig xml Tizen File Edit Navigate Search Project Run Window Help r BGe5 mi 0 Qq 0 49 8B m iE Hye eror T Project Explorer 3N BSle7 ao ue linpack BA JavaScript Resources Overview bin General Infomation Widget Content e cs This section describes general
15. 012062420 com android ide eclipse hierarchyviewer f The Android Open Source Project Qj Android Traceview com android ide eclipse traceview feature The Android Open Source Project SWTBot for Eclipse Forms Testing incubation 2 10 201302221524 org eclipse swtbot forms feature group Eclipse org Q SWTBot for Eclipse Testing incubation 2 1 0 201302221524 org eclipse swtboteclipsefeature group Eclipse org Q SWTBot for GEF Testing incubation 21 0 201302221524 org eclipse swtbot eclipse gef feature group Eclipse org n Q SWTBot for SWT Testing incubation 2 0 201302221524 org eclipse swtbot feature group Eclipse org Q SWTBot IDE Features incubation 21 0201302221524 org eclipse swtbot ide feature group Eclipse org GP SWTBot JUnit Headless launchers for Eclipse incubation 2 1 0 201302221524 org eclipse swtbot eclipse test junit featur Eclipse org Q SWTBot Recorder and Test Generator incubation 21 0 2001302221524 org eclipse swtbot generatorfeaturefeatu Eclipse org Q Tracer for OpenGL ES 20 0 0 v2012062420 com android ide eclipse gldebugger featu The Android Open Source Project 4 n Mayloon Porting Tool q Pepe Pic6 Uninstall 2 3 Then click Finish button to finish uninstalling and click Restart Now button to make uninstallation work immediately 3 2 Upgrade If you want to Upgrade MayLoon porting tool please uninstall installed MayLoon porting tool plugin as 3 1 des
16. Clazz defineMethod c main function args var mainThread Clazz isClassDefined android core StartS318 9 and mainThread start By c Start 3i8 function Clazz puSh c Clazz declareAnonymous android core Start 318 Clazz defineMethod c run function I try Class forName android test suitebuilder annotation HasClassAnnotation catch e if Clazz exceptionOf e ClassNotFoundException i else throw e H H try Class forName android test suitebuilder annotation HasMethodAnnotation Pic20 Syntax Highlighting When you double click one word or move cursor to one word the editor will highlight the word selected and the same word in the document Clazz declarePackage com intel linpack c Clazz decorateAsClass function i this btni null tnis eae null Clazz instantialize this arguments com intel linpack LinpackActivity Clazz defineMethod c onCreate function savedInstanceState Clazz superCall this com intel linpack LinpackActivity onCreate savedInstanceSta setContentView 2130903040 btni findViewById 2131034112 mTextView findViewById 2131034113 btni setOnClickListener Clazz isClassDefined com intel linpack LinpackActivity 642 Bundle c LinpackActivity 642 function Clazz puSh cS Clazz declareAnonymous com intel linpack LinpackActivity 642 Cla
17. MayLoon User Manual Copyright 2013 Intel Corporation Document Number xxxxxx xxxUS World Wide Web http www intel com software Document Number XXXXX XXXXX e n tel MayLoon User Manual Disclaimer and Legal Information INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS NO LICENSE EXPRESS OR IMPLIED BY ESTOPPEL OR OTHERWISE TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT EXCEPT AS PROVIDED IN INTEL S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY RELATING TO SALE AND OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE MERCHANTABILITY OR INFRINGEMENT OF ANY PATENT COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT UNLESS OTHERWISE AGREED IN WRITING BY INTEL THE INTEL PRODUCTS ARE NOT DESIGNED NOR INTENDED FOR ANY APPLICATION IN WHICH THE FAILURE OF THE INTEL PRODUCT COULD CREATE A SITUATION WHERE PERSONAL INJURY OR DEATH MAY OCCUR Intel may make changes to specifications and product descriptions at any time without notice Designers must not rely on the absence or characteristics of any features or instructions marked reserved or undefined Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them The information here is subject to change without
18. Report button to view stub info in browser 14 MayLoon User Manual Conversion Report Stub information shows below All stub classes and methods shall be implemented manually Stub classes Stub methods Method add int a int b in MainActivity java Cancel Pic11 Conversion report 7 Note that after conversion the project is still a Java project When you run it as MayLoon project it will be translated into an HTML5 application After converting Android application to MayLoon project if Partial Conversion mode is disabled and converted application contains APIs classes not supported by Mayloon problem markers will be displayed in editor as the following pic shows MayLoon User Manual File Edit Run Source Refactor Navigate Search Project Window Ci i ig i u amp 4 gt com example missingclassnormal MainActivity 4 9 src amp i android core 4B com example missingclassnormal gt GB gen BA Mayloon 1 0 amp assets bin amp external gt libs amp njs gt g res G res sys Xj classpath j2s project j AndroidManifest xml archive zip c launcher web png mayloon build properties proguard project txt project properties Brug iSO EO Orr iF E TI MainActivityjava 23 package com example missingclassnormal dy import android os Bundle public class MainActivity extends Activity e Override
19. Tune Xeon and Xeon Inside are trademarks of Intel Corporation in the U S and other countries Other names and brands may be claimed as the property of others Copyright C 2010 Intel Corporation All rights reserved Revision History Document Revision Description Revision Date Number Number 002 Updated for MayLoon alpha May 2013 04 O Updated for MayLoon 0 4 July 2013 005 Updated for MayLoon 0 5 August 2013 mE 003 Updated for MayLoon 0 3 1 June 2013 MayLoon User Manual i n te Table of Contents 1 Environment Requiremients ouessecossei rng dono oet veretur a enne ma dune Ra one Gd Eu 4 2 Installing MayLoon Porting Tool sssssssssn e nmn 5 3 Uninstalling and Upgrading Mayloon Porting Tool c sse ee 8 3 1 Uninstal DUUM 8 3 2 WP GFA Sai EE 9 4 Configuring MayLoon Porting Tool sssssssesssen nnne nensem 10 5 Using MayLoori Porting TO0l nero pn nonet re hd bin me ne Ch ene rix pe Ra curie Rabe ken a we Ex 11 5 1 Converting to MayL0OOrn 2 eeeir eren nerunt enn nane n grt ne hr ka dtr eR Ra RR Rn RR RR REI a ERA 11 5 2 Implementing St bs 3 teda aras rx dare DE De RR CO a va sa ge ERN RR REN 16 5 3 Building and Running iier tret terrx max ke etn p n nensi ra niche pw ke Enn 18 5 4 Reviewing and Editing JavaScript ssssssssssssseee meme 20 5 5 Debuging Application in Browser sssssessseeeemmememenens 24 5 6 Packaging for TIZEN uei eem nnne tuae
20. amework android util bin framework android util bin framework android util bin fram android util Li bin fram Landroid util Log 1s 99 bin framework android util L bin framework android util L bin framework android util L bin framework android util L bin fram android util L bin fram android util tog bin fram android util t bin fra android util ork android util bin framework android util bin framework android util Log is 9 bin framework android util Loj bin framework android util bin framework android util L amework android util Li ramework android util L bin framework android util L bin framework android util bin framework android util bin framework android util L bin framework android util Loj bin framework android util Log is 95 bin framework android util Log 1s 99 1 Asthe errors in Console are printed out when the errors already occur if you want to pause at the stack when errors occur you can switch to Sources It can be Scripts varying from Chromium versions tab and enable Pause all exceptions at the bottom Then press F5 to refresh the page to reload the application and it will pause at the exceptions end Other than relying on runtime exceptions MayLoon also provides the force breakpoints for the developer It will force the
21. classes and 3 party extensions that MayLoon does not support Select the checkbox to enable this mode And you may also want to view these generated stub classes in eclipse after conversion conversion Click Next button to continue 12 just select the checkbox titled Review the created Java files after MayLoon User Manual Convert Convert to MayLoon Application Press Next to check necessary files and information Enable partial conversion Review the created Java files after conversion Finish Pic9 Convert wizard 5 Check info will list in this page Error information Errors that will terminate convert process Warning information Information that needs developer to pay attention to MayLoon User Manual z E m Check Before Convert Error and warning information shows below Error information Can t find necessary Android file C Share source mayloon qa AndroidAppSource com intel jsdroid calculi m Warning information Project depends on other library C tools mayloon android app com intel jsdroid calculator2 libs arity 2 1 2 u z m Q Next gt Finish Cancel Pic10 Check before conversion Click Next gt or Finish button if there is no error in project otherwise please fix the error before converting project If partial conversion mode is enabled stub class and method info will be listed You can also click View
22. cribes and then follow section 2 to install your new MayLoon porting tool ntel MayLoon User Manual 4 Configuring MayLoon Porting Tool Click Window gt Preferences select Mayloon on the left tab there will be 1 item to configure SDK Location Set proper location of MayLoon SDK folder where MayLoon zip is extracted as the following pic shows Click Apply and OK button to apply your settings X Preferences type filter text General Android Ant Help Install Update Java Mayloon Mylyn Plug in Development Run Debug SWTBot Preferences Team Usage Data Collector Validation XML ae Mayloon Mayloon Preferences SDK Location C tools mayloon MPT mayloonSDK SDK version is 1 0 Support API Level 10 10 Pic7 Mayloon preferences MayLoon User Manual i n te 5 Using MayLoon Porting Tool This section goes through the steps to convert and build your Android application to HTML5 5 1 Converting to MayLoon 1 Import an existing Android project into Eclipse 2 Build the Android project make sure an android application package is generated successfully usually under the bin directory of the Android project Note if the application uses proprietary extensions to Android framework and cannot build in Eclipse environment please generate an APK package corresponding to this application offline and put it in the bin directory The conversion cannot proceed without the APK file
23. debugger to break at that line if you have opened the Chrome Inspector regardless there is exception or not You can insert the breakpoint by using either of the below functions in Java code DebuguUtils DebugBreakPoint for unconditional breakpoint DebugUtils DebugBreakPoint boolean condition for conditional breakpoint If you want to force break at JavaScript level you can use below code debugger break at JavaScript level in te MayLoon User Manual Elements Resources Network Sources Timeline Profiles Audits Console o gt android core Start html y w t t 48 forward true b Watch Expressions e 49 mode dailybuild Y Call Stack 50 onload function 51 var j2sBase window j2s lib j2sBase Y Scope Variables 52 ClazzLoader packageClasspath java j2sBase true Y Breakpoints 53 ClazzLoader setPrimaryFolder bin framework 54 ClazzLoader packageClasspath com intel jsdroid com dujin amail com imps tabletennis tranning java net com intel jsdroid weather android graphic No Breakpoints 55 ClazzLoader loadClass android core Start function 56 android core Start main EDOM Beskooits 57 H b XHR Breakpoints 58 gt Event Listener Breakpoints 59 6e ok gt Workers 61 mozilla addon js 5SSsoO amp 8 8 8 8 8 9 9 5 In ET 33 4 P Gu oO o uU bu
24. ect txt project properties ii DP E 9 16 package com example missingclassnormal 4 amp import android os Bundle public class MainActivity extends Activity Override protected void onCreate Bundle savedInstanceState super onCreate savedInstanceState setContentView R layout activity main float direction 1 0f 2 0f 3 0f 4 0f h float ambien 1f float specular 1f float blurRadius 1f EmbossMaskFilter emf new EmbossMaskFilter direction emf hashCode public static native int add int a int b 4 Pic13 Original Android project ambien specular blurRadius MayLoon User Manual i n te e J Package Explo 3 gt Project Explor J MainActivityjava 23 ES 7 EBS Z BS J package com example missingclassnormal 4 com example missingclassnormal MainActivity 4 B src import android os Bundle 83 android core 4 android graphics public class MainActivity extends Activity J EmbossMaskfFilter java S Override iH com example missingclassnormal protected void onCreate Bundle savedInstanceState BB com intel mpt annotation super onCreate savedInstanceState 8 gen setContentView R layout activity main BA Mayloon 1 0 float direction assets 1 0f 2 0f 3 0f 4 0f bin H float ambien 1f amp external float specular 1f libs float blurRadius 1f njs aor
25. ift T gt B Declaration EJ Console 22 ED LogCat A Se F5 5 693 INFO Convert Project com example 2 318 INFO Partial Conversion Miss clas 2 359 INFO Partial Conversion Annotatio 2 453 INFO Convert Project com example Roch 1linp Alt Shift X A ip i Alt Shift x Cla gt E5 1 Java Applet gt 2Java Application 3 Mayloon Application Run Configurations Pic15 Run as Mayloon application MayLoon User Manual i n te Select Java Application 0 EI Select type any character any String TZ TimeZone Matching items Q CompressedTrieEn org feit findword trie start android core Q TrieDictBuilder org feit findword trie 8 android core Pic16 Select Java application to run as MayLoon application 2 Start your desktop Chrome browser with the allow file access from files command line option and open the generated start page If a Chrome instance is already running without this option please close that first Please check the log messages in the Developer Console of Chrome in case the application does not launch successfully MayLoon User Manual Linpack Chromium _ Index of home Wa Dev e C file home luq runtime EclipseApplication mpt linpack android android core Start htm 3 Cons Commit Histor sdcard mm Handbook of M shell variable 3185x182 B Hello world Pic17
26. ion bin framework sndroid os Handler js 22 Clazz defineMethod Sfz bin framework android os MessegeQueue js 140 Clazz defineMethod msg bin framewors android os MessageQueue js 112 Clazz defineMethod sent bin framework android os Handler js 156 snonymous function bin framework android os Handler js 143 Scope Variables Y Local Pic26 Stack info 4 Sometimes we can t step into the function directly We need to reach the function by going through some internal low level function calls This is depending on the compiler s implementation 419 Clazz saem function To claxxRef fxName funParams 420 var params Clazz getParamsType funParams 421 var fx To fxName 422 if fx lastParams params typeString amp amp fx lastClaxxRef claxxRef 423 var methodParams null 424 if params hasCastedNull 425 methodParams new Array 426 for var k 0 k funParams length k 427 if funParams k instanceof Clazz CastedNull 428 methodParams k null 429 else 430 methodParams k funParams k 431 H 432 l 433 else 434 methodParams funParams 435 436 gt 438 else 439 return 440 H 441 l 442 fx lastParams params typeString 443 fx lastClaxxRef claxxRef 444 var stacks fx stacks 445 if stacks null Pic27 Application debug 5 6 Packaging for Tizen If you want to package the converted application for Tizen please follow the steps below after converting the project t
27. m example android patharc aInfo name com example android patharc ArcsActivity ActivityStack gt gt gt intent getComponent com example android patharc com example android patharc ArcsActivity ActivityStack gt gt gt ActivityStack gt gt gt Sending result to com intel jsdroid home Home index ActivityStack gt gt gt NH gt NH 4 Activity Activity s CanonicalName com intel jsdroid home Home onPause Context Context is 18 Context ApplicationContentResolver create 1 18 Context ApplicationContentResolver NOT NULL Context Context is 19 Context Context is 20 Context Context is 21 Context ApplicationContentResolver create 1 21 Context ApplicationContentResolver NOT NULL ActivityThread appContext is created 21 Activity Activity s CanonicalName com example android patharc ArcsActivity onCreate LayoutInflater createView Framelayout android widget LayoutInflater Creating view FrameLayout Done UIID 148 ID 16908290 LayoutInflater inflate createView success LayoutInflater in rInflate for View 148 Activity Activity s CanonicalName com example android patharc ArcsActivity onStart Activity Activity s CanonicalName com example android patharc ArcsActivity onResume ViewRoot Attaching handlers ViewRoot viewVisibilityChanged Home Application launch time is 211 Oo 2 9 lt top frame gt GD Qro Warnings Logs Pic23 Chrome console bin fr
28. ments to find the list of APIs supported by MayLoon alpha 34 MayLoon User Manual i n te 7 Unsupported Features This chapter lists some of the features available from Android application framework while currently not available from MayLoon If some features are not supported the corresponding API will not function as expected but this does not necessarily mean that MayLoon will not be able to convert those Android applications Google service MayLoon has no access to Google service and APIs for now e TTS Text to speech APIs are not supported for now Notification MayLoon currently doesn t have notification support Security model MayLoon does not support Android s security model Instead the resulting HTML5 applications work in web browsers and web runtimes and are governed by their respective security models Therefore behavior with security impact in MayLoon could be different from Android External storage MayLoon cannot access external storage on the devices yet Power management MayLoon does not support Android power management API and schemes GPS location provider MayLoon currently doesn t support GPS location provider Camera MayLoon applications cannot use camera yet e Wallpaper The resulting HTML5 applications cannot operate on wallpaper e AppWidget Predefined intents MayLoon User Manual Intents is mechanism that Android implements to support message delivery between
29. o Java program in the same way as you can embed assembly code into C C program MayLoon uses the Java2Script library to achieve hybrid programming The j2sNative block in Pic14 is an example illustrating how this works Please refer to http j2s sourceforge net for more information on hybrid programming using j2s Application developers can use hybrid programming for implementing stub classes and methods MayLoon User Manual After the stubs are implemented as necessary the project is ready to be translated into HTML5 5 3 4 pe linpack b 9 src gt GB gen gt BA May gt m sett asse b amp bin Building and Running 1 Finally you can click Run As from the popup menu and then click Mayloon Application If there are one or more main entries in your application Select Java Application dialog will pop up select item Start android core and click OK to continue In this step all the Java source code files will be translated into JavaScript code and an HTML file will be generated as the entry of converted web application Go Into Open in New Window Open Type Hierarchy Show In Copy Copy Qualified Name Paste Delete Remove from Context Build Path Source Refactor Build Project Refresh Close Project Assign Working Sets Run As Debug As Validate Team Compare With 18 F4 Alt Shift W gt Ctrl C Ctrl V Delete Ctrl Alt Shift Down b Alt Shift S gt Alt Sh
30. o MayLoon 1 Convert and build the Android project as Mayloon Application 2 Right click project and then select Export MayLoon User Manual 3 Expand Mayloon and select Export Mayloon Application and click Next as follows type filter text Select an export destination General amp Android Install amp Java 4 amp Mayloon Export Mayloon Application Run Debug Tasks amp Team XML amp Plug in Development Pic28 Export application 4 Onthis page of export wizard select the project you want to export and click Finish By default the Tizen project will be exported to mayLoon bin folder under your project folder You can also check Enable JavaScript compression to reduce the size of all JavaScript files during exporting if you want 28 MayLoon User Manual Select Project to Export Will export the selected project to the destination directory Project Amail Export destination C Users longxian workspace 1 Amail mayloon bin Enable JavaScript compression Pic29 Export wizard 5 Follow the page http developer tizen org downloads sdk installing tizen sdk to setup your Tizen development environment 6 Open Tizen IDE and create a new Tizen web project MayLoon User Manual O Tien Web Teen DE RR RR m ae File Edit Navigate Search Project Run Window Help New Alt Shift N gt Tizen Web Project E Open File F3 Projec
31. ovider e Simple services em G
32. r GODOo uou IE io io o o o os on go oa oa o o y u y u N nction loadJ2SLibZJS path cb if navieatnr userAeent tn nwerCase indexOF cerkn 1 f Following script will make J2SLib compatiable with Java2Script addon function generateScriptCallback return function var s this readyState loaded s complete ader null j2s 1ib onload this this onreadystatechange null this onload null B m var sxr document createElement SCRIPT sxr src path sxr type text javascript if cb var t onreadystatechange var xhrCallback generateScriptCallback if typeof sxr t undefined M sxr onload xhrCallback else sxr t xhrCallback l document getElementsByTagName HEAD 0 appendChild sxr iva exOF eerkn I 1 f E Pause on all exceptions Click to Pause on uncaught exceptions ou a NE Pic24 Chrome console debugging 2 You can click Pretty Print to make the JavaScript code in the panel more readable with proper indent function load2J2SLibZJS path cb var sxr document createElement SCRIPT sxr src path sxr type text javascript if cb var t onreadystatechange var xhrCallback generateScriptCallback if typeof sxr t undefined sxr onload xhrCallback else sxr t xhrCallback l document getElementsByTagName HEAD
33. t Close Cti W FY Other Ctrl N Close All Ctrl Shift W Save Ctrl S Save As Save All Ctrl Shift S Revert Move 7 Rename F2 Refresh F5 Convert Line Delimiters To Print Ctrl P Switch Workspace Restart Import Export EE Properties Alt Enter 1 config xml amail 2 config xml hairstyle 3 config xml test 4 confiaxml com intel isdroid calcu Ff Problems 52 El Console Pic30 Create Tizen web project 7 If you are working with Tizen IDE 2 0 do not use default location and set Location with content exported in step 5 Create a Web Application Project Create a Web Application project in the workspace or in an external location a Sample User Template 4 Tizen Blank Application E m n Tizen Web UI Framework Type JavaScript jQuery Mobile T Tizen Web UI Builder Tizen Blank Application Project name linpack Use default location Location C Share source mayloon qa AndroidAppSource linpack mayloon_bin Pic31 Set project location 30 MayLoon User Manual i n te e Otherwise if you are using Tizen IDE 2 1 please create a new Tizen web project and import your exported MayLoon application to this newly created project as following shows Please confirm if prompted to overwrite existing resources imot sse E a 00 0o os eas Select Import resources from the local file
34. ty warning saying that the authenticity or validity of the software can t be established click OK and continue S Installing Software Warning You are installing software that contains unsigned content The authenticity or validity of this software cannot be established Do you want to continue with the installation ox J cmwe jJ Dee Pic4 Security warning MayLoon User Manual 5 r 3 3 Uninstalling and Upgrading Mayloon Porting Tool 3 1 Uninstall 1 Click Help gt About Eclipse then click Installation Details button in popup window x About Eclipse Eclipse for RCP and RAP Developers Version Indigo Service Release 2 Build id 20120216 1857 c Copyright Eclipse contributors and others 2000 2012 All rights reserved Visit http eclipse org This product includes software developed by the Apache Software Foundation http apache org e jJ Pic5 Uninstall 1 2 Select MayLoon porting tool plugin in Installed Software Tab and then click Uninstall button MayLoon User Manual i n te e Installed Software Installation History Features Plug ins Configuration Name Version Id Provider Q Android DDMS 20 0 0 v2012062420 com android ide eclipse ddms feature gro The Android Open Source Project Q Android Development Tools 20 0 0 v2012062420 com android ide eclipse adt feature group The Android Open Source Project Q Android Hierarchy Viewer 20 0 0 v2
35. zz defineMethod c onClick function arg0 var result com intel linpack linpack main mTextView setText result View c Clazz pOp sourceURL LinpackActivity js Pic21 Double click one word 3 Content Outline When you open JavaScript editor it will show the structure of the JavaScript file in the outline view If a node in the content outline is selected then the cursor will move to the corresponding section in the text ntel editor gt Project Explorer 3 na S b ix linpack 8 src BB android core J Startjava 4B com ntel linpack J linpack java J LinpackActivity java G9 gen BA Mayloon 0 4 BA Android Dependencies assets E bin external mayloon bin amp res E res sys AndroidManifest xml B archive zip linpack html mayloon build properties B proguard cfg project properties El Task List gt com intel linpack Linpacicny j onCreate fundle onClick View 5 5 MayLoon User Manual B LinpackActivityjs 8 _ Clazz declarePackage com intel linpack c Clazz decorateAsClass function this btni null this mTextView null Clazz instantialize this arguments com intel linpack Ebro Rein Clazz defineMethod c onCreate function savedInstanceState Clazz superCall this com intel linpack LinpackActivity onCreate savedInstance setContentView 2130903040
Download Pdf Manuals
Related Search
Related Contents
SCOTTISH SHOWER DUCHA ESCOCESA Instruction Manual Istruzioni d`Uso - Audio-luci KitchenAid KUDU03STBL3 User's Manual Copyright © All rights reserved.
Failed to retrieve file