How to Print PDF using Android 4.4 Printing framework [closed]

After spend some hours on google i found the solution. PrintManager printManager = (PrintManager) this.getSystemService(Context.PRINT_SERVICE); String jobName = this.getString(R.string.app_name) + ” Document”; printManager.print(jobName, pda, null); PrintDocumentAdapter pda = new PrintDocumentAdapter(){ @Override public void onWrite(PageRange[] pages, ParcelFileDescriptor destination, CancellationSignal cancellationSignal, WriteResultCallback callback){ InputStream input = null; OutputStream output = null; try { input = new FileInputStream(file … Read more

How can I detect the Android runtime (Dalvik or ART)?

Update At least, as early as June 2014 Google has released an official documentation on how to correctly verify the current runtime in use: You can verify which runtime is in use by calling System.getProperty(“java.vm.version”). If ART is in use, the property’s value is “2.0.0” or higher. With that, now there is no need to … Read more

mylib.so has text relocations. This is wasting memory and is a security risk. Please fix

This would appear to be a result of two ndk-gcc bugs mentioned at https://code.google.com/p/android/issues/detail?id=23203 and stated there to have been fixed as of ndk-r8c. It would appear that the check for libraries with the issue has been added only recently. Note: please do not edit this post to hide the link URL. It is explicit … Read more

Bluetooth HCI snoop log not generated

UPDATE: The btsnoop hci log seems to be getting phased out of the user-accessible areas on a lot of phones. Assuming you have hci logging enabled, you can get a bugreport adb bugreport anewbugreportfolder Then decompress the folder. If you’re lucky there is an ‘FS’ folder that contains the btsnoop_hci.log log several layers down (not … Read more

Why is FusedLocationApi.getLastLocation null

The fused location provider will only maintain background location if at least one client is connected to it. Now just turning on the location service will not guarantee storing the last known location. Once the first client connects, it will immediately try to get a location. If your activity is the first client to connect … Read more

HTML file input in android webview (android 4.4, kitkat)

Update 2: There is a simpler plugin to use with phonegap/cordova https://github.com/MaginSoft/MFileChooser Update: Sample project with Cesidio DiBenedetto plugin https://github.com/jcesarmobile/FileBrowserAndroidTest I opened an issue on the android open source project and the answer was: Status: WorkingAsIntended unfortunately, openFileChooser is not a public API. We are working on a public API in future releases of Android. … Read more

Android KitKat securityException when trying to read from MediaStore

Had the same problem for the last couple of days. Tried a few solutions, but for some reason I was getting permission denial on Uri content provider for some images even when I had the android.permission.MANAGE_DOCUMENTS permission added to my manifest. Here’s a workaround, for the time being: i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, CHOOSE_IMAGE); … Read more

How to record screen and take screenshots, using Android API?

First step and the one which Ken White rightly suggested & which you may have already covered is the Example Code provided officially. I have used their API earlier. I agree screenshot is pretty straight forward. But, screen recording is also under similar lines. I will answer your questions in 3 sections and will wrap … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)