diff --git a/AerisDemo/build.gradle b/AerisDemo/build.gradle index 6fe35ed4..15a32ff1 100644 --- a/AerisDemo/build.gradle +++ b/AerisDemo/build.gradle @@ -2,20 +2,20 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 27 - buildToolsVersion "27.0.3" + compileSdkVersion 30 + buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 19 applicationId "com.example.demoaerisproject" - versionCode 10 - targetSdkVersion 27 - versionName "2.6.0" + versionCode 12 + targetSdkVersion 30 + versionName "2.6.1" //multiDexEnabled true signingConfigs { config { keyAlias 'demoprojkey' keyPassword 'password' - storeFile file('C:/Projects/AndroidStudioProjects/AerisAndroidSDK/AerisDemo/demoprojkeystore.jks') + storeFile file('/Users/Lee/AndroidStudioProjects/AerisAndroidSDK/AerisDemo/demoprojkeystore.jks') storePassword 'password' } } @@ -59,27 +59,28 @@ buildscript { mavenCentral() google() jcenter() -// maven { url maven_staging_url } + //maven { url maven_staging_url } } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' + classpath 'com.android.tools.build:gradle:4.0.1' } } + repositories { mavenCentral() google() jcenter() -// maven { url maven_staging_url } + //maven { url maven_staging_url } } dependencies { testImplementation 'junit:junit:4.12' - implementation ('com.aerisweather:aeris-maps-lib:2.6.0@aar') { + implementation ('com.aerisweather:aeris-maps-lib:2.6.1@aar') { transitive true } - androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'com.google.android.gms:play-services-maps:15.0.1' - implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.google.android.gms:play-services-maps:17.0.0' + implementation 'androidx.appcompat:appcompat:1.2.0' } \ No newline at end of file diff --git a/AerisDemo/gradle.properties b/AerisDemo/gradle.properties index 1045a350..827ccfff 100644 --- a/AerisDemo/gradle.properties +++ b/AerisDemo/gradle.properties @@ -1,4 +1,6 @@ org.gradle.jvmargs=-Xmx2048M -maven_staging_url=https://oss.sonatype.org/content/repositories/comaerisweather-1615 +maven_staging_url=https://oss.sonatype.org/content/repositories/comaerisweather-1625 +android.useAndroidX=true +android.enableJetifier=true diff --git a/AerisDemo/gradle/wrapper/gradle-wrapper.properties b/AerisDemo/gradle/wrapper/gradle-wrapper.properties index 62df0335..44136118 100644 --- a/AerisDemo/gradle/wrapper/gradle-wrapper.properties +++ b/AerisDemo/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Dec 14 13:12:43 CST 2017 +#Fri Sep 11 12:37:59 CDT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip diff --git a/AerisDemo/res/drawable/AerisWeather_logo.png b/AerisDemo/res/drawable/aerisweather_logo.png similarity index 100% rename from AerisDemo/res/drawable/AerisWeather_logo.png rename to AerisDemo/res/drawable/aerisweather_logo.png diff --git a/AerisDemo/res/drawable/legend_temp_outlook.png b/AerisDemo/res/drawable/legend_temp_outlook.png new file mode 100644 index 00000000..dc263e8e Binary files /dev/null and b/AerisDemo/res/drawable/legend_temp_outlook.png differ diff --git a/AerisDemo/res/layout/menu_drawer.xml b/AerisDemo/res/layout/menu_drawer.xml index 43bad41e..f4f428c4 100644 --- a/AerisDemo/res/layout/menu_drawer.xml +++ b/AerisDemo/res/layout/menu_drawer.xml @@ -1,5 +1,5 @@ - @@ -106,4 +106,4 @@ android:divider="@color/light_gray" android:dividerHeight="1dp" /> - \ No newline at end of file + \ No newline at end of file diff --git a/AerisDemo/res/menu/main.xml b/AerisDemo/res/menu/main.xml index 120afc82..c3a25499 100644 --- a/AerisDemo/res/menu/main.xml +++ b/AerisDemo/res/menu/main.xml @@ -1,16 +1,17 @@ - + + android:title="@string/action_settings" + app:showAsAction="always" /> + android:icon="@drawable/ic_action_navigation_refresh" + android:title="@string/action_refresh" + app:showAsAction="always" /> diff --git a/AerisDemo/res/menu/menu_maps_fragment.xml b/AerisDemo/res/menu/menu_maps_fragment.xml index fd08d08a..37e4a506 100644 --- a/AerisDemo/res/menu/menu_maps_fragment.xml +++ b/AerisDemo/res/menu/menu_maps_fragment.xml @@ -1,7 +1,8 @@ - + + app:showAsAction="ifRoom|withText" /> diff --git a/AerisDemo/res/menu/menu_search.xml b/AerisDemo/res/menu/menu_search.xml index b4fa49d5..b31cc57a 100644 --- a/AerisDemo/res/menu/menu_search.xml +++ b/AerisDemo/res/menu/menu_search.xml @@ -1,14 +1,14 @@ - + + app:showAsAction="ifRoom" /> + app:showAsAction="ifRoom" /> diff --git a/AerisDemo/src/com/example/customendpoint/CustomSunmoonFragment.java b/AerisDemo/src/com/example/customendpoint/CustomSunmoonFragment.java index 37209574..d2968df6 100644 --- a/AerisDemo/src/com/example/customendpoint/CustomSunmoonFragment.java +++ b/AerisDemo/src/com/example/customendpoint/CustomSunmoonFragment.java @@ -2,7 +2,7 @@ import java.util.List; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; diff --git a/AerisDemo/src/com/example/demoaerisproject/AerisNotification.java b/AerisDemo/src/com/example/demoaerisproject/AerisNotification.java index c00ca018..82f6c461 100644 --- a/AerisDemo/src/com/example/demoaerisproject/AerisNotification.java +++ b/AerisDemo/src/com/example/demoaerisproject/AerisNotification.java @@ -4,7 +4,7 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; -import android.support.v4.app.NotificationCompat; +import androidx.core.app.NotificationCompat; import android.widget.RemoteViews; import com.aerisweather.aeris.logging.Logger; @@ -14,7 +14,6 @@ import com.aerisweather.aeris.response.ObservationResponse; import com.aerisweather.aeris.util.FileUtil; import com.aerisweather.aeris.util.WeatherUtil; -import com.example.service.NotificationJobService; import java.util.HashMap; import java.util.Map; diff --git a/AerisDemo/src/com/example/demoaerisproject/DrawerActivity.java b/AerisDemo/src/com/example/demoaerisproject/DrawerActivity.java index 18480f68..7547107b 100644 --- a/AerisDemo/src/com/example/demoaerisproject/DrawerActivity.java +++ b/AerisDemo/src/com/example/demoaerisproject/DrawerActivity.java @@ -3,9 +3,9 @@ import java.util.ArrayList; import android.annotation.TargetApi; -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentActivity; -import android.support.v4.app.FragmentManager; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; +import androidx.fragment.app.FragmentManager; import android.app.LoaderManager.LoaderCallbacks; import android.content.Intent; import android.content.Loader; @@ -13,8 +13,8 @@ import android.content.res.Configuration; import android.database.Cursor; import android.os.Bundle; -import android.support.v7.app.ActionBarDrawerToggle; -import android.support.v4.widget.DrawerLayout; +import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.drawerlayout.widget.DrawerLayout; import android.util.Log; import android.view.Menu; import android.view.MenuItem; diff --git a/AerisDemo/src/com/example/fragment/AerisFragment.java b/AerisDemo/src/com/example/fragment/AerisFragment.java index bba29f58..c73b64f1 100644 --- a/AerisDemo/src/com/example/fragment/AerisFragment.java +++ b/AerisDemo/src/com/example/fragment/AerisFragment.java @@ -1,7 +1,7 @@ package com.example.fragment; import android.app.Activity; -import android.support.v4.app.Fragment; +import androidx.fragment.app.Fragment; import android.widget.Toast; import com.example.fragment.HeadlessFragment.HeadlessObserver; diff --git a/AerisDemo/src/com/example/fragment/MyMapFragment.java b/AerisDemo/src/com/example/fragment/MyMapFragment.java index c17c5ee4..6120adaf 100644 --- a/AerisDemo/src/com/example/fragment/MyMapFragment.java +++ b/AerisDemo/src/com/example/fragment/MyMapFragment.java @@ -8,9 +8,9 @@ import android.content.pm.PackageManager; import android.location.Location; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; -import android.support.v4.app.Fragment; -import android.support.v4.content.ContextCompat; +import androidx.core.app.ActivityCompat; +import androidx.fragment.app.Fragment; +import androidx.core.content.ContextCompat; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -20,6 +20,7 @@ import android.widget.Toast; import com.aerisweather.aeris.maps.AerisMapContainerView; +import com.aerisweather.aeris.tiles.AerisConstants; import com.example.db.MyPlace; import com.example.db.MyPlacesDb; import com.example.demoaerisproject.MapOptionsLocalActivity; @@ -92,6 +93,8 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa m_container = container; m_savedInstanceState = savedInstanceState; + + View view = inflater.inflate(R.layout.fragment_interactive_maps, container, false); AerisMapContainerView mapContainer = (AerisMapContainerView) view.findViewById(R.id.mapView); m_aerisMapView = mapContainer.getAerisMapView(); @@ -229,6 +232,13 @@ private void initMap() //create a new MapOptions obj m_mapOptions = new AerisMapOptions(); m_aerisAmp.getPermissibleLayers(false); + /* + Example of overriding the default domain for AMP + i.e. using a custom CDN + + AerisConstants.getInstance().setBaseTileSecureUrl("https://maps.yourdomain.com/"); + */ + //set the mapOptions class's AerisAMP obj m_mapOptions.setAerisAMP(m_aerisAmp); @@ -248,6 +258,7 @@ private void initMap() //amp layer(s) AerisAmp aerisAmp = m_mapOptions.getAerisAMP(); + /** * CUSTOM / UNDOCUMENTED LAYER */ @@ -265,12 +276,24 @@ private void initMap() aerisAmp.setLayer(statesAmpLayer); */ + /** + * EXAMPLE: Adding 6-10day outlook with custom legend + */ + /* + AerisAmpLayer outlookAmpLayer = new AerisAmpLayer("temperatures-outlook-6-10d-cpc","temperatures-outlook-6-10d-cpc",100); + outlookAmpLayer.setCustomLayerLegend(R.drawable.legend_temp_outlook); + aerisAmp.setLayer(outlookAmpLayer); + */ + + if (aerisAmp.getActiveMapLayers().size() < 1) { aerisAmp.setDefaultLayers(); } m_aerisMapView.addLayer(aerisAmp); + + //point data layer(s) m_aerisMapView.addLayer(m_mapOptions.getPointData()); @@ -294,10 +317,11 @@ private void initMap() /** * SAMPLE: TROPICAL CYCLONES ERROR CONES */ + /* AerisPolygonData aerisPolygonData = AerisPolygonData.TROPICAL_CYCLONE_ERROR_CONES; m_aerisMapView.addLayer(aerisPolygonData); + */ -// m_aerisMapView.addLayer(m_mapOptions.getPolygonData()); //get a new marker option object MarkerOptions markerOptions = new MarkerOptions(); diff --git a/AerisDemo/src/com/example/service/NotificationJobService.java b/AerisDemo/src/com/example/service/NotificationJobService.java index ee350a61..2df2f114 100644 --- a/AerisDemo/src/com/example/service/NotificationJobService.java +++ b/AerisDemo/src/com/example/service/NotificationJobService.java @@ -5,7 +5,7 @@ import android.os.Build; import android.os.StrictMode; import android.os.SystemClock; -import android.support.annotation.RequiresApi; +import androidx.annotation.RequiresApi; import com.aerisweather.aeris.communication.Action; import com.aerisweather.aeris.communication.AerisRequest; diff --git a/README.md b/README.md index f1dbb70a..3eaf8bb9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The Aeris Android SDK allows a developer to quickly and easily add weather conte ## Getting Started -View the latest installation and implementation details at AerisWeather under the [Aeris Android SDK toolkit documentation] (http://www.aerisweather.com/support/docs/toolkits/aeris-android-sdk/getting-started/). +View the latest installation and implementation details at AerisWeather under the [Aeris Android SDK toolkit documentation](http://www.aerisweather.com/support/docs/toolkits/aeris-android-sdk/getting-started/). ### Aeris API Configuration for the AerisDemo App Before you can begin using the Aeris Android SDK in your project, you will need to download the latest version of the SDK and ensure that you have the required Aeris API keys for your application. @@ -48,44 +48,40 @@ In the resulting dialog, enter the SHA-1 fingerprint, then a semicolon, then The The Google API Console responds by displaying Key for Android apps (with certificates) followed by a forty-character API key. In your Android project, update the meta tag in the Demo Project’s Manifest: -```java - -``` +
<meta-data
+            android:name="com.google.android.maps.v2.API_KEY"
+            android:value="your_api_key" />
+
Note: Your SHA1 can be obtained in Android Studio by running the **"signingReport"** task under the **"Gradle projects"** section. ### Permissions The following permissions are required in order to use the Aeris Android SDK in the application. Please add these to your AndroidManifest.xml: -```java - - - - - - - - - -``` +
<manifest>
+    <uses-permission android:name="android.permission.INTERNET"/>
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
+    <uses-permission android:name="android.permission.ACCESS_COURSE_LOCATION"/>
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+</manifest>
+
### Gradle Configuration The Aeris Core and Aeris Maps libraries are available through Maven Central. To add these dependencies to your project add these lines to your build.gradle file. **Aeris Core:** -```java -repositories { +
repositories {
     mavenCentral()
 }
 dependencies {
     compile 'com.aerisweather:aeris-core-lib:#.#.#@aar'
 }
-``` 
+
**Aeris Maps:** (Note: you do not need to to add Aeris Core seperately if you are using Aeris Maps - the core lib is referenced in the maps lib) -```java -repositories { +
repositories {
     mavenCentral()
 }
 dependencies {
@@ -95,7 +91,7 @@ dependencies {
     compile 'com.google.android.gms:play-services-maps:#.#.#'
     compile 'com.android.support:appcompat-v7:#.#.#'
 }
-``` 
+
##Reference Links