KorhalNexus7: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
(Cleanup)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=Building=
== Building ==
<code>
mkdir ~/korhal # or wherever you want your checkout
cd~/korhal
repo init -u git@gitorious.org:korhal/manifest.git
repo sync
source build/envsetup.sh
</code>


For each of the tgz’s here, extract and execute the binary inside the source tree (~/korhal if using the above instructions):
For each of the tgz's here, extract and execute the binary inside the source tree (~/korhal if using the above instructions):


https://developers.google.com/android/nexus/drivers#grouperjzo54k
https://developers.google.com/android/nexus/drivers#grouperjzo54k


The hardware name for the Nexus 7 is “grouper”, thus we initialize lunch with that.
The hardware name for the Nexus 7 is "grouper", thus we initialize lunch with that.


=Preparing device=
<code>
lunch full_grouper-eng
make -j8
</code>


== Preparing device ==
This will wipe your Nexus 7 device, make sure you have backed up anything you wish to keep. You only need to follow the instructions in this section once for any given device.
This will wipe your Nexus 7 device, make sure you have backed up anything you wish to keep. You only need to follow the instructions in this section once for any given device.


Line 15: Line 26:
http://www.droid-life.com/2012/07/17/how-to-unlock-the-nexus-7-bootloader/
http://www.droid-life.com/2012/07/17/how-to-unlock-the-nexus-7-bootloader/


Short story, enable <span class="caps">USB</span> debugging in “Settings -&gt; Developer options”. If you don’t see it you probably have Android 4.2 and need to go to “Settings -&gt; About tablet” and tap the “Build number” entry seven times, and it will tell you “You are now a developer!.
Short story, enable USB debugging in "Settings-> Developer options". If you don't see it you probably have Android 4.2 and need to go to "Settings -> About tablet" and tap the "Build number" entry seven times, and it will tell you "You are now a developer!".


Then follow these steps:
Then follow these steps:


The adb and fastboot tools come with the Android <span class="caps">SDK</span> (adb.exe and fastboot.exe on Windows). You can run “adb devices” to make sure that the computer recognizes the Nexus 7.
<code>
./adb reboot bootloader
sudo ./fastboot oem unlock
</code>


At this point you might need to re-enable <span class="caps">USB</span> debugging in the settings before continuing with the flashing.
The adb and fastboot tools come with the Android SDK (adb.exe and fastboot.exe on Windows). You can run "adb devices" to make sure that the computer recognizes the Nexus 7.


=Flashing device=
At this point you might need to re-enable USB debugging in the settings before continuing with the flashing.


= Flashing device =
Now we can flash the device with the images that we built earlier (replace ~/korhal with your build directory).
Now we can flash the device with the images that we built earlier (replace ~/korhal with your build directory).


=Playing=
<code>
./adb reboot bootloader
sudo ./fastboot flash boot~/korhal/out/target/product/grouper/boot.img
sudo ./fastboot flash system ~/korhal/out/target/product/grouper/system.img # might take a minute or more
sudo ./fastboot erase userdata
</code>


==Fonts==
== Playing ==
=== Fonts ===
To fix "QFontDatabase: Cannot find font directory /system//lib/fonts - is Qt installed correctly?" I needed to do the following in adb shell (run "./adb shell" on the host to start a shell running on the device):


To fix “QFontDatabase: Cannot find font directory /system//lib/fonts – is Qt installed correctly?” I needed to do the following in adb shell (run “./adb shell” on the host to start a shell running on the device):
<code>
mount -o remount,rw /system
</code>


Then, from the host:
Then, from the host:


==Touch input==
<code>
adb push~/korhal/qt/qtbase/lib/fonts/ /system/lib/fonts/
</code>


=== Touch input ===
At the moment, you need to manually build qtbase/src/plugins/generic/evdevtouch and push it to the device.
At the moment, you need to manually build qtbase/src/plugins/generic/evdevtouch and push it to the device.


First, on the device, run “mkdir /system/plugins/generic”. Then, from the host:
First, on the device, run "mkdir /system/plugins/generic". Then, from the host:


==Visual splendor==
<code>
cd ~/korhal/qt/qtbase/src/plugins/generic/evdevtouch
~/korhal/qt/qtbase/bin/qmake && make
adb push ~/korhal/qt/qtbase/plugins/generic/libqevdevtouchplugin.so /system/plugins/generic/libqevdevtouchplugin.so
</code>


To get qmlscene to show something on top of the system UI, you’ll need edit ~/korhal/qt/qtbase/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp and change mControl-&gt;setLayer(0×00000001); to mControl-&gt;setLayer(0×40000000);
=== Visual splendor ===
To get qmlscene to show something on top of the system UI, you'll need edit~/korhal/qt/qtbase/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp and change mControl->setLayer(0x00000001); to mControl->setLayer(0x40000000);


