SlideShare ist ein Scribd-Unternehmen logo
1 von 23
• QUICK START
• BUILDING
• MORE
To start developing Moai apps we are going to need the next tools (not
everything is mandatory, but all them will make easier our lives):


             • CYGWIN
             • GIT
             • MOAI SDK (MOAI-DEV)
             • ZERO BRANE STUDIO

In the next slides we will show from where you can download each tool, and
how you can install/prepare everything to start developing.
From where?
    •URL:                   http://cygwin.com
    •Direct Download:       http://cygwin.com/setup.exe

Why?
   Cygwin is a collection of tools which provide a Linux look and feel environment for
   Windows. We will need it to execute successfully the different Moai scripts. For
   example to rebuild the Moai libraries or recreate the Android host. We will use it
   also to download the moai-dev repo instead use cmd (also possible).

Special steps:
    When the wizard ask you for the packages to install you must add these, or
    different errors will occurs when you execute the scripts :
          •binutils (this pack include ar and ranlib, both needed)
          •cpio
          •sed
          •make
From where?
    •URL:                    https://github.com/
    •Direct Download:        http://git-scm.com/download/win

Why?
   We will need it to download the last Moai source code from the moai-dev repo in
   github.

Special steps
    During the installation, select the "Run Git
    from the Windows Command Prompt"
    option, thus you will be able to run it from
    cygwin (look at the picture on the right).
From where?
    •URL:                  https://github.com/moai/moai-dev
    •Direct Download 1:    https://github.com/moai/moai-dev/archive/master.zip
    •Direct Download 2:    Using GIT, see below.

Why?
   Instead download the Moai SDK from the moai website, we are going to use the
   moai-dev repo, thus we will work with the latest Moai libraries. Also downloading
   the moai-dev repo we will get the Moai source code, and you will need it if you
   want to add some feature to the SDK.

Steps downloading using GIT
    1. Open a cygwin terminal.
    2. Write this to start downloading the repo to your local hard disk:
        git clone https://github.com/moai/moai-dev.git [<dir>]
    The optional <dir> is the path where you want to download the repo content, or
    current dir will be used if you don't specify it.
Steps downloading using GIT (continue)
    Instad use "<drive letter>:" to specify the logical drive location, you must use
    "/cygdrive/<drive letter>/". For example: "git clone https://github.com/moai/moai-
    dev.git /cygdrive/c/apis/moai-dev", will download the repo to windows folder:
    "c:apismoai-dev".
    3. Wait and in some minutes you will have it downloaded. When the process is
        finished you can close the terminal.
    4. Set the environment variables:
          • Open a Windows command prompt.
          • Write and execute:
               setx MOAI_BIN "<dir>vs2010binWin32Debug"
               *<dir> = full path to the moai-dev folder.
          • Write and execute:
               setx MOAI_CONFIG "<dir>samplesconfig"
               *<dir> = full path to the moai-dev folder.
          • Close the cmd window.
From where?
    •URL:                    http://studio.zerobrane.com
    •Direct Download:        https://download.zerobrane.com/
                             ZeroBraneStudioEduPack-0.34-win32.exe

Why?
   We will use it to develop, test and debug our developments in windows.

Special Step
    Open it and select: Project > Lua Interpreter > Moai



                               CONGRATULATIONS!
                    Now, you are ready to write your code and test it
                             without problems, have fun!
Now that we can develop using Moai, we need build our app
to be installed in iOS and Android.


     • BUILDING FOR IOS
     • BUILDING FOR ANDROID

In the next slides we will show how to do it for each system.
What do I need?
   • System:      OSX
   • IDE:         Xcode (you already have it installed, right?)
   • A clone of moai-dev repository, already downloaded.

I have it, and now?
     First, we need the moai libs for ios.
     1. Open the folder “xcode” inside your moai-dev folder.
     2. Open the folder “libmoai” and edit the file “build.sh”.
           1. Comment the three “osx…” lines at the beginning.
           2. Remove the “armv7s” argument from the ios_architectures field.
           3. Remove the “osx” argument from the usage field.
I have it, and now? (continue)
            4. Save and close the file.
     3. Open the terminal console.
     4. Write and execute:
          cd /<dir>/xcode/ios/libmoai
          *<dir> = full path to the moai-dev folder.
     5. Write and execute:
          ./build.sh
     6. Wait until the build finishes, this will take some time.
     7. When the build is finished, close the terminal and go to the folder
          “/tmp/moai/ios/Release/universal”. Copy out all the libraries inside it.

     Now, we have to configure our xcode project.
     8. Open the folder “xcode” inside your moai-dev folder.
     9. Copy the folder “ios” to your desired location. You can rename it.
     10. Open the folder copied and edit the file “mt.default” (and if exists the file
         “moai-target” with the same information).
