LicenceManager.getInstance().setRestAPIKey("your_rest_api_key");
LicenceManager.getInstance().setMapSDKKey("your_java_script_key");
I have compiled the latest maps sdk 2.3.0. Here .setRestAPIKey() and .setMapSDKKey() methods are not working. Inside the LicenseManager.class I found .setMapmyIndiaBeaconToken() method.
Instead of using LicenceManager use `MapmyIndiaAccountManager' class.
The full implementation is
MapmyIndiaAccountManager.getInstance().setMapSDKKey("your_java_script_key");
MapmyIndiaAccountManager.getInstance().setRestAPIKey("your_rest_api_key");
Related
I'm trying to make my app run in fullscreen mode where the navigation bar and the status bar is hidden. All documentation I can find seems to be deprecated and the only one that I could find that seemed to not be deprecated in Kotlin is setDecorFitsSystemWindows(false) but that errors with
java.lang.NoSuchMethodError: No virtual method setDecorFitsSystemWindows(Z)V in class Landroid/view/Window; or its super classes (declaration of 'android.view.Window' appears in /system/framework/framework.jar!classes3.dex)
How do you make an app fullscreen now in Android Kotlin?
There are one alternative solution.
Update androidx.core library
implementation "androidx.core:core-ktx:1.5.0-alpha05"
Instead of
activity?.window?.setDecorFitsSystemWindows(false)
Use new api
activity?.window?.run{
WindowCompat.setDecorFitsSystemWindows(this, false)
}
I happen unable to add LocationLayerPlugin to my Android project and cannot find any documentation to demonstrate how. Also, I can't find NavigationMapRoute inside package com.mapbox.services.android.navigation.ui.v5. Any help, please?
EDIT:
That's my build.gradle below and when typing LocationLayerPlugin, Android Studio cannot resolve it.
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0#aar') {
transitive = true
}
compile('com.mapbox.mapboxsdk:mapbox-android-services:2.1.3#aar') {
transitive = true
}
compile 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.3.1'
For the LocationLayerPlugin you can use it with two lines of code:
locationLayerPlugin = new LocationLayerPlugin(mapView, mapboxMap, locationEngine);
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
You'll need to make sure to also call the lifecycles in the appropriate methods onStart and onStop. If you are using with navigation and want to use location snapping to the route, you will need to pass in null for the locationEngine and than use forceLocationUpdate inside onProgressChange.
A few examples are available here which show different ways to use the plugin. Documentation will be avliable soon once we release the first final version (currently just producing nightly builds).
For the NavigationMapRoute you'll need to make sure you are using the 0.4.0-snapshot of the Navigation SDK. you'll find it here com.mapbox.services.android.navigation.ui.v5.NavigationMapRoute
I've tried to hook constructors of KeyguardSimPinView,KeyguardViewMediator, KeyguardPasswordView in initZygote().
Only KeyguardSimPinView doesn't work.
I use Android 4.2.2
What can cause this issue?
Looks like KeyguardSimPinView is not used on startup in this ROM, instead KeyguardSimPinPukView is used.
Hooking KeyguardSimPinPukView constructor works ok
I know there are several similar questions regarding this has been asked here, however none of the solutions worked for me.
I have just transferred my application from Ecilpse(juno) to Android Studio 1.5.1; and from API 19 to API 23(compileSdkVersion).
Currently I encountered this error whereby "getResources().getColor(R.color.my_color)" is depreciated and cannot be used.
After searching online, I tried to use "ContextCompat.getColor(context, R.color.my_color)" instead. The error lies at the "getColor" part as it says that it cannot be resolved:
The method "ContextCompat" however allow me to use "getDrawable", "getExternalCacheDirs", "getExternalFilesDirs" and "getObbDirs"; just except for "getColor"
I have also ensure that I have these 2 in my app build.gradle (under dependencies{}):
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
Below are my imports for this class (DetailsActivity):
Additionally, I have also tried using "ResourcesCompat" other than "ContextCompat"; and it still did not work out for me.
I am still a beginner at Android Development, working on a school project.
Can anyone kindly provide some suggestions as of what I am doing wrong and point me towards the right direction? Thanks a lot in advance!
You can use this method.
This is the ContextCompat Developer Link from the Support Library:
public static final int getColor(Context context, int id) {
final int version = Build.VERSION.SDK_INT;
if (version >= 23) {
return ContextCompat.getColor(context, id);
} else {
return context.getResources().getColor(id);
}
}
You don't have to use ContextCompat there if you are compiling with an API level greater than 24 as this is only a compatibility feature for early versions. You can also still use Context.getColor() But notice the method signature! If you just want a color in the default theme you only have to provide the int value of its reference: http://developer.android.com/reference/android/content/Context.html#getColor(int)
You are currently trying to access getColor() with two parameters (Color and Theme) which cannot work there as there is no method who supports these parameters. If you remove the 2nd parameter your current solution will work.
But it would be more convenient to use Context or Resources directly and drop the v4 Appcompat reference if you don't need it.
Before to use this method, fist of all add the Dependencies in build.gradle script. Which is as follows:
dependencies {
// other stuff here
compile 'com.android.support:support-v4:23.0.0'
}
problem in this code ?
its work on android 4 successfully ! but don't work on 2.2 !
i use nineoldandroids library for android API 8
if(Build.VERSION.SDK_INT > 13) {
v.setTranslationX(0.0F);
v.setTranslationY(height);
v.setRotationX(45.0F);
v.setScaleX(0.7F);
v.setScaleY(0.55F);
ViewPropertyAnimator localViewPropertyAnimator =
v.animate().rotationX(0.0F).rotationY(0.0F).translationX(0).translationY(0).setDuration(animDuration).scaleX(
1.0F).scaleY(1.0F).setInterpolator(interpolator);
localViewPropertyAnimator.setStartDelay(0).start();
} else {
com.nineoldandroids.view.ViewPropertyAnimator.animate(v).translationX(0.0F).translationY(height)
.rotationX(45.0F).scaleX(0.7F).scaleY(0.55F);
com.nineoldandroids.view.ViewPropertyAnimator.animate(v).setStartDelay(0).start();
com.nineoldandroids.view.ViewPropertyAnimator.animate(v).rotationX(0.0F).rotationY(0.0F).translationX(0).translationY(0).setDuration(animDuration).scaleX(
1.0F).scaleY(1.0F).setInterpolator(interpolator);
com.nineoldandroids.view.ViewPropertyAnimator.animate(v).setStartDelay(animDuration).start();
}
sorry for bad english !
tnx to all
-------------------------------EDIT-----------------------------
code executed right on android 2.2 but not like android 4 !
ViewPropertyAnimator is for api level >11.However; you can use nineoldandroids library project which is a proxy for this animations (and quite good).
Or you can simply use Animation class
UPDATE:
i missed the part you said u already use nineoldandroids. did you check your imports maybe you imported the native
ViewPropertyAnimation
it may cause problem too. That libray uses the native api if api level is >11 you dont need to import native one.
You need to import ViewHelper class of nineoldandroid like
import com.nineoldandroids.view.ViewHelper;
and then use following code
ViewHelper.setTranslationX( Your View, 0.0F);
ViewHelper.setTranslationY( Your View, height);
ViewHelper.setRotationX(Your View,45.0F);
ViewHelper.setScaleX(Your View,0.7F);
ViewHelper.setScaleY(Your View,0.55F);
instead of
v.setTranslationX(0.0F);
v.setTranslationY(height);
v.setRotationX(45.0F);
v.setScaleX(0.7F);
v.setScaleY(0.55F);
Since Nineoldandroids allow api 1> use animation methods.
However, I run in API8 and Force Close is occured!
HERE is the solution, it's because of Nineoldandroids
[http://answer.techwikihow.com/962376/nineoldandroids-animation-working-api10.html][1]
Use Library of NineOldndroids Folder as Dependency instead of .jar,
Modification some code in
ObjectAnimator.Class
by following the answer in the link above!