android-1.5-cupcake

Android animated GIF (Cupcake)

核能气质少年 提交于 2019-11-30 14:45:52
I've used animated GIFs in Android pre cupcake however my old code no longer works. To be exact: Movie.decodeStream Always returns null... Does anyone have any workarounds/fixes to play animated GIFs? There's a bug report for this . Looks like the only option currently is to split it up and do frame-by-frame animation manually. There's instructions in the docs for how to do this. 来源: https://stackoverflow.com/questions/1383246/android-animated-gif-cupcake

“IllegalArgumentException: bad base-64” while trying to use Base64 on Android 1.5 [closed]

孤人 提交于 2019-11-30 10:35:54
I get java.lang.IllegalArgumentException: bad base-64 while trying to use Base64 on Android 1.5 private static String encrypt(Context cont, String value) { try { return Base64.encodeToString(value.getBytes(), Base64.DEFAULT); } catch (Exception e) { throw new RuntimeException(e); } } private static String decrypt(Context cont, String value) { try { return new String(Base64.decode(value, Base64.DEFAULT)); } catch (Exception e) { throw new RuntimeException(e); } } /* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may

Possible to only load specific lines of code according to Android OS version?

强颜欢笑 提交于 2019-11-30 04:02:52
Is there a simple line of code that would allow only loading the code if the OS version meets the requirements? Lets say I have my target OS as 2.2 but the min sdk is 3 for android 1.5 so even if i have some code in my project that isn't compatable with 1.5 it will still compile since the target OS is 2.2. Anyway, I want to ad a feature that requires code that's not in the 1.5 SDK and will cause a crash if it's loaded on a 1.5 phone. Is there a simple thing like this that I can do? So i dont have to make the entire app not available to 1.5 users? if (Android OS == >2.1){ //Insert code here

“IllegalArgumentException: bad base-64” while trying to use Base64 on Android 1.5 [closed]

耗尽温柔 提交于 2019-11-29 15:51:07
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I get java.lang.IllegalArgumentException: bad base-64 while trying to use Base64 on Android 1.5 private static String encrypt(Context cont, String value) { try { return Base64.encodeToString(value.getBytes(),

Possible to only load specific lines of code according to Android OS version?

China☆狼群 提交于 2019-11-29 01:08:55
问题 Is there a simple line of code that would allow only loading the code if the OS version meets the requirements? Lets say I have my target OS as 2.2 but the min sdk is 3 for android 1.5 so even if i have some code in my project that isn't compatable with 1.5 it will still compile since the target OS is 2.2. Anyway, I want to ad a feature that requires code that's not in the 1.5 SDK and will cause a crash if it's loaded on a 1.5 phone. Is there a simple thing like this that I can do? So i dont

Killing android application on pause

大憨熊 提交于 2019-11-28 10:05:47
I have an application which I would like to be fully disabled/closed when it is paused (IE. When the user presses the Home, End (call) and Back button I would like the application to be closed, instead of being saved in the history stack). How do I do this....? Thanks. Implement onPause() in your activity and call finish() on your activity. Bear in mind, though, that this will occur on every pause, including dialogs, incoming calls, users activating a Notification . You might want to consider doing finish() in onStop() , which would at least solve the dialog problem. Also, bear in mind that

Android Screen Timeout

↘锁芯ラ 提交于 2019-11-27 13:19:46
I know its possible to use a wakelock to hold the screen, cpu, ect on but how can I programmatically change the " Screen Timeout " setting on an Android phone. The Settings.System provider offers a SCREEN_OFF_TIMEOUT setting that might be what you are looking for. user788435 public class HelloWorld extends Activity { private static final int DELAY = 3000; int defTimeOut = 0; @Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate(savedInstanceState); // See assets/res/any/layout/hello_world.xml for this // view layout definition, which

Creating an Android trial application that expires after a fixed time period

故事扮演 提交于 2019-11-26 11:30:37
I have an application which I want to hit the market as a Paid app. I would like to have other version which would be a "trial" version with a time limit of say, 5 days? How can I go about doing this? Currently most developers accomplish this using one of the following 3 techniques. The first approach is easily circumvented, the first time you run the app save the date/time to a file, database, or shared preferences and every time you run the app after that check to see if the trial period has ended. This is easy to circumvent because uninstalling and reinstalling will allow the user to have

Android Screen Timeout

拜拜、爱过 提交于 2019-11-26 11:12:14
问题 I know its possible to use a wakelock to hold the screen, cpu, ect on but how can I programmatically change the \" Screen Timeout \" setting on an Android phone. 回答1: The Settings.System provider offers a SCREEN_OFF_TIMEOUT setting that might be what you are looking for. 回答2: public class HelloWorld extends Activity { private static final int DELAY = 3000; int defTimeOut = 0; @Override protected void onCreate(Bundle savedInstanceState) { // Be sure to call the super class. super.onCreate

Creating an Android trial application that expires after a fixed time period

删除回忆录丶 提交于 2019-11-26 02:26:59
问题 I have an application which I want to hit the market as a Paid app. I would like to have other version which would be a \"trial\" version with a time limit of say, 5 days? How can I go about doing this? 回答1: Currently most developers accomplish this using one of the following 3 techniques. The first approach is easily circumvented, the first time you run the app save the date/time to a file, database, or shared preferences and every time you run the app after that check to see if the trial