diff --git a/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java b/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
index 37e387ceb3..bccf333eb6 100644
--- a/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
@@ -27,7 +27,6 @@ public class NauticalMapsPlugin extends OsmandPlugin {
@Override
public int getLogoResourceId() {
- // TODO
return R.drawable.ic_plugin_nautical_map;
}
diff --git a/plugins/Osmand-Nautical/.classpath b/plugins/Osmand-Nautical/.classpath
new file mode 100644
index 0000000000..7bc01d9a9c
--- /dev/null
+++ b/plugins/Osmand-Nautical/.classpath
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/plugins/Osmand-Nautical/.gitignore b/plugins/Osmand-Nautical/.gitignore
new file mode 100644
index 0000000000..5978954c17
--- /dev/null
+++ b/plugins/Osmand-Nautical/.gitignore
@@ -0,0 +1,5 @@
+bin
+gen
+raw
+obj
+*.iml
diff --git a/plugins/Osmand-Nautical/.project b/plugins/Osmand-Nautical/.project
new file mode 100644
index 0000000000..69d5b60769
--- /dev/null
+++ b/plugins/Osmand-Nautical/.project
@@ -0,0 +1,33 @@
+
+
+ Osmand-Nautical
+
+
+
+
+
+ com.android.ide.eclipse.adt.ResourceManagerBuilder
+
+
+
+
+ com.android.ide.eclipse.adt.PreCompilerBuilder
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ com.android.ide.eclipse.adt.ApkBuilder
+
+
+
+
+
+ com.android.ide.eclipse.adt.AndroidNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/plugins/Osmand-Nautical/AndroidManifest.xml b/plugins/Osmand-Nautical/AndroidManifest.xml
new file mode 100644
index 0000000000..69b47a7196
--- /dev/null
+++ b/plugins/Osmand-Nautical/AndroidManifest.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/Osmand-Nautical/build.gradle b/plugins/Osmand-Nautical/build.gradle
new file mode 100644
index 0000000000..9d9cc05dd9
--- /dev/null
+++ b/plugins/Osmand-Nautical/build.gradle
@@ -0,0 +1,67 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 21
+ buildToolsVersion "21.1.2"
+
+ signingConfigs {
+ development {
+ storeFile file("../../keystores/debug.keystore")
+ storePassword "android"
+ keyAlias "androiddebugkey"
+ keyPassword "android"
+ }
+
+ publishing {
+ storeFile file("../../osmand_key")
+ storePassword System.getenv("OSMAND_APK_PASSWORD")
+ keyAlias "androiddebugkey"
+ keyPassword System.getenv("OSMAND_APK_PASSWORD")
+ }
+ }
+
+ defaultConfig {
+ minSdkVersion 9
+ targetSdkVersion 21
+ }
+
+ lintOptions {
+ abortOnError false
+ }
+
+ sourceSets {
+ main {
+ manifest.srcFile "AndroidManifest.xml"
+ jni.srcDirs = []
+ jniLibs.srcDirs = []
+ aidl.srcDirs = ["src"]
+ java.srcDirs = ["src"]
+ resources.srcDirs = ["src"]
+ renderscript.srcDirs = ["src"]
+ res.srcDirs = ["res"]
+ assets.srcDirs = ["assets"]
+ }
+ }
+
+ buildTypes {
+ debug {
+ signingConfig signingConfigs.development
+ }
+ release {
+ signingConfig signingConfigs.publishing
+ }
+ }
+}
+
+repositories {
+ ivy {
+ name = "OsmAndBinariesIvy"
+ url = "http://builder.osmand.net"
+ layout "pattern", {
+ artifact "ivy/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
+ }
+ }
+}
+
+dependencies {
+}
diff --git a/plugins/Osmand-Nautical/proguard-project.txt b/plugins/Osmand-Nautical/proguard-project.txt
new file mode 100644
index 0000000000..f2fe1559a2
--- /dev/null
+++ b/plugins/Osmand-Nautical/proguard-project.txt
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
diff --git a/plugins/Osmand-Nautical/project.properties b/plugins/Osmand-Nautical/project.properties
new file mode 100644
index 0000000000..4ab125693c
--- /dev/null
+++ b/plugins/Osmand-Nautical/project.properties
@@ -0,0 +1,14 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system edit
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+#
+# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
+#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
+
+# Project target.
+target=android-19
diff --git a/plugins/Osmand-Nautical/res/drawable-hdpi/ic_launcher.png b/plugins/Osmand-Nautical/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000000..96a442e5b8
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-hdpi/ic_launcher.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-hdpi/icon.png b/plugins/Osmand-Nautical/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000000..1426adff51
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-hdpi/icon.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-ldpi/ic_launcher.png b/plugins/Osmand-Nautical/res/drawable-ldpi/ic_launcher.png
new file mode 100644
index 0000000000..99238729d8
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-ldpi/ic_launcher.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-ldpi/icon.png b/plugins/Osmand-Nautical/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000000..c99e8a25f7
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-ldpi/icon.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-mdpi/ic_launcher.png b/plugins/Osmand-Nautical/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000000..359047dfa4
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-mdpi/ic_launcher.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-mdpi/icon.png b/plugins/Osmand-Nautical/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000000..15eeaf60c2
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-mdpi/icon.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-xhdpi/ic_launcher.png b/plugins/Osmand-Nautical/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000000..71c6d760f0
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-xhdpi/ic_launcher.png differ
diff --git a/plugins/Osmand-Nautical/res/drawable-xhdpi/icon.png b/plugins/Osmand-Nautical/res/drawable-xhdpi/icon.png
new file mode 100644
index 0000000000..8c9caab40c
Binary files /dev/null and b/plugins/Osmand-Nautical/res/drawable-xhdpi/icon.png differ
diff --git a/plugins/Osmand-Nautical/res/layout/main.xml b/plugins/Osmand-Nautical/res/layout/main.xml
new file mode 100644
index 0000000000..35e8b132cc
--- /dev/null
+++ b/plugins/Osmand-Nautical/res/layout/main.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/plugins/Osmand-Nautical/res/values/strings.xml b/plugins/Osmand-Nautical/res/values/strings.xml
new file mode 100644
index 0000000000..e51be9daf3
--- /dev/null
+++ b/plugins/Osmand-Nautical/res/values/strings.xml
@@ -0,0 +1,8 @@
+
+
+ No
+ Yes
+ OsmAnd is not installed
+ OsmAnd Nautical
+ OsmAnd Nautical Plugin is installed and enabled in OsmAnd settings.
+
\ No newline at end of file
diff --git a/plugins/Osmand-Nautical/src/net/osmand/parkingPlugin/NauticalActivity.java b/plugins/Osmand-Nautical/src/net/osmand/parkingPlugin/NauticalActivity.java
new file mode 100644
index 0000000000..0fa62f92a2
--- /dev/null
+++ b/plugins/Osmand-Nautical/src/net/osmand/parkingPlugin/NauticalActivity.java
@@ -0,0 +1,61 @@
+package net.osmand.parkingPlugin;
+
+import net.osmand.nauticalPlugin.R;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.ActivityNotFoundException;
+import android.content.ComponentName;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.net.Uri;
+import android.os.Bundle;
+
+public class NauticalActivity extends Activity {
+ private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
+ private static final String OSMAND_COMPONENT_PLUS = "net.osmand.plus"; //$NON-NLS-1$
+ private static final String OSMAND_ACTIVITY = "net.osmand.plus.activities.MapActivity"; //$NON-NLS-1$
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main);
+
+ Intent intentPlus = new Intent();
+ intentPlus.setComponent(new ComponentName(OSMAND_COMPONENT_PLUS, OSMAND_ACTIVITY));
+ intentPlus.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+ ResolveInfo resolved = getPackageManager().resolveActivity(intentPlus, PackageManager.MATCH_DEFAULT_ONLY);
+ if(resolved != null) {
+ stopService(intentPlus);
+ startActivity(intentPlus);
+ } else {
+ Intent intentNormal = new Intent();
+ intentNormal.setFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
+ intentNormal.setComponent(new ComponentName(OSMAND_COMPONENT, OSMAND_ACTIVITY));
+ resolved = getPackageManager().resolveActivity(intentNormal, PackageManager.MATCH_DEFAULT_ONLY);
+ if (resolved != null) {
+ stopService(intentNormal);
+ startActivity(intentNormal);
+ } else {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setMessage(getString(R.string.osmand_app_not_found));
+ builder.setPositiveButton(getString(R.string.shared_string_yes), new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + OSMAND_COMPONENT_PLUS));
+ try {
+ stopService(intent);
+ startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ }
+ }
+ });
+ builder.setNegativeButton(getString(R.string.shared_string_no), null);
+ builder.show();
+ }
+ }
+ }
+
+}
\ No newline at end of file