Difference between revisions of "Android Interface"

From Free Pascal wiki
Jump to navigationJump to search
(redirect)
 
(55 intermediate revisions by 9 users not shown)
Line 1: Line 1:
== Architecture ==
+
#REDIRECT [[Custom Drawn Interface/Android]]
 
 
As of August 2010 (and Android 2.2), the Android platform can only execute Java Android applications, but these applications can load native libraries. The main idea of the Lazarus Android port is using capability to allow Android to run the existing Lazarus apps. A generic Java application will be created which exposes the Java Android API to the LCL though the Java Native Interface. The Lazarus user application will be built as a Linux-arm library and be attached to the generic Java encapsulating application. Both will then communicate to ensure that the existing LCL applications run under Android with as little changes as possible.
 
 
 
The encapsulating Java program wouldn't need to be changed by Lazarus users, and no knowledge of Java will be necessary to develop Lazarus applications for Android. Of course Java knowledge will be necessary to work on the LCL Android Widgetset.
 
 
 
== Roadmap ==
 
 
 
# Learn how to write a Java Android application
 
# Learn how to use the JNI
 
# Start building the encapsulating Java application
 
# Start building the new widgetset
 
# Develop both together until the following components are working: TApplication, TForm, TButton, TComboBox, TEdit, TStaticText
 
 
 
== Using the Emulator ==
 
 
 
=== Installing the Emulator ===
 
 
 
=== Building an emulator image with sdcard support ===
 
 
 
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat
 
 
 
Step 2: Create a new image, by clicking the New button as in the image bellow.
 
 
 
[[Image:Android_new_image.PNG]]
 
 
 
Step 3: Set the name and properties of the image, the size of the SDCard and add hardware support for the sdcard, as seen on the image bellow.
 
 
 
[[Image:Android_new_image_dialog.PNG]]
 
 
 
=== Running an emulator image ===
 
 
 
Step 1: Run the application C:\Program Files\android-sdk-windows\tools\android.bat
 
 
 
Step 2: Select the image
 
 
 
Step 3: Click on the "start" button, as seen bellow.
 
 
 
[[Image:Android_run_image.PNG]]
 
 
 
=== Copying files to the emulator ===
 
 
 
You can use a script similar to this one to copy files from your hard-drive to the emulator. Notice that the image must be running and that it must have sdcard support built inside itself.
 
 
 
<pre>
 
c:
 
cd "Program Files"
 
cd android-sdk-windows
 
cd tools
 
adb push C:\Mypath\Somefile.extension /sdcard
 
pause
 
</pre>
 
 
 
=== Installing applications in the emulator ===
 
 
 
Android apps should be packaged in the Android .apk file format. For more information about how to create an .apk file that you can install on an emulator/device instance, see Android Asset Packaging Tool (aapt). After packing a file, it can be installed in the emulator by using the following adb call:
 
 
 
<pre>
 
c:
 
cd "Program Files"
 
cd android-sdk-windows
 
cd tools
 
adb install C:\Mypath\MyApp.apk
 
pause
 
</pre>
 
 
 
==Using the phones==
 
 
 
Installing the drivers and getting a reliable way to transfer executables and debug software with all the different Android phone can be a challange in itself.
 
 
 
===Samsung Galaxy S===
 
 
 
The first thing to do when using Samsung Galaxy S is not beliaving the Samsung instructions. They will say that one should install Kies, their horribly crappy PC suite which is 130MB large and fails to install because the first thing that it does is failling to connect to a server in Korea to download even more files. Instead of doing this, following these instructions:
 
 
 
1. Go in the phone menu Settings -> About Phone -> USB settings. Change from "KIES" to "Mass storage"
 
2. Download and install 19 MB of Samsung USB drivers from: http://drivers.softpedia.com/dyn-postdownload.php?p=96692&t=4&i=1
 
3. Connect the cable of the phone
 
4. Drag the top menu of the phone down and mount the sdcard
 

Latest revision as of 06:48, 18 April 2012