Qt for Android配置详细教程(Ubuntu 11.04)


参考:

一.环境搭建

1. Java 下载安装:

->jdk-6u25-linux-i586.bin

url: http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html

->  1、jdk-1_5_0_06-linux-i586.bin下载到/usr/soft,赋予可执行权限:chmod 755 jdk-1_5_0_06-linux-i586.bin

2、执行:./jdk-6u25-linux-i586.bin    空格键翻页,到最后输入yes

3、配置环境变量:在/etc/profile 中加入:

export  PATH=/usr/soft/jdk*.*/bin:$PATH

exportJAVA_HOME=/usr/soft/jdk*.*.*

4、运行:source /etc/profile  使配置文件生效

5、运行:java -version,显示jdk版本,jdk安装成功

->linux操作系统可能默认会安装有openjdk

需要将自己安装的Java设置为默认的:

sudoupdate-alternatives --install /usr/bin/java java /usr/local/jdk1.6.0_26/bin/java1160

2. git GIT 是用于 Linux 开发的版本控制工具

-> unbutu 11.04 安装:

sudo apt-get install git git-core

3. Android SDK

->http://developer.android.com/sdk/index.html

->解压下载的SDK文件 到 <Android_SDK_Path>

例如:/usr/local/bin/android-sdk-linux_x86-1.5_r2

->修改/etc/profile 文件

->export PATH=${PATH}:<Android_SDK_Path>/tools

例如:export PATH=${PATH}:<SDK_Path>/

android-sdk-linux_x86-1.5_r2/tools

->save

->restart

->输入: sudoandroid

->通过弹出界面配置SDK(此时的SDK并未安装完成,需要通过网络完成全部安装)。

->在Settings 处勾选 force https://......

->在AvailablePackages 处 勾选要安装的包

->Install Selectted 进行安装

->android avd配置信息的生成

->android avd的创建格式为:androidcreate avd -n your-avd-name -t your-targets

->其中: -n的参数为我们要创建的avd的名字;

-t的参数为Available Android     targets的id,

我们可以使用命令:android list查寻其具体信息。

->$android list

AvailableAndroid targets:

id:1

Name: Android 1.1

Type: Platform

API level: 2

Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L,QVGA-L

id:2

Name: Android 1.5

Type: Platform

API level: 3

Skins: HVGA-P, HVGA (default), QVGA-P, HVGA-L,QVGA-L

id:3

.....................

->创建avd:$android create avd -n android1.5 -t 2

Android1.5 is a basic Android platform.

Doyou wish to create a custom hardware profile [no]yes

Deviceram size: The amount of physical RAM on the device, in megabytes.

hw.ramSize[96]:128

Touch-screensupport: Whether there is a touch screen or not on the device.

hw.touchScreen[yes]:yes

Track-ballsupport: Whether there is a trackball on the device.

hw.trackBall[yes]:yes

Keyboardsupport: Whether the device has a QWERTY keyboard.

hw.keyboard[yes]:yes

DPadsupport: Whether the device has DPad keys

hw.dPad[yes]:yes

GSMmodem support: Whether there is a GSM modem in the device.

hw.gsmModem[yes]:yes

Camerasupport: Whether the device has a camera.

hw.camera[no]:

Camerasupport: Whether the device has a camera.

hw.camera[no]:yes

Maximumhorizontal camera pixels

hw.camera.maxHorizontalPixels[640]:854

Maximumvertical camera pixels

hw.camera.maxVerticalPixels[480]:480

GPSsupport: Whether there is a GPS in the device.

hw.gps[yes]:yes

Battery support: Whether the device can run on a battery.

hw.battery[yes]:yes

Accelerometer:Whether there is an accelerometer in the device.

hw.accelerometer[yes]:yes

Audiorecording support: Whether the device can record audio

hw.audioInput[yes]:yes

Audioplayback support: Whether the device can play audio

hw.audioOutput[yes]:yes

SDCard support: Whether the device supports insertion/removal of virtual SDCards.

hw.sdCard [yes]:yes

Cachepartition support: Whether we use a /cache partition on the device.

disk.cachePartition[yes]:yes

Cachepartition size

disk.cachePartition.size[66MB]:100MB

CreatedAVD ''android-sdk-15'' based on Android 1.5

->启动模拟器界面: $emulator @android-sdk-15-show-kernel

->配置eclipse,使之支持android sdk(安装ADT插件):

Eclipse,Help->SoftwareUpdates->Available Software(根据提示进行相应操作)

4. Android NDK

->http://developer.android.com/sdk/ndk/index.html

->解压NDK包到指定目录

->配置PATH

->修改/etc/profile 文件

->  NDKROOT=/usr/local/bin/android-ndk-r5c (用户根据自己的实际安装配置)

PATH=$PATH:$NDKROOT

->save

->restart

->测试环境变量:

->cd /usr/local/bin/android-ndk-r5c/samples/hello-jni

->ndk-build

->将看到系统会编译出libhello-jni.so

5. 安装necessitas

http://sourceforge.net/projects/necessitas/files/

(包括Qt的库,Qt Createrfor Android, 同时可以选择安装NDK 和SDK(但是由于网速问题建议不要选择可以自己安装)):

->下载necessitas-0.2-online-sdk-installer-linux

->使用 chmod 添加可执行权限

->安装过程需要网络环境

6. Ministro

需要在android上安装Ministro service

url: http://sourceforge.net/projects/ministro.necessitas.p/files/ 

  • 1
  • 2
  • 3
  • 4
  • 5
  • 下一页

相关内容