Android :: Development Mode And Maintaining Environment Variables
Nov 16, 2009
I'm building an Android application and would like to maintain a few environment variables that I can tweak depending on whether I'm in development mode or release mode. For example, I need to invoke a web service and the URL will be slightly different in either mode. I'd like to externalize this and other settings so I can change them easily based on my target deployment. Distinguishing development mode and release mode environment settings on Android. Are there any best practices or anything in the SDK to assist with this need?
View 3 Replies
Sep 20, 2010
I would like to use self defined Environment variables in my source code.
I use System.getenv() to do this and the code line looks like this. Log.d("MyTest","== MyEnv " + System.getenv("AP") + " ANDROID_ASSETS:" + System.getenv("ANDROID_ASSETS"));
Before I execute my code I define my AP variable with export: export AP="12345" and the this is my output of set command
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=9,32768
ANDROID_ROOT=/system
AP=12345
Then I execute my code and I get this line from logcat
D/MyTest( 5363): == MyEnv null ANDROID_ASSETS:/system/app
The value for my defined Environment variable is null. Any suggestions on why it didn't work?
View 1 Replies
View Related
Mar 3, 2010
I want to know if there is a way to pass environment variables to the running process in Android. If yes, how should one set those environment variables.
View 4 Replies
View Related
Dec 6, 2012
i am trying to look into android goldfish code and probably make some changes in it. As it is a long way to go for me i am actually unable to decide the tools that i need to set up. I come from an IDE based programming experience so am always trying to find a walk through tutorial to get goldfish kernel code in eclipse CDT to browse and code but no luck.I have followed the post source.android.com/source/building-kernels.html and built the kernel accordingly.wiki.eclipse.org/HowTo_use_the_CDT_to_navigate_Linux_kernel_source but am still not confident of my setup.
View 2 Replies
View Related
Aug 6, 2012
I've been trying to setup a perfect development and testing environment for:
1. 1st attemp
I installed Android (android-x86-4.0-RC2-eeepc.iso) on Virtualbox but run into these problems:
* No Wi-fi, but Ethernet instead (a Wired Android... duh!)
* "adb remount" not working, even with "su"
* I had to run this every time I start the device (8.8.8.8 is Google DNS)
Code:
# dhcpcd; setprope net.dns1 8.8.8.8
* Google apps not responding
2. 2nd Attemp
I used Buidroid (buildroid_vbox86p_4.0.3_r1-20120518.ova) and run into these problems:
* ALT F1 does nothing, I know I can use a terminal emulator but I like ALT F1
* I had to run this every time I start the device (8.8.8.8 is Google DNS)
Code:
# dhcpcd; setprope net.dns1 8.8.8.8
View 2 Replies
View Related
Mar 27, 2010
I want to create a PRO version of my application for Android and was wondering how to structure my repository. For know I have a trunk and feature branches. I'd like to put a pro version in another branch but maybe there is a better way? For example, maybe I should create two branches - one for free version, the other for pro?
Pro version will have additional features and will be ads-free, so e.g. I don't want to include AdMob libraries in the pro version. Do you have any experience or suggestions as to what would be the best way to structure the repository in this case? I think I've found the best solution (for my app) in this thread:
http://groups.google.com/group/android-developers/browse_thread/thread/4ad3d67f735f16d7/948b4f9eee2490a3
The trick discussed there is about having another application that only serves the purpose of unlocking PRO functionality in the actual application. The unlocking app is paid in the market and the actual app merely checks for the existence of it on the device.
View 3 Replies
View Related
Apr 7, 2009
In my app, my main class extends ListActivity and calls a fillData() function to reload the list whenever changes are made. I'm still getting the hang of this, so I borrowed that concept from the Android Notepadv1-Notepadv3 tutorials. Everything works great, however whenever I need to change the list (remove an item, re-sort it, edit an item), the ListView refreshes and loses its scroll position. The scroll position is reset to the top after each fillData() call.
It appears to be resetting the scroll position to the top because I'm using setListAdapter() each time in fillData(), setting it to a new SimpleCursorAdapter. How can I get the list to "update in place", where the scroll position is seamlessly maintained to the user? I tried heading down the "items.changeCursor(cursor)" path, but that didn't seam to do much for me.......................
View 2 Replies
View Related
Jun 30, 2010
I'm trying to add a drawable to a layout, using an ImageView, but the drawable doesn't maintain its size and is rendered at 1dp x 1dp. I've called ImageView.setAdjustViewBounds as per the android documentation but this doesn't seem to help. The Drawable is only visible when the ImageView's height and width are set and the drawable is then rendered at those dimensions.
View 2 Replies
View Related
Aug 26, 2010
I've got an application that uses overridePendingTransition to do some custom animations upon transitioning from one activity to the other. This was made available in Android 2.0, but I want to make the application work on Android 1.6. I figured if I just checked that android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT, and if not, don't do the overridePendingTransition.
However, I get a VerifyError, which I assume is caused by this: VFY: Unable to resolve virtual method 346: ../../Login: overridePendingTransition (II)V
Is it not possible to use newer functionality conditionally based on the SDK version?
View 1 Replies
View Related
May 13, 2010
I am having an application showing ListItems and Dialog boxes in it.. I want that when i change the orientation from Portrait to landscape mode, i need to maintain the state of the application .. I have seperate XMLs for landscape and portrait mode..
View 11 Replies
View Related
Apr 14, 2009
I want to avoid the SDK 1.0 and 1.1 workaround for playing synthesized audio as of SDK1.5, but for older phones or firmware (SDK 1.0 and 1.1 based) I want to maintain backward compatibility and first write audio to flash memory in order to play the resulting audio file from there.
View 8 Replies
View Related
Oct 30, 2010
I am releasing two versions of an app--free and paid. The differences between the two are few, and I would like to release both using the same codebase (maybe a different constant defined for the other build?). Has anyone done this? Can someone point me in the right direction?
View 1 Replies
View Related
Dec 1, 2009
When I rotate my Screen from horizontal to vertical, All the text I have entered is cleared.How to mainTain the state.
View 1 Replies
View Related
May 6, 2010
I m currently working on landscape mode for android app in which i want to know how to maintain the state of the activity and views displayed on orientation change i.e from portrait mode to landscape mode ?
View 3 Replies
View Related
Nov 22, 2010
I have a problem while using the scroller in my application. I have used the scroller but it is not working properly as it is not able to maintain a consistent speed while automatically scrolling. The speed of the text is getting slower with time as the text moves upward.
View 1 Replies
View Related
Apr 21, 2010
If I pop my droid sd into inc, will contents be usable? Ie, music, pics, apks, saved app stuff
View 5 Replies
View Related
May 15, 2012
I have a SGSII and recently i switched from the official ICS rom to CM9 (build date 20 april). I expected to get a better battery life since CM9 is so populair. Unfortunately this isn't the case and so i want to switch back. Only thing is, last time i switched, all my whatsapp conversations were blanc. I couldn't retrieve any old conversations. I know you can email the conversations to yourself but that's not what i want (or is it possible to use these emails in some kind of way to get the conversations back into whatsapp???). Is it possible to backup all my conversations so i can put them back into whatsapp after i flashed the phone to another rom (probably the official rom).
Also, as you can see, I'm not fond of CM9 although this is the most populair rom. Did i do something wrong? I'm a heavy whatsapp user and even when i'm charging the battery drains when using whatsapp (brightness auto and stable WiFi connection). I never game on my device or use bluetooth or gps. I mostly use my phone for facebook, whatsapp, twitter and browsing. Also my phonesignal drops sometimes and my 3G is also worse than before.
Is there a ROM which will give me with my requirements the best Battery life + phonesignal (3G)??
View 2 Replies
View Related
Mar 28, 2009
Can anyone hep me with how to make a (boolean) variable global in Android?
View 2 Replies
View Related
Aug 12, 2010
I split my inner View class from my Main class into its own file. In my main class, I have the view set as an onTouchListener which records user movement into a matrix so it can translate and scale the view. After separating it everything works but im unsure how to pass the matrix to the View for onDraw to update. Any suggestions?
View 1 Replies
View Related
Mar 19, 2010
In android, are using static variables a recommended practice?
E.g, implementing a Singleton pattern in Java, I usually do...
Also, when does this get cleaned up by the Android JVM?
View 6 Replies
View Related
Jun 6, 2010
Before I delve into it, I'm very new to Android and I have just started learning Java last month. I've hit bumps while trying to develop my first simple app. Most of these hurdles were jumped thanks to random tutorials online. MY CODE IS VERY MESSY. Any tips are appreciated.
The question above is quite broad, but this is what I want to do: It's a essentially a blood alcohol content calculator / drink keeper-tracker. Basic layout: http://i.imgur.com/JGuh7.jpg
The buttons along the bottom are just regular buttons, not ImageButtons (had problems with that) Here's some example code ..
It outputs the following to the text view: "Your BAC is -0.017". This is the Bac value for if StandardDrinks was still 0, so obviously there is some problem communicating between the classes.
The other elements of the formula (weight, time spent drinking, and the alcohol %'s and such) are variables because I will ultimately allow the user to change those values in the settings.
I've heard around the water cooler that global variables are not good programming style, but this is the closest I've come to getting it to work..
View 2 Replies
View Related
Aug 31, 2009
When I download the source and build it according to http://source.android.com/download, then try to build the eclipse dev evironment as described on http://source.android.com/using-eclipse, I get 100s of Java Errors when trying to build the project.
Linux is 2.6.28-15-generic #49-Ubuntu Eclipse is eclipse-java-galileo-linux-gtk.tar.gz
18# java -version java version "1.5.0_18" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_18-b02) Java HotSpot(TM) Client VM (build 1.5.0_18-b02, mixed mode, sharing) 19#
View 5 Replies
View Related
Jul 14, 2009
I just ran into a situation where it looks like a static variable reference is persisted across activity sessions. I didn't expect that because I thought that when an activity exits, it's de-referenced and garbage collected. I am wondering if anyone can shed some (more) light on when the VM eliminates object references for Activities and Services and in particular when static variables get reset to default values?
View 7 Replies
View Related
Oct 12, 2010
How can I make a variable or object available to multiple activities or restarts of the same one.
View 1 Replies
View Related
Jun 17, 2010
I am using static Arrays and HashMaps to store some values in my AppWidgetProvider class. But they are becoming null when the process dies, so the widget does not work anymore. Are there any alternatives to using static members to store data for an AppWidgetProvider in Android?
View 5 Replies
View Related
Feb 27, 2010
In android: I'm trying to take data from one activity/screen to another.
Let's say I'm adding two numbers. I layout my first screen (xml) with 2 EditText views, a couple labels, and an 'OK' button. Now, I want to add the numbers that I've input into the EditText views. Let's say I input 2 and 2 (2 + 2 = 4).
Now, when I hit the 'OK' button, I want a new screen/activity to appear and simply show me the answer (4). Do I use global vars to do this?
View 3 Replies
View Related
Jul 3, 2010
I am starting to develop an Android App and have noticed the following behaviour in my test code (not yet designed the real app):
A thread that loops around doing Bluetooth IO accesses an instance variable that is declared in the enclosing class. That instance variable gets set to null by the GUI thread in the onBackPressed() method which also closes the Bluetooth socket which causes an exception in the IO thread (which is what I want).
The odd thing is that if I set the instance variable to null before I close the socket, the IO thread sees the null value, but if I close the socket first and then set the variable to null, the IO thread doesn't see the null value.
The instance variable is being used in a loop in the IO thread and it appears as if that variable is being cached while within the loop. So any changes to that variable by another thread are not visible. Is that possible? If so, is there a workaround to guarantee that the VM will read the value of the instance variable?
View 4 Replies
View Related
Oct 4, 2009
I'd like to use python scripts as plugins for an app I'm developing. This seems to be possible by interacting with android-scripting-environment (ASE), as is done by Locale, but I haven't found any documentation about this. How you execute ASE scripts from your own app?
View 1 Replies
View Related
Sep 17, 2010
For now I've used the classic export command to set an environment variable and tried to read this variable from my test with System.getenv() function, but it doesn't seem to work. how to set and read a system variable in an Android application?
View 3 Replies
View Related
Nov 2, 2010
I am try to get the android environment setup for phone gap and I keep getting this
error when I try and create the phonegap project.
CODE:...............
I have got through the setup for the last could of days. I have also check the PATH for the android sdks and built the test android app in eclipse.
There are the path in the environment vars
CODE:...................
View 1 Replies
View Related