Then, re-build the eglfs plugin and push it.
Then, re-build the eglfs plugin and push it.


==Running qmlscene==
<code>
cd~/korhal/qt/qtbase/src/plugins/platforms/eglfs
~/korhal/qt/qtbase/bin/qmake && make
adb push~/korhal/qt/qtbase/plugins/platforms/libqeglfs.so /system/plugins/platforms
</code>


First we copy over a simple qml example, then we run qmlscene remotely. It’s also possible to run it from the shell after doing “adb shell”.
=== Running qmlscene ===
 
First we copy over a simple qml example, then we run qmlscene remotely. It's also possible to run it from the shell after doing "adb shell".
 
<code>
adb push ~/korhal/qt/qtdeclarative/examples/quick/mousearea/mousearea.qml /data/mousearea.qml
adb shell qmlscene /data/mousearea.qml -plugin evdevtouch:/dev/input/event0
</code>

Latest revision as of 20:20, 28 June 2015

Building

mkdir ~/korhal # or wherever you want your checkout
cd~/korhal
repo init -u git@gitorious.org:korhal/manifest.git
repo sync
source build/envsetup.sh

For each of the tgz's here, extract and execute the binary inside the source tree (~/korhal if using the above instructions):

https://developers.google.com/android/nexus/drivers#grouperjzo54k

The hardware name for the Nexus 7 is "grouper", thus we initialize lunch with that.

lunch full_grouper-eng
make -j8

Preparing device

This will wipe your Nexus 7 device, make sure you have backed up anything you wish to keep. You only need to follow the instructions in this section once for any given device.

The bootloader needs to be unlocked:

http://www.droid-life.com/2012/07/17/how-to-unlock-the-nexus-7-bootloader/

Short story, enable USB debugging in "Settings-> Developer options". If you don't see it you probably have Android 4.2 and need to go to "Settings -> About tablet" and tap the "Build number" entry seven times, and it will tell you "You are now a developer!".

Then follow these steps:

./adb reboot bootloader
sudo ./fastboot oem unlock

The adb and fastboot tools come with the Android SDK (adb.exe and fastboot.exe on Windows). You can run "adb devices" to make sure that the computer recognizes the Nexus 7.

At this point you might need to re-enable USB debugging in the settings before continuing with the flashing.

Flashing device

Now we can flash the device with the images that we built earlier (replace ~/korhal with your build directory).

./adb reboot bootloader
sudo ./fastboot flash boot~/korhal/out/target/product/grouper/boot.img
sudo ./fastboot flash system ~/korhal/out/target/product/grouper/system.img # might take a minute or more
sudo ./fastboot erase userdata

Playing

Fonts

To fix "QFontDatabase: Cannot find font directory /system//lib/fonts - is Qt installed correctly?" I needed to do the following in adb shell (run "./adb shell" on the host to start a shell running on the device):

mount -o remount,rw /system

Then, from the host:

adb push~/korhal/qt/qtbase/lib/fonts/ /system/lib/fonts/

Touch input

At the moment, you need to manually build qtbase/src/plugins/generic/evdevtouch and push it to the device.

First, on the device, run "mkdir /system/plugins/generic". Then, from the host:

cd ~/korhal/qt/qtbase/src/plugins/generic/evdevtouch
~/korhal/qt/qtbase/bin/qmake && make
adb push ~/korhal/qt/qtbase/plugins/generic/libqevdevtouchplugin.so /system/plugins/generic/libqevdevtouchplugin.so

Visual splendor

To get qmlscene to show something on top of the system UI, you'll need edit~/korhal/qt/qtbase/mkspecs/unsupported/android-g++/qeglfshooks_surfaceflinger.cpp and change mControl->setLayer(0x00000001); to mControl->setLayer(0x40000000);

Then, re-build the eglfs plugin and push it.

cd~/korhal/qt/qtbase/src/plugins/platforms/eglfs
~/korhal/qt/qtbase/bin/qmake && make
adb push~/korhal/qt/qtbase/plugins/platforms/libqeglfs.so /system/plugins/platforms

Running qmlscene

First we copy over a simple qml example, then we run qmlscene remotely. It's also possible to run it from the shell after doing "adb shell".

adb push ~/korhal/qt/qtdeclarative/examples/quick/mousearea/mousearea.qml /data/mousearea.qml
adb shell qmlscene /data/mousearea.qml -plugin evdevtouch:/dev/input/event0