Skip to main content

Posts

Why do some AlertDialogs disappear upon device rotation?

When I change device orientation, if AlertDialog was shown, it disappears. This is true for all but one dialogs in my app, and I can't figure out neither what's so special about the one that doesn't disappear nor how to counteract this behaviour. Any possibility to preserve dialogs upon orientation change (except for manual management)?

Is there any alternative for GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)?

I get a fill rate of about 30fps in my application. I know that GLES20.glClear() is used to clear the screen for every draw. If i comment it i get a fps of about 60fps. But the output is not as expected. I have a content to be redrawn for the whole screen in every frame. Is there any alternative where i can redraw the whole screen with out using the GLES20.glClear(). Please let me know if there is any way to play around with GLES20.glClear() to improve the performance?

REST webservice with Android client vs RPC

We are still trying to decide between implementing a REST webservice vs going with RPC. Googles eclipse plugin makes it very easy to create an RPC service which is what the main attraction is for the RPC way. However, a REST service would seem to be easier to modify, IMHO, and would also allow for a future iOS client to connect with little or no rework. One concern I would have and maybe this is a problem with RPC also or indeed any Client-Server model is how do you modify your existing service and allow old clients to still work while allowing new clients to use the new functionality. What I mean is can you point me towards any thing we should look out for when modifying a web service so as not to break existing clients or force them to upgrade. Any links you have that would cover this would be appreciated

Android - Get preference from activity to broadcast receiver

I'm developing an Android app but I have a problem. When I try to get a saved preference from my Activity and use it in a BroadcastReceiver , it tells me that string I'm looking for doesn't exist. This is how I save the preference in the Activity: private void SavePreferences(String key, String value) { SharedPreferences sharedPreferences = getPreferences(MODE_PRIVATE); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putString(key, value); editor.commit(); } And this is how I try to get the preference in BroadcastReceiver : String pref = PreferenceManager.getDefaultSharedPreferences(context) .getString("MEM1", "Does not exist"); Where MEM1 is the string I saved before. My problem is that when I read pref , I'm getting the default value of Does not exist , instead of my preference value ( MEM1 ). Can someone point me to where I'm going wrong?

popen on android NDK

Is popen not supported by android NDK? I read this page and wondering if this is true The same is possible with POSIX popen() but it is not currently supported by bionic, so you can't use that in Android JNI. Instead you can probably use the system() and pipe the output to a file and then read that file afterwards. Looks like the Java approach will be cleaner if you will be doing the rendering in Java. But I also read someone suggesting to use popen. I also tried it myself but sometime my app crashes and I dont know why. Is popen safe to use in android ndk?

image won"t show in tableView

I'm creating a tableView in appcelerator (Android) and I want to add an image to it. This is just a test because I also had some problems with it in my project and I wanted to try it out first somewhere else so I wouldn't ruin my whole project. I first added the standard png's to see if he would show those, and he did. But when I add a png that I've created, he refuses to show it in the tableView. Does someone know why he refuses to show the image? (I created that png in photoshop by changing one of the standard png's and adding my image to it.) var win = Titanium.UI.createWindow({ title:'tableViewRow', backgroundColor:'#fff' }); var regData = [ {leftImage:'KS_nav_ui.png', title:'gft', left:20, color:'black'}, {rightImage:'KS_nav_views.png', title:'grofvuil', left:20, color:'black'}, {leftImage:'glas.png', title:'glas', left:20, color:'black'} ]; var tbl = Titanium.UI

How to hide the Div at the Click of the Button in MVC

My application is in MVC3.I want a particular Div in my View to Hide at the click of the button. Below is my Code that i tried. $(document).ready(function () { $("#btnCompare").click(function () { if(MyCondition) { for(MyLoop) { } } } }); My this code is not working.As well as i want to Div to Hide after the Click is called. Please suggest