Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 29
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "fr.geolabs.dev.mapmint4me"
minSdkVersion 16
minSdkVersion 24
targetSdkVersion 29
versionCode 53
versionName "1.0"
Expand All @@ -17,8 +17,15 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

aaptOptions {
noCompress = ['.unity3d', '.ress', '.resource', '.obb', 'arvideo', 'arvideo.manifest', 'streamingassets', 'streamingassets.manifest']
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
}

productFlavors {
}

lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
Expand All @@ -28,13 +35,15 @@ android {
}

dependencies {
//implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':unityLibrary')
// implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-compat:27.1.0'
api 'com.google.android.gms:play-services:12.0.1'
api 'com.google.android.gms:play-services-gcm:9.0.2'
api 'com.google.android.gms:play-services-location:12.0.1'
api 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
implementation 'com.android.support:support-annotations:28.0.0'
//implementation 'com.android.support:leanback-v17:26.1.0'
}
23 changes: 18 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL" />
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL"
tools:ignore="ProtectedPermissions" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="27" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"
tools:ignore="UniquePermission" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
Expand All @@ -30,18 +32,21 @@
<supports-screens android:anyDensity="true" />
<permission
android:name="fr.meteolib.android.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
android:protectionLevel="signature"
tools:ignore="UniquePermission" />
<uses-permission android:name="fr.meteolib.android.permission.C2D_MESSAGE" />


<application
android:hardwareAccelerated="true"
android:networkSecurityConfig="@xml/network_security_config"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:replace="android:icon">


<activity
android:name=".MapMint4ME"
android:configChanges="orientation|keyboardHidden|screenSize"
Expand Down Expand Up @@ -99,6 +104,14 @@
android:pathPattern="/addServer/.*/.*" />
</intent-filter>
</activity>

<activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="fullSensor">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>

<activity
android:name=".WelcomeScreen"
android:configChanges="orientation|keyboardHidden|screenSize"
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/assets/content/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@
</div>
</div>
</div>

<div class="col-xs-6 col-sm-3" style="margin-top: 15px;">
<a id="arDrawbtn" class="btn btn-lg btn-default btn-block" href="#" role="button">
<center>
<button class="btn btn-lg btn-warning btn-block btn-circle-lg" >
<span class="glyphicon glyphicon-road" aria-hidden="true"></span>
</button>
</center>
ARDraw</a>
</div>

<script id="edit_list" type="text/template">
<a id="tbl_[id]" class="list-group-item" href="#tbl[id]" data-id="[id]" data-name="[name]" data-title="[title]">
<span class="badge">[nb]</span>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/assets/scripts/edit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
$(".mm4me_listing").hide();
var runOnce=true;

document.getElementById ("arDrawbtn").addEventListener("click", function(){
window.Android.OnButtonClick();
});

$(function(){
if(!runOnce)
return;
Expand Down
28 changes: 26 additions & 2 deletions app/src/main/java/fr/geolabs/dev/mapmint4me/WebAppInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import android.*;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
Expand All @@ -22,6 +24,7 @@
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.RequiresApi;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat;
Expand All @@ -30,11 +33,15 @@
import android.util.Patterns;
import android.view.Display;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.widget.EditText;
import android.widget.Toast;

import com.unity3d.player.UnityPlayerActivity;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -74,6 +81,8 @@

import javax.net.ssl.HttpsURLConnection;

import static android.support.v4.content.ContextCompat.startActivity;


public class WebAppInterface {
private boolean mCenter = false;
Expand Down Expand Up @@ -109,6 +118,18 @@ public void showToast(String toast) {
private NotificationManager mManager;
private int currentId=0;

@JavascriptInterface
public void OnButtonClick()
{
Intent intent = new Intent(mContext, UnityPlayerActivity.class);
try{
mContext.startActivity(intent);
}
catch (Exception e){

}
}

@JavascriptInterface
public void invokeNavigation(String path){
Uri gmmIntentUri = Uri.parse("google.navigation:q="+path);
Expand Down Expand Up @@ -263,6 +284,7 @@ public void onLocationChanged(final Location location) {
return (jsonArray.toString());
}

@RequiresApi(api = Build.VERSION_CODES.N)
@JavascriptInterface
public String getGPS() throws Exception {

Expand Down Expand Up @@ -847,6 +869,7 @@ public boolean getTilesDownloadStatus() {
return ((MapMint4ME)mContext).getDownloadStatus();
}

@SuppressLint("LongLogTag")
@JavascriptInterface
public boolean copyFile(String src,String dest) {
File asset_dir = new File(mContext.getFilesDir() + File.separator + "data");
Expand Down Expand Up @@ -891,7 +914,8 @@ public void refreshDbs() {
db=null;
}

public boolean copyFileA(String src,String dest) {
@SuppressLint("LongLogTag")
public boolean copyFileA(String src, String dest) {
File asset_dir = new File(mContext.getFilesDir() + File.separator + "data");
String srcName = mContext.getExternalFilesDir(null).getAbsolutePath() + File.separator + src;
String destName = asset_dir.getAbsolutePath() + File.separator + dest;
Expand Down Expand Up @@ -962,7 +986,7 @@ public long getSizeOfFile(String path) {
}
}

@TargetApi(Build.VERSION_CODES.KITKAT)
@RequiresApi(api = Build.VERSION_CODES.O)
@JavascriptInterface
public int SplitFile(String path)
{
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<resources>
<string name="game_view_content_description" translatable="false">Game view</string>
<string name="app_name">MapMint4ME</string>
<string name="table">Table</string>
<string name="save">Save</string>
Expand Down
32 changes: 17 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
allprojects {
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
}

allprojects {
repositories {
jcenter()
google()
flatDir {
dirs "${project(':unityLibrary').projectDir}/libs"
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
org.gradle.jvmargs=-Xmx3096M
org.gradle.jvmargs=-Xmx4096M
org.gradle.parallel=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include ':app'

include 'unityLibrary'
project(':unityLibrary').projectDir = new File('..\\ARDraw-MM4ME\\ARDraw\\AndroidBuild\\unityLibrary')
Loading