I have it, and now? (continue)
           1. The first line must be the full path to your moai source code folder.
           2. Fix the path in the second line:
               /<dir>/src/lua-modules lua-modules
              *<dir> = full path to the moai-dev folder.
           3. Save and close the file.
     11. Open the xcode project “MoaiSample.xcodeproject” located in the actual folder.
     12. Optionally you can change the project name:




    13. Add to the project all the libraries from your copied folder in the step 7.

                      And finally, time to build and test your app!
What do I need?
   • System:       Windows used in this tutorial
   • IDE:          Eclipse
   • Android libs: Android SDK, Android NDK, ADT plugin for eclipse
   • Also:         Java Development Kit, Apache ANT
   • A clone of moai-dev repository, already downloaded.

Ops.. I don’t have all that, thus let’s to install it!
     • APACHE ANT
     • JAVA DEVELOPMENT KIT
     • ANDROID SDK
     • ANDROID NDK
     • ECLIPSE AND ANDROID PLUGIN
Ok, finally I am ready, and now?
     • LET’S DO IT
From where?
    •URL:                   http://ant.apache.org
    •Direct Download:       http://ftp.udc.es/apache/ant/binaries/apache-ant-1.8.4-bin.zip

Why?
   We will need it to build a new Android host.

Steps to install
    1. Download and unzip it.
    2. Set the environment variables:
          1. Open a Windows command prompt.
          2. Write and execute:
              setx ANT_HOME "<dir>"
              *<dir> = full path to the unzipped download
          3. Write and execute:
              setx PATH "%PATH%;%ANT_HOME%bin" /m
          4. Close the cmd window.
From where?
    •URL:                         http://www.oracle.com/technetwork/java/javase/downloads/index.html
    •Direct Download:             jdk-6u37
     Note: I have not tested the JDK 1.7, so I copied the link to JDK 1.6 but feel free to test.

Why?
   We will need it to work with the Android project in Eclipse.

Special steps
    1. Set the environment variables:
          1. Open a Windows command prompt.
          2. Write and execute:
              setx JAVA_HOME "<dir>"
              *<dir> = full path to the installed JDK folder
          3. Write and execute:
              setx PATH "%PATH%;%JAVA_HOME%bin" /m
          4. Close the cmd window.
From where?
    •URL:           http://developer.android.com/sdk/index.html

Why?
   We will need it to create Android apps!

Steps
    1. Download, unzip and execute the SDK Manager.
        1. Update/install tools and the APIs (at least I suggest API 10 and API 17).
    2. Close the SDK Manager and open de AVD Manager.
        1. Configure one device for each API (at least for API 10 and API 17).
        2. In all the devices, active the flags:
             • Hardware keyboard pressent
             • Use host GPU.
             • If you select a device with 1024 RAM configured, is possible that it
                 can't be executed from Eclipse. Later, if the emulator can't launch, try
                 it with 900 or less.
From where?
    •URL:          http://developer.android.com/tools/sdk/ndk/index.html

Why?
   We will need it to build the ant host.

Steps
    1. Download and unzip.
    2. Set the environment variables:
        1. Open a Windows command prompt.
        2. Write and execute:
            setx PATH "%PATH%;<dir>" /m
            *<dir> = full path to the unzipped download.
        3. Close the cmd window.
From where?
    •URL:          http://eclipse.org/mobile

Why?
   We will need it to debug, test and build Android apps.

Steps to install
    1. Start Eclipse, then select Help > Install New Software.
    2. Click Add, in the top-right corner.
    3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and
         the following URL for the Location:
         https://dl-ssl.google.com/android/eclipse/
    4. Click OK.
         If you have trouble acquiring the plugin, try using "http" in the Location URL,
         instead of "https" (https is preferred for security reasons).
    5. In the Available Software dialog, select the checkbox next to Developer Tools
         and click Next.
Steps to install (continue)
    6. In the next window, you'll see a list of the tools to be downloaded. Click Next.
    7. Read and accept the license agreements, then click Finish.
         If you get a security warning saying that the authenticity or validity of the
         software can't be established, click OK.
    8. When the installation completes, restart Eclipse.
         Once Eclipse restarts, you must specify the location of your Android SDK
         directory:
    9. In the "Welcome to Android Development" window that appears, select Use
         existing SDKs.
    10. Browse and select the location of the Android SDK directory you recently
         downloaded and unpacked.
    11. Click Next.
         Also you can change the SDK location going to: window > preferences > android.
