The following only counts for the windows version of Android Studio (and Visual Studio 2015). Strangely enough the Projucer 4.2.4 Android Studio projects makes fine on MAC (!?)
The .java file that is used when Projucer 4.2.4 creates exporters for Androis has statements, that are deprecated so you must change the .java source. Thus I’d like to know where I find the .java template, that Projucer 4.2.4 uses:
To compile an Android Studio project created with Projucer 4.2.4 you must make the following changes to the .java file (HelloWorld.java in this case):
.java file line 59 and 60 must be changed like this (see notes belov from https://developer.android.com/reference):
import android.content.Context;
//import android.support.v4.content.ContextCompat;
import android.app.Activity;
//import android.support.v4.app.ActivityCompat;
On
https://developer.android.com/reference/android/support/v4/content/ContextCompat.html
they write:
ContextCompat()
This constructor is deprecated. Do not use this constructor. It will be removed and replaced with a protected constructor in a future release.
Public methods
and On
https://developer.android.com/reference/android/support/v4/app/ActivityCompat.html
they write
Public constructors
ActivityCompat()
This constructor is deprecated. Do not use this constructor. It will be removed and replaced with a protected constructor in a future release.
.java file line 122 must be changed like this:
return checkSelfPermission (getAndroidPermissionName (permissionID)) == PackageManager.PERMISSION_GRANTED;
// return ContextCompat.checkSelfPermission (this, getAndroidPermissionName (permissionID)) == PackageManager.PERMISSION_GRANTED;
.java file line 131 must be changed like this:
if (checkSelfPermission (permissionName) != PackageManager.PERMISSION_GRANTED)
// if (ContextCompat.checkSelfPermission (this, permissionName) != PackageManager.PERMISSION_GRANTED)
.java file line 135 must be changed like this:
requestPermissions (new String[]{permissionName}, permissionID);
// ActivityCompat.requestPermissions (this, new String[]{permissionName}, permissionID);
Further: to compile Android ant project imported to Visual Studio 2015 (as Eclipse project) you have to make this change:
in build.xml line 23
…"{ndk.dir}/ndk-build"...
must be changed to:
..."{ndk.dir}/ndk-build.cmd"…
