Added android manifest and launcher icons.
Do not use pkg-config when cross-compiling to Android. Added a helper class to send toasts and dialogs to the user. Added android compatibility on some headers.
This commit is contained in:
40
android/AndroidManifest.xml
Normal file
40
android/AndroidManifest.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.2.5" android:installLocation="auto" package="com.github.codestation.qcma" android:versionCode="1">
|
||||
<application android:label="qcma" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:icon="@drawable/icon">
|
||||
<activity android:screenOrientation="unspecified" android:label="@string/app_name" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN"/>
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
<meta-data android:value="qcma" android:name="android.app.lib_name"/>
|
||||
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
|
||||
<meta-data android:value="default" android:name="android.app.repository"/>
|
||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
|
||||
<!-- Deploy Qt libs as part of package -->
|
||||
<meta-data android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --" android:name="android.app.bundle_local_qt_libs"/>
|
||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||
<!-- Run with local libs -->
|
||||
<meta-data android:value="-- %%USE_LOCAL_QT_LIBS%% --" android:name="android.app.use_local_qt_libs"/>
|
||||
<meta-data android:value="/data/local/tmp/qt/" android:name="android.app.libs_prefix"/>
|
||||
<meta-data android:value="-- %%INSERT_LOCAL_LIBS%% --" android:name="android.app.load_local_libs"/>
|
||||
<meta-data android:value="-- %%INSERT_LOCAL_JARS%% --" android:name="android.app.load_local_jars"/>
|
||||
<meta-data android:value="-- %%INSERT_INIT_CLASSES%% --" android:name="android.app.static_init_classes"/>
|
||||
<!-- Messages maps -->
|
||||
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
|
||||
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
|
||||
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
|
||||
<!-- Messages maps -->
|
||||
<!-- Splash screen -->
|
||||
<meta-data android:name="android.app.splash_screen" android:resource="@layout/splash"/>
|
||||
<!-- Splash screen -->
|
||||
</activity>
|
||||
</application>
|
||||
<uses-sdk android:targetSdkVersion="19" android:minSdkVersion="10"/>
|
||||
<supports-screens android:normalScreens="true" android:smallScreens="true" android:largeScreens="true" android:anyDensity="true"/>
|
||||
<!-- %%INSERT_PERMISSIONS -->
|
||||
<!-- %%INSERT_FEATURES -->
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
</manifest>
|
||||
BIN
android/res/drawable-hdpi/icon.png
Normal file
BIN
android/res/drawable-hdpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
BIN
android/res/drawable-ldpi/icon.png
Normal file
BIN
android/res/drawable-ldpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 555 B |
BIN
android/res/drawable-mdpi/icon.png
Normal file
BIN
android/res/drawable-mdpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 755 B |
BIN
android/res/drawable-xhdpi/icon.png
Normal file
BIN
android/res/drawable-xhdpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
android/res/drawable-xxhdpi/icon.png
Normal file
BIN
android/res/drawable-xxhdpi/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,34 @@
|
||||
package com.github.codestation.qcma;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.widget.Toast;
|
||||
import android.app.AlertDialog;
|
||||
|
||||
public class QcmaNotification extends org.qtproject.qt5.android.bindings.QtActivity
|
||||
{
|
||||
private static QcmaNotification m_instance;
|
||||
|
||||
public QcmaNotification()
|
||||
{
|
||||
m_instance = this;
|
||||
}
|
||||
|
||||
public static void showToast(String message)
|
||||
{
|
||||
Context context = m_instance.getApplicationContext();
|
||||
Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
|
||||
public static void showDialog(String message)
|
||||
{
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(m_instance);
|
||||
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
}
|
||||
});
|
||||
builder.setMessage(message).setTitle("QCMA message");
|
||||
AlertDialog dialog = builder.create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user