android-version

What is the Android Bundle Version and Version Code and how do they relate?

一笑奈何 提交于 2019-12-04 10:04:28
问题 a) What does the Android bundle version and version code denote? b) What is the difference between the bundle version and version code? i) Suppose I have a bundle version of 0.137 , how does the version code relate to this? Can the version code just be 137? ii) What happens when I release bundle version 1.0 next? Can I just call the version code 10 ? c) How do they relate? What's the right way to number the bundle versions? N.B. There does not seem to be a source that explains the difference,

Clearing App Data on update

大憨熊 提交于 2019-12-04 09:39:31
I need to clear(equivalent to Clear Data in App Settings ) all the old data in the app programmatically when the user updates the app from Google Play Store or any other sources. This is because I don't need any of the existing data from the old app since I have changed everything in the new app compared to the old one. I thought of implementing a version check at the app startup, but I can't find a way to get the app's previous versionCode or versionName . The only way I figured out to clear the data is to check the lastUpdateTime at the time of publishing the app. But it's not reliable since

How to generate an Barcode and convert it to Bitmap using new Google Vision API?

落花浮王杯 提交于 2019-12-04 06:31:21
How to generate an Barcode and convert it to Bitmap using new Google Vision API? Barcode barcode = new Barcode(); Barcode.Email email = new Barcode.Email(); email.address = "my_email@gmail.com"; email.subject = "My Subject; email.body = "My body content."; barcode.email = email; //Implement conversion Bitmap barcodeImage = barcodeToBitmap(barcode);// I do know this part. You can detect your barcodes using Google Vision API and then use ZXing to generate the barcodes. You could try something like this, it uses zxing library: public static Bitmap getBitmap(String barcode, int barcodeType, int

Error when get HTML from web in android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 05:57:26
问题 I have 1 EditText 1Button and 1TextView, when I type url in Edittext and click button, the textView will be show the Html from website that i type the url in edittext. I want to get html from web by using url. Problem When I using this code in ( AVD Target version 2.3.3). AndroidManifest (minSdkVersion="10" targetSdkVersion="10") and I also change targetSdkVersion="15") both are work correct. but when I change it to run in (AVD target version 4.0.3) it's not work. Y? This is my code final

What is the Android Bundle Version and Version Code and how do they relate?

妖精的绣舞 提交于 2019-12-03 05:48:07
a) What does the Android bundle version and version code denote? b) What is the difference between the bundle version and version code? i) Suppose I have a bundle version of 0.137 , how does the version code relate to this? Can the version code just be 137? ii) What happens when I release bundle version 1.0 next? Can I just call the version code 10 ? c) How do they relate? What's the right way to number the bundle versions? N.B. There does not seem to be a source that explains the difference, in search. I have been very haphazardly numbering my bundles till now, but I'd like to figure out how

Android Camera Parameters setJpegQuality deprecated? Custom camera application

荒凉一梦 提交于 2019-12-02 05:09:12
问题 I'm building a custom camera application for Android. The Camera.Parameters API contains methods like setPreviewSize or setPictureSize , that are working well. But I am trying to use setJpegQuality(int) parameter: Camera cam = getCameraInstance(); if(cam == null){ setResult(INSTANCE_ERROR); finish(); } params = cam.getParameters(); params.setJpegQuality(jpegQuality); cam.setParameters(params); I am testing my application on 3 different devices : an HTC Desire Z, a Galaxy S2 and a Galaxy S4.

Android Camera Parameters setJpegQuality deprecated? Custom camera application

老子叫甜甜 提交于 2019-12-02 01:46:49
I'm building a custom camera application for Android. The Camera.Parameters API contains methods like setPreviewSize or setPictureSize , that are working well. But I am trying to use setJpegQuality(int) parameter: Camera cam = getCameraInstance(); if(cam == null){ setResult(INSTANCE_ERROR); finish(); } params = cam.getParameters(); params.setJpegQuality(jpegQuality); cam.setParameters(params); I am testing my application on 3 different devices : an HTC Desire Z, a Galaxy S2 and a Galaxy S4. setJpegQuality is working on HTC (Android 2.2.1 ) and on Galaxy S2 ( 4.1.2 ), but fails on Galaxy S4

Android version check

主宰稳场 提交于 2019-11-30 04:11:06
I'm not new to Android and I'm well used to the version handling and how to condition it, but when I see this it troubles me... // Check if we're running on Android 5.0 or higher if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // Call some material design APIs here } else { // Implement this feature without material design } On any device pre lollipop this line would crash the app because the Build.VERSION_CODES.LOLLIPOP field does not exists... so why is this in the recommended solution in the documentation? I'm really wondering what am I missing? Well, you must compile your

How to Use Unsupported Exception for Lower Platform Version

末鹿安然 提交于 2019-11-29 01:44:06
I have a DialogFragment that handles login and fingerprint authentication for my application. This fragment uses two classes that are exclusive to API 23, KeyGenParameterSpec and KeyPermanentlyInvalidatedException . I had been under the impression that I could use these classes, as long as I check the build version before I try to initialize the classes (outlined here ): if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { ... } else { ... } But it appears that this is not the case. If I try to run this code on a version prior to API 20, the Dalvik VM rejects the entire class and throws a

is it possible to show widget only for a certain android version?

不打扰是莪最后的温柔 提交于 2019-11-28 17:33:12
is it possible to show widget in "Add to home screen > Widgets" Dialog only for a certain android version without uploading two APKs and assigning to proper SDK version numbers? I have a way to do it without any code e.g.: In your res\values dir create a bools.xml file: <?xml version="1.0" encoding="utf-8"?> <resources> <bool name="honeycombOrAbove">false</bool> </resources> Create a values-v11 dir (for honeycomb or above values), copy the file to it and set the value to true. Then in the manifest for the widget receiver use: android:enabled="@bool/honeycombOrAbove". I also used it in the