On 24 June, 2014 - Venkatesh Shukla wrote: > On Mon, Jun 23, 2014 at 11:28 PM, Venkatesh Shukla < > venkatesh.shukla.ee...@iitbhu.ac.in> wrote: > > > > > > > > > On Mon, Jun 23, 2014 at 8:18 PM, Venkatesh Shukla < > > venkatesh.shukla.ee...@iitbhu.ac.in> wrote: > > > >> Hello > >> > >> For building subsurface on android, a template is needed. In this > >> template, android specific files, like AndroidManifest.xml, java files and > >> android xml files among others would be added. I am attaching a patch which > >> does takes care of this template while building for android. > >> The included manifest file contains permissions for USB usage on android > >> and device_filter.xml file to recognize the supported devices. > >> > >> -- > >> Venkatesh Shukla > >> > >> > > On suggestion of Anton, I have changed the package name to > > 'org.subsurface'. Other modifications include inclusion of string.xml for > > proper naming of application and proper formatting of AndroidManifest.xml > > and setting default orientation to landscape. > > > > -- > > Venkatesh Shukla > > > > Launcher icon suitable for various screen resolutions are now included. > Instead of the previous patches, this should be applied. >
Finally i got some time to do a proper review of this. > From ebcf2e0e648f18478d889fcbdb81bc17c3cf8979 Mon Sep 17 00:00:00 2001 > From: Venkatesh Shukla <venkatesh.shukla.ee...@iitbhu.ac.in> > Date: Mon, 23 Jun 2014 17:18:17 +0530 > Subject: [PATCH] Template for subsurface android package > > For modifications to the final source code of built android package > such as permission additions and inclusion of xml and java files, it > is necessary to maintain a template. The template is copied without > any modifications on top of qt android-template before building > subsurface libraries. ( Refer: http://goo.gl/z44dQC ) I would recommend using the proper link here: http://qt-project.org/doc/qt-5/deployment-android.html#qmake-variables Its long and ugly, but its a bit clearer what you mean. > > All android specific files would be added to android subdirectory. > This isn't really true. The android.cpp file is android specific but shouldn't live in that directory. This needs rephrasing. > In this commit, permission for usage of USB devices is added to > AndroidManifest.xml. Also included is device_filter.xml. When > devices having VID, PID listed in this file is attached to android, > a dialogbox is displayed asking for permission for subsurface to > use this USB device. Accepting it would take you straight to subsurface > application. > I would move this to a separate commit. When this is applied subsurface knows nothing about usb devices, and i would hold off on those patches until that code reaches some sort of state that it can land in this repo. I refrained from commenting more on this below. > diff --git a/.gitignore b/.gitignore > index 9272286..24e8eb7 100644 > --- a/.gitignore > +++ b/.gitignore > @@ -30,3 +30,5 @@ Makefile > subsurface.pro.user* > Subsurface.app > .DS_Store > +!android/**/*.xml > + Trailing newline here. > diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml > new file mode 100644 > index 0000000..314d58e > --- /dev/null > +++ b/android/AndroidManifest.xml > @@ -0,0 +1,118 @@ > +<?xml version='1.0' encoding='utf-8'?> > +<manifest xmlns:android="http://schemas.android.com/apk/res/android" > + package="org.subsurface" > + android:installLocation="auto" > + android:versionCode="1" > + android:versionName="1.0" > > + > + <application > + android:name="org.qtproject.qt5.android.bindings.QtApplication" > + android:hardwareAccelerated="true" > + android:label="@string/app_name" > + android:icon="@drawable/subsurface_icon" > > + <activity > + android:name="org.qtproject.qt5.android.bindings.QtActivity" > + > android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation" > + android:label="@string/app_name" > + android:launchMode="singleTop" > + android:screenOrientation="sensorLandscape" > I'm not sure about locking the beast to landscape. On my Nexus 5 the app is about as useful in portrait to. ... > diff --git a/android/res/xml/device_filter.xml > b/android/res/xml/device_filter.xml > new file mode 100644 > index 0000000..822680b > --- /dev/null > +++ b/android/res/xml/device_filter.xml > @@ -0,0 +1,16 @@ > +<?xml version="1.0" encoding="utf-8"?> > + > +<resources> > + <!-- FTDI Chips --> > + <!-- (Smart Interface), Heinrichs Weikamp --> > + <usb-device vendor-id="1027" product-id="24577"/> > + <usb-device vendor-id="1027" product-id="24592"/> > + <usb-device vendor-id="1027" product-id="24593"/> > + <!-- Oceanic Custom PID --> > + <usb-device vendor-id="1027" product-id="62560"/> > + <!-- Suunto Custom PID --> > + <usb-device vendor-id="1027" product-id="63104"/> > + <!-- Cressi (Leonardo) Custom PID --> > + <usb-device vendor-id="1027" product-id="63104"/> > +</resources> > + Another trailing newline here. The rest of it looks good to me. //Anton -- Anton Lundin +46702-161604 _______________________________________________ subsurface mailing list subsurface@hohndel.org http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface