From: Marcus Comstedt Date: Wed, 16 Jul 2014 14:56:43 +0000 (+0200) Subject: Added files for building Android APK X-Git-Tag: pulseview-0.3.0~567 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a4ef39937e784acf7b8a1039bbd353b559c40233;p=pulseview.git Added files for building Android APK --- diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 00000000..62a493fc --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,16 @@ +/libs/ +/assets/ +/res/drawable/ +/res/values/bundled_libs.xml +/res/*/strings.xml +/res/xml/device_filter.xml +/build.xml +/project.properties +/local.properties +/proguard-project.txt +/bin/ +/gen/ +/ant/build/ +/ant/tasks.jar +/src/org/qtproject/ +/src/org/kde/ diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml new file mode 100644 index 00000000..3609c569 --- /dev/null +++ b/android/AndroidManifest.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/bundled_libs.xml.in b/android/bundled_libs.xml.in new file mode 100644 index 00000000..7ddaddf0 --- /dev/null +++ b/android/bundled_libs.xml.in @@ -0,0 +1,6 @@ + + + +@bundled_libs@ + + diff --git a/android/custom_rules.xml b/android/custom_rules.xml new file mode 100644 index 00000000..7331fe91 --- /dev/null +++ b/android/custom_rules.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/res/layout/splash.xml b/android/res/layout/splash.xml new file mode 100644 index 00000000..6875521a --- /dev/null +++ b/android/res/layout/splash.xml @@ -0,0 +1,2 @@ + + diff --git a/android/res/values/libs.xml b/android/res/values/libs.xml new file mode 100644 index 00000000..8aa5afae --- /dev/null +++ b/android/res/values/libs.xml @@ -0,0 +1,22 @@ + + + + https://download.qt-project.org/ministro/android/qt5/qt-5.3 + + + + + Qt5Core + Qt5Gui + Qt5Widgets + Qt5Svg + + + + + + + + + + diff --git a/android/res/values/strings-pv.xml b/android/res/values/strings-pv.xml new file mode 100644 index 00000000..991a086d --- /dev/null +++ b/android/res/values/strings-pv.xml @@ -0,0 +1,4 @@ + + + PulseView + diff --git a/android/src/org/sigrok/pulseview/PulseViewActivity.java b/android/src/org/sigrok/pulseview/PulseViewActivity.java new file mode 100644 index 00000000..32f6c79b --- /dev/null +++ b/android/src/org/sigrok/pulseview/PulseViewActivity.java @@ -0,0 +1,51 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Marcus Comstedt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.sigrok.pulseview; + +import org.qtproject.qt5.android.bindings.QtActivity; +import org.sigrok.androidutils.UsbSupplicant; + +import android.os.Bundle; + +public class PulseViewActivity extends QtActivity +{ + private UsbSupplicant supplicant; + + @Override + public void onCreate(Bundle savedInstanceState) + { + super.onCreate(savedInstanceState); + supplicant = new UsbSupplicant(getApplicationContext(), R.xml.device_filter); + } + + @Override + protected void onStart() + { + super.onStart(); + supplicant.start(); + } + + @Override + protected void onStop() + { + supplicant.stop(); + super.onStop(); + } +} diff --git a/android/src/org/sigrok/pulseview/PulseViewApplication.java b/android/src/org/sigrok/pulseview/PulseViewApplication.java new file mode 100644 index 00000000..ba30b50f --- /dev/null +++ b/android/src/org/sigrok/pulseview/PulseViewApplication.java @@ -0,0 +1,39 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Marcus Comstedt + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package org.sigrok.pulseview; + +import org.qtproject.qt5.android.bindings.QtApplication; +import org.sigrok.androidutils.Environment; +import org.sigrok.androidutils.UsbHelper; + +import java.io.File; +import java.io.IOException; + +public class PulseViewApplication extends QtApplication +{ + @Override + public void onCreate() + { + Environment.initEnvironment(getApplicationInfo().sourceDir); + UsbHelper.setContext(getApplicationContext()); + super.onCreate(); + } +} +