I am ready!
     First, we have to build the libraries. Also, you must do these steps if you modify
     something from the moai source code, but that is another history.
     1. Open cygwin console.
     2. Go to “/ant/libmoai” folder inside your moai-dev folder.
     3. Write and execute:
         ./build.sh
     4. This will take some time.

     Next, we are going to create the host.
     5. Still with cygwin opened, go to “/ant” folder inside your moai-dev folder.
     6. Write and execute:
        ./make-host.sh –s –p com.domain.name
     Note that you should use your own domain name.

     Now, is time to create the android project.
     7. Still with cygwin opened, go to “/ant/untitled-host” folder inside your moai-dev
        folder.
I am ready! (continue)
     8. Open to edit the file “settings-local.sh”.
          1. Set the “android_sdk_root” var with the full path of your Android SDK.
          2. Set the “src_dirs” var with the full path of your moai source code project.
          Remember: instead use "<drive letter>:" to specify the logical drive location,
          you must use "/cygdrive/<drive letter>/". For example, to set the folder:
          “c:apisandroid-sdk", you have to write: “/cygdrive/c/apis/android-sdk".
     9. Save and close the file.
     10. Write and execute:
          ./run-host.sh
     11. Wait until the process finish, and close the cygwin window.
     12. Open the folder “antuntitled-host” inside your moai-dev folder.
     13. Do: right click in the build folder > properties > security > advanced > edit >
          select your user > active all the allow flags > ok > active the flag “Replace all
          existing…” > ok > yes > ok
     14. Open the build folder.
     15. Copy the three folders (facebook, project and tapjoy) to your desired folder.
     You can rename the “project” folder to your desired name project.
I am ready! (continue)
     Now let’s to configure the project in eclipse.
     16. Open eclipse.
     17. Import the three folders that you copied in the step 15 (using: File > import >
         Existing projects into workspace).
    Note that in the folder /assets/lua of the main project, you have the moai source
    code. Also you can modify it without repeat all the process again.
     1. Right click in the project folder > run as > Android Application [> select the AVD
         to launch the app]

                    And finally, you will see your app in the emulator!
You can find all our manuals and tips in our blog:

                    imathings.wordpress.com


Don’t forget to go to our web and take a view to our iPhone and iPad
                            applications:

                       www.imathings.com


  And to be connected with us, follow us on Facebook and Twitter:

       www.facebook.com/imathings - @imathingsblog

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Kürzlich hochgeladen (20)

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
 
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 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
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...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Moai - Start Guide

  • 1.
  • 2. • QUICK START • BUILDING • MORE
  • 3. To start developing Moai apps we are going to need the next tools (not everything is mandatory, but all them will make easier our lives): • CYGWIN • GIT • MOAI SDK (MOAI-DEV) • ZERO BRANE STUDIO In the next slides we will show from where you can download each tool, and how you can install/prepare everything to start developing.
  • 4. From where? •URL: http://cygwin.com •Direct Download: http://cygwin.com/setup.exe Why? Cygwin is a collection of tools which provide a Linux look and feel environment for Windows. We will need it to execute successfully the different Moai scripts. For example to rebuild the Moai libraries or recreate the Android host. We will use it also to download the moai-dev repo instead use cmd (also possible). Special steps: When the wizard ask you for the packages to install you must add these, or different errors will occurs when you execute the scripts : •binutils (this pack include ar and ranlib, both needed) •cpio •sed •make
  • 5. From where? •URL: https://github.com/ •Direct Download: http://git-scm.com/download/win Why? We will need it to download the last Moai source code from the moai-dev repo in github. Special steps During the installation, select the "Run Git from the Windows Command Prompt" option, thus you will be able to run it from cygwin (look at the picture on the right).
  • 6. From where? •URL: https://github.com/moai/moai-dev •Direct Download 1: https://github.com/moai/moai-dev/archive/master.zip •Direct Download 2: Using GIT, see below. Why? Instead download the Moai SDK from the moai website, we are going to use the moai-dev repo, thus we will work with the latest Moai libraries. Also downloading the moai-dev repo we will get the Moai source code, and you will need it if you want to add some feature to the SDK. Steps downloading using GIT 1. Open a cygwin terminal. 2. Write this to start downloading the repo to your local hard disk: git clone https://github.com/moai/moai-dev.git [<dir>] The optional <dir> is the path where you want to download the repo content, or current dir will be used if you don't specify it.
  • 7. Steps downloading using GIT (continue) Instad use "<drive letter>:" to specify the logical drive location, you must use "/cygdrive/<drive letter>/". For example: "git clone https://github.com/moai/moai- dev.git /cygdrive/c/apis/moai-dev", will download the repo to windows folder: "c:apismoai-dev". 3. Wait and in some minutes you will have it downloaded. When the process is finished you can close the terminal. 4. Set the environment variables: • Open a Windows command prompt. • Write and execute: setx MOAI_BIN "<dir>vs2010binWin32Debug" *<dir> = full path to the moai-dev folder. • Write and execute: setx MOAI_CONFIG "<dir>samplesconfig" *<dir> = full path to the moai-dev folder. • Close the cmd window.
  • 8. From where? •URL: http://studio.zerobrane.com •Direct Download: https://download.zerobrane.com/ ZeroBraneStudioEduPack-0.34-win32.exe Why? We will use it to develop, test and debug our developments in windows. Special Step Open it and select: Project > Lua Interpreter > Moai CONGRATULATIONS! Now, you are ready to write your code and test it without problems, have fun!
  • 9. Now that we can develop using Moai, we need build our app to be installed in iOS and Android. • BUILDING FOR IOS • BUILDING FOR ANDROID In the next slides we will show how to do it for each system.
  • 10. What do I need? • System: OSX • IDE: Xcode (you already have it installed, right?) • A clone of moai-dev repository, already downloaded. I have it, and now? First, we need the moai libs for ios. 1. Open the folder “xcode” inside your moai-dev folder. 2. Open the folder “libmoai” and edit the file “build.sh”. 1. Comment the three “osx…” lines at the beginning. 2. Remove the “armv7s” argument from the ios_architectures field. 3. Remove the “osx” argument from the usage field.
  • 11. I have it, and now? (continue) 4. Save and close the file. 3. Open the terminal console. 4. Write and execute: cd /<dir>/xcode/ios/libmoai *<dir> = full path to the moai-dev folder. 5. Write and execute: ./build.sh 6. Wait until the build finishes, this will take some time. 7. When the build is finished, close the terminal and go to the folder “/tmp/moai/ios/Release/universal”. Copy out all the libraries inside it. Now, we have to configure our xcode project. 8. Open the folder “xcode” inside your moai-dev folder. 9. Copy the folder “ios” to your desired location. You can rename it. 10. Open the folder copied and edit the file “mt.default” (and if exists the file “moai-target” with the same information).
  • 12. I have it, and now? (continue) 1. The first line must be the full path to your moai source code folder. 2. Fix the path in the second line: /<dir>/src/lua-modules lua-modules *<dir> = full path to the moai-dev folder. 3. Save and close the file. 11. Open the xcode project “MoaiSample.xcodeproject” located in the actual folder. 12. Optionally you can change the project name: 13. Add to the project all the libraries from your copied folder in the step 7. And finally, time to build and test your app!
  • 13. What do I need? • System: Windows used in this tutorial • IDE: Eclipse • Android libs: Android SDK, Android NDK, ADT plugin for eclipse • Also: Java Development Kit, Apache ANT • A clone of moai-dev repository, already downloaded. Ops.. I don’t have all that, thus let’s to install it! • APACHE ANT • JAVA DEVELOPMENT KIT • ANDROID SDK • ANDROID NDK • ECLIPSE AND ANDROID PLUGIN Ok, finally I am ready, and now? • LET’S DO IT
  • 14. From where? •URL: http://ant.apache.org •Direct Download: http://ftp.udc.es/apache/ant/binaries/apache-ant-1.8.4-bin.zip Why? We will need it to build a new Android host. Steps to install 1. Download and unzip it. 2. Set the environment variables: 1. Open a Windows command prompt. 2. Write and execute: setx ANT_HOME "<dir>" *<dir> = full path to the unzipped download 3. Write and execute: setx PATH "%PATH%;%ANT_HOME%bin" /m 4. Close the cmd window.
  • 15. From where? •URL: http://www.oracle.com/technetwork/java/javase/downloads/index.html •Direct Download: jdk-6u37 Note: I have not tested the JDK 1.7, so I copied the link to JDK 1.6 but feel free to test. Why? We will need it to work with the Android project in Eclipse. Special steps 1. Set the environment variables: 1. Open a Windows command prompt. 2. Write and execute: setx JAVA_HOME "<dir>" *<dir> = full path to the installed JDK folder 3. Write and execute: setx PATH "%PATH%;%JAVA_HOME%bin" /m 4. Close the cmd window.
  • 16. From where? •URL: http://developer.android.com/sdk/index.html Why? We will need it to create Android apps! Steps 1. Download, unzip and execute the SDK Manager. 1. Update/install tools and the APIs (at least I suggest API 10 and API 17). 2. Close the SDK Manager and open de AVD Manager. 1. Configure one device for each API (at least for API 10 and API 17). 2. In all the devices, active the flags: • Hardware keyboard pressent • Use host GPU. • If you select a device with 1024 RAM configured, is possible that it can't be executed from Eclipse. Later, if the emulator can't launch, try it with 900 or less.
  • 17. From where? •URL: http://developer.android.com/tools/sdk/ndk/index.html Why? We will need it to build the ant host. Steps 1. Download and unzip. 2. Set the environment variables: 1. Open a Windows command prompt. 2. Write and execute: setx PATH "%PATH%;<dir>" /m *<dir> = full path to the unzipped download. 3. Close the cmd window.
  • 18. From where? •URL: http://eclipse.org/mobile Why? We will need it to debug, test and build Android apps. Steps to install 1. Start Eclipse, then select Help > Install New Software. 2. Click Add, in the top-right corner. 3. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location: https://dl-ssl.google.com/android/eclipse/ 4. Click OK. If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons). 5. In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
  • 19. Steps to install (continue) 6. In the next window, you'll see a list of the tools to be downloaded. Click Next. 7. Read and accept the license agreements, then click Finish. If you get a security warning saying that the authenticity or validity of the software can't be established, click OK. 8. When the installation completes, restart Eclipse. Once Eclipse restarts, you must specify the location of your Android SDK directory: 9. In the "Welcome to Android Development" window that appears, select Use existing SDKs. 10. Browse and select the location of the Android SDK directory you recently downloaded and unpacked. 11. Click Next. Also you can change the SDK location going to: window > preferences > android.
  • 20. I am ready! First, we have to build the libraries. Also, you must do these steps if you modify something from the moai source code, but that is another history. 1. Open cygwin console. 2. Go to “/ant/libmoai” folder inside your moai-dev folder. 3. Write and execute: ./build.sh 4. This will take some time. Next, we are going to create the host. 5. Still with cygwin opened, go to “/ant” folder inside your moai-dev folder. 6. Write and execute: ./make-host.sh –s –p com.domain.name Note that you should use your own domain name. Now, is time to create the android project. 7. Still with cygwin opened, go to “/ant/untitled-host” folder inside your moai-dev folder.
  • 21. I am ready! (continue) 8. Open to edit the file “settings-local.sh”. 1. Set the “android_sdk_root” var with the full path of your Android SDK. 2. Set the “src_dirs” var with the full path of your moai source code project. Remember: instead use "<drive letter>:" to specify the logical drive location, you must use "/cygdrive/<drive letter>/". For example, to set the folder: “c:apisandroid-sdk", you have to write: “/cygdrive/c/apis/android-sdk". 9. Save and close the file. 10. Write and execute: ./run-host.sh 11. Wait until the process finish, and close the cygwin window. 12. Open the folder “antuntitled-host” inside your moai-dev folder. 13. Do: right click in the build folder > properties > security > advanced > edit > select your user > active all the allow flags > ok > active the flag “Replace all existing…” > ok > yes > ok 14. Open the build folder. 15. Copy the three folders (facebook, project and tapjoy) to your desired folder. You can rename the “project” folder to your desired name project.
  • 22. I am ready! (continue) Now let’s to configure the project in eclipse. 16. Open eclipse. 17. Import the three folders that you copied in the step 15 (using: File > import > Existing projects into workspace). Note that in the folder /assets/lua of the main project, you have the moai source code. Also you can modify it without repeat all the process again. 1. Right click in the project folder > run as > Android Application [> select the AVD to launch the app] And finally, you will see your app in the emulator!
  • 23. You can find all our manuals and tips in our blog: imathings.wordpress.com Don’t forget to go to our web and take a view to our iPhone and iPad applications: www.imathings.com And to be connected with us, follow us on Facebook and Twitter: www.facebook.com/imathings - @imathingsblog