cordova build –release android always picks the highest api level-ThrowExceptions

Exception or error: I am trying to build my cordova app for android, using ionicframework. I have set my target API level to 16 (I have that installed from Android SDK manager) but it somehow always picks up level 21. in project/config.xml: <preference name=”android-targetSdkVersion” value=”16″/> in platforms/android/AndroidManifest.xml, it shows the same: <uses-sdk android:minSdkVersion=”10″ android:targetSdkVersion=”16″ /> …

java – Android camera 2 api BufferQueue has been abandoned-ThrowExceptions

Exception or error: I am testing with new Android camera2 API and I want control each frame from camera. What I do for this is create an ImageReader and set up resolution and image format. ImageReader imageReader = ImageReader.newInstance(1280,720,ImageFormat.YUV_420_888,1); imageReader.setOnImageAvailableListener(new ImageReader.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReader reader) { Image image = reader.acquireLatestImage(); Log.i(MainActivity.LOG_TAG,”imageReader: “+System.currentTimeMillis()); image.close(); …

BaseFragmentActivityApi16.startActivityForResult(intent, int, Bundle) throwing error when targeting Android O-ThrowExceptions

Exception or error: I started targeting android O in my project I get an error when calling startActivityForResult(intent, int, Bundle) with the error saying it can only be called from group id com.android.support. Gradle: compile ‘com.android.support:design:26.0.0’ compile ‘com.android.support:cardview-v7:26.0.0’ compile ‘com.android.support:support-v13:26.0.0′ How to solve: It’s a bit late but I’ve found a workaround. I tried ActivityCompat.startActivityForResult(Activity, …

android – Can I have a single Google Maps API key for all my apps without registering their package names?-ThrowExceptions

Exception or error: I have written an android library project that includes custom MapFragments, based on Google Maps for Android v2 API. In the Google APIs console, I have registered the library’s package name with my debug/signed certificates. I need to create various apps that use this library as common code base and I was …

Android API-23: InetAddressUtils replacement-ThrowExceptions

Exception or error: Switching to Android Marshmallow API, I was using org.apache.http.conn.util.InetAddressUtils for InetAddressUtils.isIPv4Address(ipAddress) in a code to list all IPs from a device. As part of the API-23 changes, the InetAddressUtils class is now gone. How can I replace the below code now? public static String ipAddress() { try { for (final Enumeration<NetworkInterface> enumerationNetworkInterface …

android – setRepeating() of AlarmManager repeats after 1 minute no matter what the time is set (5 seconds in this case, API 18+)-ThrowExceptions

Exception or error: I have set the repeat time to 5 seconds. The first toast appears after 5 seconds, but all the next once repeat after 1 minute. I tried the code with setRepeating() as well, it still doesn’t work. here is my code: public void constructJob(){ Intent alertIntent = new Intent(this, AlarmManagerService.class); PendingIntent pendingIntent …