[android-developers] Re: Beginner question on layouts
you should really read the documentation and do the plethora of tutorials Google provides. http://developer.android.com/guide/practices/screens_support.html Regarding the textview, that's what String Formatting is for (%.2f), look it up. On Friday, November 16, 2012 1:23:53 AM UTC+2, Brandon Cormier wrote: So I am new to Android development and have a question on layouts. When I create my app in Eclipse I have it set up so that I can see what it would look like on a Nexus S (4 in., 480 x 800). This looks great when I open it on my Exhibit 2 4G (3.7 in., 480 x 800), however it looks terrible when I open it on the Nexus 7. The buttons are in the wrong places and things just don't look the same. I am assuming this has to do with layouts? When I create a Windows application in java I use a layout such as the border layout, grid layout, flow layout, etch... and then add it to the frame. That way no matter how big I resize the window, it always looks the same. How do you do this in Android? Also, kinda off topic, but when displaying numbers in a textbox how do you make it so that it only shows up to the hundredths place? I am starting out creating apps that deal with tips, sale prices, etch, and don't need the final calculated price to be to the 5th decimal place. Thanks in advance! Brandon Samsung Exhibit 2 4G (T-Mobile) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Disabling DisplayList creation by Views
Hi, thanks for the quick response! You are right, of course. The DisplayList was simply holding references to some Bitmaps that were also referred by my custom View elsewhere. The Eclipse Memory Analyzer Tool is a bit more difficult to use with Bitmaps, after DisplayLists were added. When checking the Retained Heap size of a View, the value supplied will typically be too low, because DisplayLists have grabbed some of the Bitmap references. The DisplayList is then considered by MAT to be the main holder of those Bitmap references, because it's closer to the GC root. Thanks On Tuesday, November 20, 2012 4:44:45 PM UTC+1, Romain Guy (Google) wrote: No you cannot disable DisplayLists. They are required by the UI toolkit. 2MB if display lists seems excessive. Apps like Launcher use in the order of 15 kB. On Nov 20, 2012 7:22 AM, hanni han...@gmail.com javascript: wrote: I've created a bunch of custom views that draw themselves really fast, especially with HW acceleration enabled. I have several of these views in my application, spread out over many panes. I'm trying to keep as much as possible in memory to avoid reloading data when swiping between panes. My problem is that Android keeps creating a DisplayLists for each of my views, even though the do not really need it. They don't have any children and draw directly to their canvas, so DisplayLists should have little or no effect on performance. But they sure do take up a lot of memory. Sometimes 2 MB per view, which adds up to a lot. Is there any way to disable DisplayList creation without disabling HW acceleration? Thanks, Daniel -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.comjavascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: debugging crashes on some systems ( not all )
When an app crashes the user has an option to send a report, you can use your dev console to read the crashes and see what happened. You can also use external services like Bugsense to help you out. Regardless of that, it's always a good idea to have your own test version with as many logs as possible and a mechanism to deliver them to you, then send that version to the users that are having difficulties On Wednesday, November 21, 2012 1:08:46 AM UTC+2, Mike Adams wrote: Hi, I have a kind of chat and game client, it connects to a board game server and is a tabbed android app. There is a telnet thread and it feeds through concurrently linked queues 3 worker threads that update a game board, a text console and i have a lists tab. The problem is i've had 2 users now complain that the program has crashed on them, one said it froze his phone. I can't be clear if the program crashed or if its something with their phones, one was a samsung s3 i think the other some kind of acer tablet if i recall. But how would i evaluate this? It's never crashed for me on my tablet or phone. What kind of things could cause a crash like this but only intermittent or on certain devices which could have to do with the resources available on the devices and mix of what is happening on that device. One user says he always hard stops it before running it but it still crashed on him which kind of dismisses its a state issue with it being up to long. Mike -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: problem with jar file
I think the more important question is : Why the fuck are you doing all of THAT instead of just using Java IO? On Tuesday, November 20, 2012 11:44:14 PM UTC+2, Lew wrote: Ali Ahmadi wrote: i [sic] made a android [sic] app, which works correctly. now i put some parts of my application into a library and as a jar file. now my code is not working i read some values through this command: suProcess = Runtime.getRuntime().exec(ls /sdcard/folder*'); DataOutputStream oStream = new DataOutputStream(suProcess.getOutputStream()); The 'Process' output stream from an ls will not be a 'DataOutputStream'. DataInputStream osRes = new DataInputStream(suProcess.getInputStream()); Likewise the input stream. ls is a text-oriented command. DataInputStream errStream = new DataInputStream(suProcess.getErrorStream()); if (null != oStream null != osRes null!= errStream) { while (errStream.available()0) errVal += errStream.readLine(); while (osRes.available()0) retval = osRes.readLine(); } but nothing would return as output. why this happens just when i use jar file? Did you set up the project that generates the JAR as an Android library project? http://developer.android.com/tools/projects/index.html#LibraryProjects Did you create a /libs directory within your Android project directory and copy the JAR file to that directory? http://mobile.tutsplus.com/tutorials/android/jar-for-android/ Did you google for an answer? -- Lew -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: HttpUrlConnection no print data to my screen
- Thats not a good way to read a stream. look up on how to use buffers - Its a horrible idea to perform findViewById in a loop. you should only do it once before the loop. - never do long processes on the main thread. especially not network access. look up how to background tasks in android - setText replaces the entire text with the new value. seems more likely you'll want to collect all the input before you set it to the view or at least concat it instead of replacing it. On Tuesday, November 20, 2012 2:43:41 PM UTC+2, Antonis Kanaris wrote: I am new android developer. I am trying this code for access data from my webserver @Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); URL url; try { url = new URL(http://www.mysite.net/LEDstate.txt;); HttpURLConnection urlConnection = (HttpURLConnection) url .openConnection(); InputStream in = urlConnection.getInputStream(); InputStreamReader isw = new InputStreamReader(in); int data = isw.read(); while (data != -1) { char current = (char) data; data = isw.read(); //System.out.print(current); TextView t = (TextView) findViewById(R.id.ledstate); t.setText(current); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Overridepublic boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true;} } But data is not appearing on Screen.There is no change in Textview. I have checked Permissions they are ok. Any help? Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: NullPointerException from Billing API
That's your class and implementation... why does this need to be fixed on their side? On Wednesday, November 21, 2012 7:08:45 AM UTC+2, Build Account wrote: As far as you know, The ERROR from Billing API make below error very FREQUENTLY - java.lang.RuntimeException: Unable to start service com..yyy.BillingService@41b15648 javascript: with Intent { act=com.android.vending.billing.RESPONSE_CODE(or STATUS_CHANGE thing) cmp=com..yyy/com..yyy.BillingService (has extras) }: java.lang.NullPointerException at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2388) at android.app.ActivityThread.access$1900(ActivityThread.java:127) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1214) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4499) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:561) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.NullPointerException at com..yyy.BillingService.onStartCommand(Unknown Source) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2371) --- This must be fixed by Google side whoever Google Play people or framework people. Why Google keep silent about those critical issues which regarding billing? Fix it. pls. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to create soap request in ksoap2 for a wcf webservice method with complex types?
I have successfully accessed web services using ksoap2 but i am stuck with calling a web service method with data contracts. The webservice request in SoapUI is shown as : soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:tem=http://tempuri.org/; xmlns:pat=http://schemas.datacontract.org/2004/07/Patient_Service.App_Code.Common;soapenv:Header/soapenv:Body tem:PatientLookups tem:oBenefitsandEligibilityEntity pat:ID?/pat:ID pat:Name?/pat:Name pat:Age?/pat:Age pat:Address?/pat:Address /tem:oBenefitsandEligibilityEntity /tem:PatientLookups /soapenv:Body The arguments ID,Name,Age and Address have different namespaces Here is the code i used to create the request: request=new SoapObject(NAMESPACE,PatientLookups);SoapObject sub_element=new SoapObject(NAMESPACE, oBenefitsandEligibilityEntity); for(Map.EntryString,String entry: properties.entrySet()) { PropertyInfo pi=new PropertyInfo(); pi.setNamespace(entityNameSpace); pi.setName(entry.getKey()); pi.setValue(entry.getValue()); sub_element.addProperty(pi); } request.addSoapObject(sub_element); but i get this exception in logcat: SoapFault - faultcode: 'a:DeserializationFailed' faultstring: 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:oBenefitsandEligibilityEntity. The InnerException message was 'Error in line 1 position 411. Element 'http://tempuri.org/:oBenefitsandEligibilityEntity' contains data from a type that maps to the name 'http://tempuri.org/:oBenefitsandEligibilityEntity'. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to 'oBenefitsandEligibilityEntity' to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.' faultactor: 'null' detail: null at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:141) at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140) at org.ksoap2.transport.Transport.parseResponse(Transport.java:100) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:214) at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:96) at com.m2.action.WebServiceConnection.callWCFWebService(WebServiceConnection.java: how to create this soap request using ksoap? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Retrieving GPS coordinates when location services are not enabled
Hi All, Assuming the device's Use Wireless networks and Use GPS satellites settings under Location is not enabled, is it possible to still retrieve the location coordinates. Currently, the best is to redirect the user to the settings page is not enabled. I find this disruptive as needs to navigate away from the app. If i am not mistaken, you can enable the settings programmatically (Am I correct?). I don't need the exact coordinates, is it possible to get the cell tower ID without the settings enabled? Thanks In Advance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Retrieving GPS coordinates when location services are not enabled
On Wed, Nov 21, 2012 at 4:14 AM, Android Test aandroidt...@gmail.comwrote: If i am not mistaken, you can enable the settings programmatically (Am I correct?). I'm sure you can find this on the inter-webbies if you look hard enough. I don't need the exact coordinates, is it possible to get the cell tower ID without the settings enabled? It wouldn't be much of a setting if it still allowed apps to get the location, now would it? =P You can use getLastKnownLocation(), but obviously that could be very old and useless. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] hi friends
how can i access json web services from java(servlets or JSP) to android,here only i will check username and password of mysql database. when i enter username and password ,compare toMySql database.if comparation is true then navigate new activity,other wise display toast like invalid username and password. please give me any idea and code.it is very urgent for me. thank you advance. sorry for my english. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: READ_LOGS permission is not granted to 3rd party applications in Jelly Bean (api 16)
On Wednesday, 21 November 2012 06:45:39 UTC+1, Sean Watkins wrote: Again like I said, it seems silly to break something before providing a better way to do it, then again, i do understand there is a cause for concern. I realise privacy is a huge issue nowadays and allowing anything to read logs could prove troublesome. +1 to that. Personnaly I was interested in MediaPlayer logcat output to troubleshoot issues. Some debug info is only available in the logcatand having no easy way for a user to send it for debugging purpose is a real pain: It doesn't work ? I cannot help you. Go ask Google. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Change home page by code?
Can I change the default home page from default browser by code? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] hi friends
First: I'm betting that you won't find anyone willing to give you a complete solution to this very vague problem. If you can ask a more specific question based on a real problem - not easily solvable by searching google etc. - people will be more likely to provide you with useful help. Second: You really need to consider that the security in your application is based on server communication. Several issues come to mind, including connection issues and the fact that it seems that the app contains the secured information which isn't quite good practice (for issues like preventing large downloads etc. you could provide a decryption key). On Wed, Nov 21, 2012 at 12:14 PM, sree android android.sreeni...@gmail.comwrote: how can i access json web services from java(servlets or JSP) to android,here only i will check username and password of mysql database. when i enter username and password ,compare toMySql database.if comparation is true then navigate new activity,other wise display toast like invalid username and password. please give me any idea and code.it is very urgent for me. thank you advance. sorry for my english. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Michael Banzon http://michaelbanzon.com/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Change home page by code?
Hopefully not. On Wed, Nov 21, 2012 at 6:42 AM, Jorge Garrido Oval firez...@gmail.com wrote: Can I change the default home page from default browser by code? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Get data from the web on android with AsyncTask....
Hello.I am new developer and i want a good simple and analytical example for get data from my website.net/ledstate.txt with AsyncTaski try without asynctask and no workthis code...with permissions internet public class GetDataWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.activity_get_data_web); TextView t = (TextView)findViewById(R.id.netResult); try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(http://www.power7.net/LEDstate.txt;); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream webs = entity.getContent(); try{ BufferedReader reader = new BufferedReader(new InputStreamReader(webs,iso 8859-1),8); t.setText(reader.readLine()); webs.close(); }catch(Exception e){ Log.e(log_tag,Error converting result+e.toString()); } }catch(Exception e){ Log.e(log_tag,Error in http connection+e.toString()); } }catch(Exception e){ Log.e(ERROR,ERROR IN CODE: +e.toString()); e.printStackTrace(); } Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] FM radio Android Application Developement
On Wed, Nov 21, 2012 at 12:27 AM, Karunakaran Vikash kvk2551...@gmail.com wrote: I need to create a FM radio android application , is there any api or methods for developing this. Generally no, because generally phones are not FM radios. *Specific* phones might have an FM radio chip, and those *specific* manufacturers might offer an API for working with those chips. You are welcome to contact such manufacturers to find out. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Get data from the web on android with AsyncTask....
Καλησπέρα Αντώνη :P !!! private class RetrieveJsonInfo extends AsyncTaskString, Void, Object { public String finalContent; @Override protected Boolean doInBackground(String... params) { } public void getInfo() { StringBuilder builder = new StringBuilder(); HttpParams httpParameters = new BasicHttpParams(); int timeoutConnection = 2000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); HttpClient client = new DefaultHttpClient(httpParameters); HttpGet httpGet = new HttpGet(http://schedule.aueb.gr/mobile/index.php;); try { HttpResponse response = client.execute(httpGet); StatusLine statusLine = response.getStatusLine(); int statusCode = statusLine.getStatusCode(); if (statusCode == 200) { // success! HttpEntity entity = response.getEntity(); InputStream content = entity.getContent(); BufferedReader reader = new BufferedReader( new InputStreamReader(content)); String line; while ((line = reader.readLine()) != null) { builder.append(line); } finalContent = builder.toString(); } else { Log.i(error, Failed to download file); } } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } } } Try using this code inside your Activity. The finalContent will be the content of your file! On Wed, Nov 21, 2012 at 2:31 PM, Antonis Kanaris ant...@in.gr wrote: Hello.I am new developer and i want a good simple and analytical example for get data from my website.net/ledstate.txt with AsyncTaski try without asynctask and no workthis code...with permissions internet public class GetDataWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.activity_get_data_web); TextView t = (TextView)findViewById(R.id.netResult); try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost( http://www.power7.net/LEDstate.txt;); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream webs = entity.getContent(); try{ BufferedReader reader = new BufferedReader(new InputStreamReader(webs,iso 8859-1),8); t.setText(reader.readLine()); webs.close(); }catch(Exception e){ Log.e(log_tag,Error converting result+e.toString()); } }catch(Exception e){ Log.e(log_tag,Error in http connection+e.toString()); } }catch(Exception e){ Log.e(ERROR,ERROR IN CODE: +e.toString()); e.printStackTrace(); } Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Get data from the web on android with AsyncTask....
You will have to change the url to your personal url! On Wed, Nov 21, 2012 at 2:41 PM, Παύλος-Πέτρος Τουρνάρης p.tourna...@gmail.com wrote: Καλησπέρα Αντώνη :P !!! private class RetrieveJsonInfo extends AsyncTaskString, Void, Object { public String finalContent; @Override protected Boolean doInBackground(String... params) { } public void getInfo() { StringBuilder builder = new StringBuilder(); HttpParams httpParameters = new BasicHttpParams(); int timeoutConnection = 2000; HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection); HttpClient client = new DefaultHttpClient(httpParameters); HttpGet httpGet = new HttpGet(http://schedule.aueb.gr/mobile/index.php;); try { HttpResponse response = client.execute(httpGet); StatusLine statusLine = response.getStatusLine(); int statusCode = statusLine.getStatusCode(); if (statusCode == 200) { // success! HttpEntity entity = response.getEntity(); InputStream content = entity.getContent(); BufferedReader reader = new BufferedReader( new InputStreamReader(content)); String line; while ((line = reader.readLine()) != null) { builder.append(line); } finalContent = builder.toString(); } else { Log.i(error, Failed to download file); } } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } } } Try using this code inside your Activity. The finalContent will be the content of your file! On Wed, Nov 21, 2012 at 2:31 PM, Antonis Kanaris ant...@in.gr wrote: Hello.I am new developer and i want a good simple and analytical example for get data from my website.net/ledstate.txt with AsyncTaski try without asynctask and no workthis code...with permissions internet public class GetDataWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.activity_get_data_web); TextView t = (TextView)findViewById(R.id.netResult); try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost( http://www.power7.net/LEDstate.txt;); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream webs = entity.getContent(); try{ BufferedReader reader = new BufferedReader(new InputStreamReader(webs,iso 8859-1),8); t.setText(reader.readLine()); webs.close(); }catch(Exception e){ Log.e(log_tag,Error converting result+e.toString()); } }catch(Exception e){ Log.e(log_tag,Error in http connection+e.toString()); } }catch(Exception e){ Log.e(ERROR,ERROR IN CODE: +e.toString()); e.printStackTrace(); } Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Get data from the web on android with AsyncTask
I am new developer and i want a good simple and analytical example for get data from my website.net/ledstate.txt with AsyncTaski try without asynctask and no workthis code...with permissions internet public class GetDataWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.activity_get_data_web); TextView t = (TextView)findViewById(R.id.netResult); try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(http://www.mysite.net/LEDstate.txt;); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream webs = entity.getContent(); try{ BufferedReader reader = new BufferedReader(new InputStreamReader(webs,iso 8859-1),8); t.setText(reader.readLine()); webs.close(); }catch(Exception e){ Log.e(log_tag,Error converting result+e.toString()); } }catch(Exception e){ Log.e(log_tag,Error in http connection+e.toString()); } thanks... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Get data from the web on android with AsyncTask
i already answered you on the other one! On Wed, Nov 21, 2012 at 2:45 PM, Antonis Kanaris ant...@in.gr wrote: I am new developer and i want a good simple and analytical example for get data from my website.net/ledstate.txt with AsyncTaski try without asynctask and no workthis code...with permissions internet public class GetDataWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.activity_get_data_web); TextView t = (TextView)findViewById(R.id.netResult); try{ HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(http://www.mysite.net/LEDstate.txt;); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream webs = entity.getContent(); try{ BufferedReader reader = new BufferedReader(new InputStreamReader(webs,iso 8859-1),8); t.setText(reader.readLine()); webs.close(); }catch(Exception e){ Log.e(log_tag,Error converting result+e.toString()); } }catch(Exception e){ Log.e(log_tag,Error in http connection+e.toString()); } thanks... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Digest for android-developers@googlegroups.com - 25 Messages in 19 Topics
hi, how to click on a button after rotation animation in devices starting from level 9? Its a menu of 5items which opens up like cards in our hands and clicking on it after animation should do somethings. It sounds easy but i am having trouble as the the click happens on the original poition and not at the position after the animation. i have used the XML for the animation part, and setfill(true) which causes the images to stay at new positions after animation but its not clickable in the new positions. Please help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] debugging crashes on some systems ( not all )
Hi, This is one of the worst things of Android development ever. I am facing similar problems, also most of them with SGSIII, getting OOM crashes with no apparent reason. I have run the app in several different actual devices, also different emulator instances, one of them trying to fit as closed as possible the SGSIII settings. I have reduced heap consumption to the minimal, but I am still getting these annoying errors. Now I am considering to buy an SGSIII actual device to test it, but this is not an option in most of the cases, and it is not clear if this will solve this problem -may be only some SGSIII are affected, and the one I bought is not one of them-. I released a new version of my app last Friday with disastrous results due to this problem -thousands of uninstalls-. I have did my best since them improving a lot memory use, writting code for actively recycle bitmaps when they are not needed and thinks like that, with excellent results (in an emulator instance with same resolution, density and VM heap budget than SGS3, I got now a 40% less of peak memory consumption than before). And it is really frustrating to see that crashes continues after all that effort. We need something to fight these problems. Bests, 2012/11/21 Mike Adams adams...@gmail.com Hi, I have a kind of chat and game client, it connects to a board game server and is a tabbed android app. There is a telnet thread and it feeds through concurrently linked queues 3 worker threads that update a game board, a text console and i have a lists tab. The problem is i've had 2 users now complain that the program has crashed on them, one said it froze his phone. I can't be clear if the program crashed or if its something with their phones, one was a samsung s3 i think the other some kind of acer tablet if i recall. But how would i evaluate this? It's never crashed for me on my tablet or phone. What kind of things could cause a crash like this but only intermittent or on certain devices which could have to do with the resources available on the devices and mix of what is happening on that device. One user says he always hard stops it before running it but it still crashed on him which kind of dismisses its a state issue with it being up to long. Mike -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] WebView - Flash overlap issues in Android
platform: ARM7 based device android version: ICS4.0 browser: android default browser I am testing flash websites on android browser and observing that flash is always overlapping over webview. So if any website contains any list view/menu which falls above flash, always goes behind the flash with android browser. Below are the suggestions which I have tried already, Override surfaceview add in WebView to change the zorder to false; (setZOrderOnTop(false)) Changing html page setting to opaque or transparent I have seen this working on GalaxyS2 with Google TV image (with Chrome browser) on same platform. In Chrome browser (GTV), WebKit rendering is done on above SurfaceView and for Flash Video's it is using PluginWindow. So WebView always remains on top of all other window. So no problem. Interesting thing is, I have not found a single web reference which tells the possibility of rendering Webpage over SurfaceView and there is no reference about PluginWindow in android. Quick suggestion/help required. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: FM radio Android Application Developement
thank you :) On Wednesday, November 21, 2012 10:57:52 AM UTC+5:30, Karunakaran Vikash wrote: Hi , I need to create a FM radio android application , is there any api or methods for developing this... anything available means ,just drop me a mail .. Any useful links , please update me... THanks in Advance ... Regards, V.Karunkaran -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: install and run PHP script on apache tomcat server
Maybe you want XAMPP? On Tuesday, November 20, 2012 12:31:58 PM UTC-6, shikha kejariwal wrote: Hi All, can anybody please tell me how can I install and run PHP script of apache tomcat server. Since there are couple of tutorials are there but nothing seems to be worked...If apache tomcat is not suitable then whihc type of server I should setup in order to upload from file from my android application??? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Problem while displaying same list which is initialized in parent fragment into two different sub childs fragments
I am implementing swipe functionality using ViewPager and want to display same list in two fragments which is initialized in parent fragment . I am having 1) One base Fragment 2) Two child fragments 3) One activity(FragmentActivity) in which adding two child fragments through ViewPager dynamically. Base fragment contain list which is common in both child fragment.I have initialized and set list adapter in onActivityCreated() of base fragment but it is creating list only for one fragment and not for the other. please suggest me where to set my adapter in base fragment so list is display in both fragments or any other solution will be very helpful for me. * * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Problem while displaying same list which is initialized in parent fragment into two different sub childs fragments
you can't add the same view to two viewgroups at the same time. if you want two lists, you'll have to initialize and set two lists. On Wednesday, November 21, 2012 3:57:20 PM UTC+2, Bajrang Asthana wrote: I am implementing swipe functionality using ViewPager and want to display same list in two fragments which is initialized in parent fragment . I am having 1) One base Fragment 2) Two child fragments 3) One activity(FragmentActivity) in which adding two child fragments through ViewPager dynamically. Base fragment contain list which is common in both child fragment.I have initialized and set list adapter in onActivityCreated() of base fragment but it is creating list only for one fragment and not for the other. please suggest me where to set my adapter in base fragment so list is display in both fragments or any other solution will be very helpful for me. * * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] ICS 4.0.4 emulator image?
Hi there, I have problems with some devices that uses ICS 4.0.4, mainly with Samsung Galaxy SIII ones. I have create an emulator instance to try to debug this as closed as possible to SGS3, but I have been unable to reproduce the problem at all. I only have ICS 4.0.3 on the emulator that comes with ADT in Eclipse, so I rather like to test this in an ICS 4.0.4 emulator to see if it makes the difference. Is there any manner to run an ICS 4.0.4 emulator? TIA, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] debugging crashes on some systems ( not all )
Indeed, one of android's strong advantages (to the consumer) is also a big disadvantage (to the developer). I was faced with similar heap issues, did the same thing as you did, mostly came to the conclusion that the best thing is just to drop the bitmaps altogether or reduce their resolutions as much as possible. You should watch out with Recycling manually as this might cause issues in some instances (like when the bitmap is used in a listview), i found that just nulling the drawable Callback and making the bitmap Purgable was sufficient for GC to work correctly and avoid OutOfMemory exceptions. When it comes to testing, you can always just use your more knowledgeable customers as QA. Start a beta program with a bunch of users (or friends :) ) that will test your app in advance. You'll be able to reach a wider variety of devices and catch those big issues early on before releasing the app to the public. Emulators by the way, wont do the job as they dont emulate the different hardware specifications of each device. On Wednesday, November 21, 2012 3:23:06 PM UTC+2, Fran wrote: Hi, This is one of the worst things of Android development ever. I am facing similar problems, also most of them with SGSIII, getting OOM crashes with no apparent reason. I have run the app in several different actual devices, also different emulator instances, one of them trying to fit as closed as possible the SGSIII settings. I have reduced heap consumption to the minimal, but I am still getting these annoying errors. Now I am considering to buy an SGSIII actual device to test it, but this is not an option in most of the cases, and it is not clear if this will solve this problem -may be only some SGSIII are affected, and the one I bought is not one of them-. I released a new version of my app last Friday with disastrous results due to this problem -thousands of uninstalls-. I have did my best since them improving a lot memory use, writting code for actively recycle bitmaps when they are not needed and thinks like that, with excellent results (in an emulator instance with same resolution, density and VM heap budget than SGS3, I got now a 40% less of peak memory consumption than before). And it is really frustrating to see that crashes continues after all that effort. We need something to fight these problems. Bests, 2012/11/21 Mike Adams adam...@gmail.com javascript: Hi, I have a kind of chat and game client, it connects to a board game server and is a tabbed android app. There is a telnet thread and it feeds through concurrently linked queues 3 worker threads that update a game board, a text console and i have a lists tab. The problem is i've had 2 users now complain that the program has crashed on them, one said it froze his phone. I can't be clear if the program crashed or if its something with their phones, one was a samsung s3 i think the other some kind of acer tablet if i recall. But how would i evaluate this? It's never crashed for me on my tablet or phone. What kind of things could cause a crash like this but only intermittent or on certain devices which could have to do with the resources available on the devices and mix of what is happening on that device. One user says he always hard stops it before running it but it still crashed on him which kind of dismisses its a state issue with it being up to long. Mike -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.comjavascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] ICS 4.0.4 emulator image?
On Wed, Nov 21, 2012 at 9:10 AM, Francisco Marzoa franci...@marzoa.com wrote: I have problems with some devices that uses ICS 4.0.4, mainly with Samsung Galaxy SIII ones. I have create an emulator instance to try to debug this as closed as possible to SGS3, but I have been unable to reproduce the problem at all. I only have ICS 4.0.3 on the emulator that comes with ADT in Eclipse, so I rather like to test this in an ICS 4.0.4 emulator to see if it makes the difference. Is there any manner to run an ICS 4.0.4 emulator? There was no new SDK for Android 4.0.4, and hence no new official emulator. It is conceivable that somebody built an emulator image from the AOSP sources for 4.0.4, and that this is available for download, but it will not be through the SDK Manager. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] What happens when we give the value 0 for the arguement of intervalMillis is given below method of android
Dear All, *What happens when we give the value 0 for the arguement of intervalMillis is given below method of android* AlarmManager.setRepeating (int type, long triggerAtMillis, long intervalMillis, PendingIntent operation) Whether it will repeat the alarm for the 0 milliseconds are perform otherwise. Im testing android 2.3.3 All are welcome to give their ideas -- *Thanks Regards, Sivakumar.J* -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] debugging crashes on some systems ( not all )
On 11/21/2012 03:20 PM, Piren wrote: Indeed, one of android's strong advantages (to the consumer) is also a big disadvantage (to the developer). That's exactly what I write down in my Google+ profile this weekend, so I fuuullyy gre with that. ;-) I was faced with similar heap issues, did the same thing as you did, mostly came to the conclusion that the best thing is just to drop the bitmaps altogether or reduce their resolutions as much as possible. You should watch out with Recycling manually as this might cause issues in some instances (like when the bitmap is used in a listview), i found that just nulling the drawable Callback and making the bitmap Purgable was sufficient for GC to work correctly and avoid OutOfMemory exceptions. I did it manually to reduce heap consumption peaks. You know: sometimes I need to load different bitmaps for a given screen, but even when the object of the previous screen has been already dereferenced, the bitmaps it uses has not yet been collected, so by a second I will have bitmaps for both screens on the memory. I have noticed that if I recycle the bitmaps of the first screen before switching, when I load those needed for the second screen the old ones have yet been recycled, thus my heap use peak is a lot of lower. Of course you should be careful on not using recycled bitmaps and things like that, but my code is pretty clear and I am not experiencing this kind of crashes at all, so there is no point worrying about... we have enough to be concerned with actual bugs to think about potential ones... ;-) When it comes to testing, you can always just use your more knowledgeable customers as QA. I have no doubt that if you develop apps like developers tools or so this could be very useful, but I do casual games and most of my users does not even fill crash reports, and the few ones whose do put things so descriptive as it is not working, and others simply comply on comments rating the game with one star and swearing about my mum or so... Start a beta program with a bunch of users (or friends :) ) that will test your app in advance. That's a great idea that I have had in mind before, but discarded due as typical nerd I have not many friends... X-D But perhaps I could think about any incentive. I will have it in account... You'll be able to reach a wider variety of devices and catch those big issues early on before releasing the app to the public. Emulators by the way, wont do the job as they dont emulate the different hardware specifications of each device. Well, it is true that they have great limitations, not only for not having the hardware, also because some manufactures make their own customized Android versions. But they are still useful for testing and detecting obvious bugs. Hope there were a renting mobile service on my town or something similar... Best regards, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] OOM with heap enough
Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595) 3at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:77) 4at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:133) 5at net.iberdroid.ruletaafortunadacore.MainMenuScreen.loadImages(MainMenuScreen.java:255) 6at net.iberdroid.ruletaafortunadacore.MainMenuScreen.enable(MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] OOM with heap enough
First, you do not know necessarily what BitmapFactory.Options are being specified on the decodeResource() call, as that does not appear to be called from your code, and it could be they have strange values in there. Beyond that, last I knew, Dalvik does not have a compacting garbage collector. I haven't seen a recent statement as to whether or not that limitation has been fixed. If it is still the case, though, your issue may not so much that you are out of memory, but that there is no single contiguous block that meets your needs. On Wed, Nov 21, 2012 at 9:48 AM, Francisco Marzoa fmmar...@gmail.comwrote: Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595) 3at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:77) 4at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:133) 5at net.iberdroid.ruletaafortunadacore.MainMenuScreen.loadImages(MainMenuScreen.java:255) 6at net.iberdroid.ruletaafortunadacore.MainMenuScreen.enable(MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] ICS 4.0.4 emulator image?
Ok, thanks for your answer, Mark. On 11/21/2012 03:28 PM, Mark Murphy wrote: On Wed, Nov 21, 2012 at 9:10 AM, Francisco Marzoa franci...@marzoa.com wrote: I have problems with some devices that uses ICS 4.0.4, mainly with Samsung Galaxy SIII ones. I have create an emulator instance to try to debug this as closed as possible to SGS3, but I have been unable to reproduce the problem at all. I only have ICS 4.0.3 on the emulator that comes with ADT in Eclipse, so I rather like to test this in an ICS 4.0.4 emulator to see if it makes the difference. Is there any manner to run an ICS 4.0.4 emulator? There was no new SDK for Android 4.0.4, and hence no new official emulator. It is conceivable that somebody built an emulator image from the AOSP sources for 4.0.4, and that this is available for download, but it will not be through the SDK Manager. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: OOM with heap enough
Maybe your heap is heavily fragmented and there is not 1.5megs of contiguous space? On Wednesday, November 21, 2012 8:50:41 AM UTC-6, Fran wrote: Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595) 3at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:77) 4at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:133) 5at net.iberdroid.ruletaafortunadacore.MainMenuScreen.loadImages(MainMenuScreen.java:255) 6at net.iberdroid.ruletaafortunadacore.MainMenuScreen.enable(MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] OOM with heap enough
On 11/21/2012 03:58 PM, Mark Murphy wrote: First, you do not know necessarily what BitmapFactory.Options are being specified on the decodeResource() call, as that does not appear to be called from your code, and it could be they have strange values in there. Well, as far as my own code reaches (AndroidGraphics.java:77), I do set these options. Options options = new Options(); options.inPreferredConfig = Config.ARGB_; options.inScaled = false; [...] bitmap = BitmapFactory.decodeResource(this.context.getResources(), resourceId, options); Beyond that, last I knew, Dalvik does not have a compacting garbage collector. I haven't seen a recent statement as to whether or not that limitation has been fixed. If it is still the case, though, your issue may not so much that you are out of memory, but that there is no single contiguous block that meets your needs. Well, it may happen, but the evidence on that is really weak. The game has just started and it is loading the main menu screen, with only a few objects in memory, so it is unlikely that in these circunstances and with 15Mb of free heap an image of just 1M5 as raw ARGB_ will not find an slot. On Wed, Nov 21, 2012 at 9:48 AM, Francisco Marzoa fmmar...@gmail.com mailto:fmmar...@gmail.com wrote: Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595) 3at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:77) 4at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:133) 5at net.iberdroid.ruletaafortunadacore.MainMenuScreen.loadImages(MainMenuScreen.java:255) 6at net.iberdroid.ruletaafortunadacore.MainMenuScreen.enable(MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com mailto:android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com mailto:android-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: OOM with heap enough
As told to Mark, I do not think so: the game is just starting, loading the first Screen at all. Also I have never experienced such problems on my own devices or emulators, and I have spent many time watching DDMS... of course it cannot be discarded at 100%, though. Regards, On 11/21/2012 04:03 PM, bob wrote: Maybe your heap is heavily fragmented and there is not 1.5megs of contiguous space? On Wednesday, November 21, 2012 8:50:41 AM UTC-6, Fran wrote: Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595) 3at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:77) 4at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:133) 5at net.iberdroid.ruletaafortunadacore.MainMenuScreen.loadImages(MainMenuScreen.java:255) 6at net.iberdroid.ruletaafortunadacore.MainMenuScreen.enable(MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: debugging crashes on some systems ( not all )
Sounds like you want ACRA. On Tuesday, November 20, 2012 5:08:46 PM UTC-6, Mike Adams wrote: Hi, I have a kind of chat and game client, it connects to a board game server and is a tabbed android app. There is a telnet thread and it feeds through concurrently linked queues 3 worker threads that update a game board, a text console and i have a lists tab. The problem is i've had 2 users now complain that the program has crashed on them, one said it froze his phone. I can't be clear if the program crashed or if its something with their phones, one was a samsung s3 i think the other some kind of acer tablet if i recall. But how would i evaluate this? It's never crashed for me on my tablet or phone. What kind of things could cause a crash like this but only intermittent or on certain devices which could have to do with the resources available on the devices and mix of what is happening on that device. One user says he always hard stops it before running it but it still crashed on him which kind of dismisses its a state issue with it being up to long. Mike -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] OOM with heap enough
I remember reading about a similar issue in the past and experienced the same issue as well. From what i recall, but dont take my word for it, even if there is room in the heap and it isnt fragmented beyond belief, Dalvik first checks if the heap can be enlarged to include the needed space, instead of trying to use the space it has free. Since you're already at 48MB, you've just pushed through the limit with the new needed allocation (regardless of the fact you have the space), and Dalvik throws the OutOfMemoryException. I had it happen to me as well. Only solution i've found? to never get the heap so large it sits on the edge (stupid bug, stupid solution, i know). I think Dianne Hackburn mentioned that, maybe a google search will find it. On Wednesday, November 21, 2012 5:18:33 PM UTC+2, Fran wrote: On 11/21/2012 03:58 PM, Mark Murphy wrote: First, you do not know necessarily what BitmapFactory.Options are being specified on the decodeResource() call, as that does not appear to be called from your code, and it could be they have strange values in there. Well, as far as my own code reaches (AndroidGraphics.java:77), I do set these options. Options options = new Options(); options.inPreferredConfig = Config.ARGB_; options.inScaled = false; [...] bitmap = BitmapFactory.decodeResource(this.context.getResources(), resourceId, options); Beyond that, last I knew, Dalvik does not have a compacting garbage collector. I haven't seen a recent statement as to whether or not that limitation has been fixed. If it is still the case, though, your issue may not so much that you are out of memory, but that there is no single contiguous block that meets your needs. Well, it may happen, but the evidence on that is really weak. The game has just started and it is loading the main menu screen, with only a few objects in memory, so it is unlikely that in these circunstances and with 15Mb of free heap an image of just 1M5 as raw ARGB_ will not find an slot. On Wed, Nov 21, 2012 at 9:48 AM, Francisco Marzoa fmma...@gmail.comjavascript: wrote: Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 2at android.graphics.BitmapFactory.decodeResource(BitmapFactory.java:595) 3at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:77) 4at com.badlogic.androidgames.framework.impl.AndroidGraphics.newPixmap(AndroidGraphics.java:133) 5at net.iberdroid.ruletaafortunadacore.MainMenuScreen.loadImages(MainMenuScreen.java:255) 6at net.iberdroid.ruletaafortunadacore.MainMenuScreen.enable(MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.comjavascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@googlegroups.comjavascript: To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: FM radio Android Application Developement
This guy seems to have done it: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlockhl=en On Tuesday, November 20, 2012 11:27:52 PM UTC-6, Karunakaran Vikash wrote: Hi , I need to create a FM radio android application , is there any api or methods for developing this... anything available means ,just drop me a mail .. Any useful links , please update me... THanks in Advance ... Regards, V.Karunkaran -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] SurfaceView
Can someone tell me in layman's terms why you would use a SurfaceView instead of a View when making a game? Is it because a dual-core can distribute the load better? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android in app purchase connection timeout
Hi All, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] SurfaceView
The main reason to use a SurfaceView is that you control the rendering thread and you can eliminate a lot of overhead. Views must use the invalidation mechanism to trigger redraws. A call to invalidate() walks up the View tree and marks Views dirty on top of keeping track of some extra state. When it reaches the top of the tree, it schedules a draw pass, which will in turn traverse the View tree down to call View.draw() on dirty Views (and also manage some extra state.) All this is usually unnecessary when you write a game. With SurfaceView you can draw directly. On Wed, Nov 21, 2012 at 8:26 AM, bob b...@coolfone.comze.com wrote: Can someone tell me in layman's terms why you would use a SurfaceView instead of a View when making a game? Is it because a dual-core can distribute the load better? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android in app purchase timeout.
Hi All, i just want to know that , how do i handle connection timeout problem when i send request for purchase. Google play in app service should return some value in Broadcast receiver to notify app regarding connection timeout. Please do needful. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: ListView checked state wrongly shared between 2 views when reorienting screen
Sorry for asking it here, but i have the same problem and some points were not clear for me. What do you mean by views that don't need to save their state? In my case, the problem is with custom views that don't have the same ids, but its children do, because it is created from a xml file. I thought of many workarounds, like using android:configChanges attribute in the manifest or commenting the line that calls the super.onRestoreInstanceState(), but I really wanna know if there is a solution for this that is not considered a workaround. Thanks in advance, Em sábado, 25 de abril de 2009 21h25min04s UTC-3, Toph escreveu: Hi, I have TabActivity that uses 2 other ListActivities for the tabs. Both underlying ListViews are set to CHOICE_MODE_MULTIPLE. When I run the following sequence of events, I get a strange result: 1) Setup one activity (tab) and its ListView using a CursorAdapter, including checking some items on the list 2) Reorient the screen (open the keyboard) 3) Setup the second activity (tab) and its ListView using a CursorAdapter, including checking some items on the list 4) Switch back to the first tab At this point, I can see in Eclipse that although (of course) each ListView is a distinct object, the internal variable used to store the checked state of items, called mCheckStates, is the SAME OBJECT REFERENCE in each of the ListViews. Clearly this is an issue, since the two views should not share the checked state of items between them. If I skip step #2, this does not occur Here is a bit more detail: After Step 1: ListView1 is object reference @1, ListView1.mCheckStates is object reference @2 After Step 2: ListView1 is object reference @3, ListView1.mCheckStates is object reference @4 (the reorientation recreates the views) After Step 3: ListView2 is object reference @5, ListView1.mCheckStates is object reference @2 -- note the reuse of this reference from step #1, not sure how/why After Step 4: ListView1 is object reference @3 (unchanged), ListView1.mCheckStates is object reference @2 (changed) -- same as ListView2.mCheckStates Please help Thanks -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Windows 8
My development PC just took a dive, and most of the decent PCs that I can find locally are now coming with Windows 8. I really don't want to go that route, but if I do, will the Android development environment, i.e., Eclipse and the various SDK tools, run OK on Windows 8? And how about drivers for Android devices? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] SurfaceView
According to Mario Zechner's book Beginning Android Games, you need a SurfaceView so you can render from a thread different from the UI one, and also because the Surface may be hardware accelerated. Bests, On 11/21/2012 05:26 PM, bob wrote: Can someone tell me in layman's terms why you would use a SurfaceView instead of a View when making a game? Is it because a dual-core can distribute the load better? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Windows 8
You should ask Microsoft about that, thought. Anyway I do not know what you understand for a decent PC. If it is a laptop, you are likely to be forced to use the SO that the manufactured have said, but if it is a PC box, it its really easy to buy one without SO at all and install it by yourself. Best regards, On 11/21/2012 06:16 PM, Doug Gordon wrote: My development PC just took a dive, and most of the decent PCs that I can find locally are now coming with Windows 8. I really don't want to go that route, but if I do, will the Android development environment, i.e., Eclipse and the various SDK tools, run OK on Windows 8? And how about drivers for Android devices? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] SurfaceView
Surfaces are always hardware accelerated in the sense that we use the GPU and/or other hardware chips to composite them on screen. This means all windows on Android behave this way. If you use a Canvas on a SurfaceView, the Canvas itself will still perform software rendering. On Wed, Nov 21, 2012 at 9:21 AM, Francisco Marzoa fmmar...@gmail.comwrote: According to Mario Zechner's book Beginning Android Games, you need a SurfaceView so you can render from a thread different from the UI one, and also because the Surface may be hardware accelerated. Bests, On 11/21/2012 05:26 PM, bob wrote: Can someone tell me in layman's terms why you would use a SurfaceView instead of a View when making a game? Is it because a dual-core can distribute the load better? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@** googlegroups.com android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@**googlegroups.comandroid-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] OOM with heap enough
Hi, That has no sense at all. I do not mean that you are not right, just mean that in such case it is a mighty bug... Best regards, 2012/11/21 Piren gpi...@gmail.com I remember reading about a similar issue in the past and experienced the same issue as well. From what i recall, but dont take my word for it, even if there is room in the heap and it isnt fragmented beyond belief, Dalvik first checks if the heap can be enlarged to include the needed space, instead of trying to use the space it has free. Since you're already at 48MB, you've just pushed through the limit with the new needed allocation (regardless of the fact you have the space), and Dalvik throws the OutOfMemoryException. I had it happen to me as well. Only solution i've found? to never get the heap so large it sits on the edge (stupid bug, stupid solution, i know). I think Dianne Hackburn mentioned that, maybe a google search will find it. On Wednesday, November 21, 2012 5:18:33 PM UTC+2, Fran wrote: On 11/21/2012 03:58 PM, Mark Murphy wrote: First, you do not know necessarily what BitmapFactory.Options are being specified on the decodeResource() call, as that does not appear to be called from your code, and it could be they have strange values in there. Well, as far as my own code reaches (AndroidGraphics.java:77), I do set these options. Options options = new Options(); options.inPreferredConfig = Config.ARGB_; options.inScaled = false; [...] bitmap = BitmapFactory.decodeResource(**this.context.getResources(), resourceId, options); Beyond that, last I knew, Dalvik does not have a compacting garbage collector. I haven't seen a recent statement as to whether or not that limitation has been fixed. If it is still the case, though, your issue may not so much that you are out of memory, but that there is no single contiguous block that meets your needs. Well, it may happen, but the evidence on that is really weak. The game has just started and it is loading the main menu screen, with only a few objects in memory, so it is unlikely that in these circunstances and with 15Mb of free heap an image of just 1M5 as raw ARGB_ will not find an slot. On Wed, Nov 21, 2012 at 9:48 AM, Francisco Marzoa fmma...@gmail.comwrote: Look at this: 0java.lang.OutOfMemoryError: (Heap Size=48547KB, Allocated=33541KB) 1at android.graphics.**BitmapFactory.**nativeDecodeAsset(Native Method) 2at android.graphics.**BitmapFactory.decodeResource(** BitmapFactory.java:595) 3at com.badlogic.androidgames.**framework.impl. **AndroidGraphics.newPixmap(**AndroidGraphics.java:77) 4at com.badlogic.androidgames.**framework.impl.**AndroidGraphics.newPixmap(* *AndroidGraphics.java:133) 5at net.iberdroid.**ruletaafortunadacore.** MainMenuScreen.loadImages(**MainMenuScreen.java:255) 6at net.iberdroid. **ruletaafortunadacore.**MainMenuScreen.enable(** MainMenuScreen.java:241) The image that I am trying to load at MainMenuScreen.java:255 The weird thing is that there is free heap enough for loading that image: it is a 800x480 png indexed but with transparency, so I load it using four bytes per pixel (ARGB) and it should use about 1M5 of memory as a raw bitmap... but it crashes anyway trying to load an image ten times smaller the available heap space (48-35 = 15Mb). These things makes me crazy... Bests, -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@**googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 4.3 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-d...@**googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to
Re: [android-developers] OOM with heap enough
Bitmap data is not allocated in the Java heap but in a much smaller area of native memory. So you can have several MB of Java Heap free and still have Bitmap OOM. Bitmaps are a total PITA to manage with Android. But it's doable. Except that when you thnk you are done fixing all OOM, a new surprise always awaits you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: debugging crashes on some systems ( not all )
On Wednesday, 21 November 2012 16:31:24 UTC+1, bob wrote: Sounds like you want ACRA. Seconded. It will enlighten with a new world of unsuspected fail. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Automate update every x secs get data from myUrl
Hello.I am new developer android and i want to make an application read data from my webserver and control my arduino board... I start with this example .for get data...ok work but only when click buttoni want to convert to automatic update.How i make this?. public class ReadWebpageAsyncTask extends Activity { private TextView textView; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_read_webpage_async_task); textView = (TextView) findViewById(R.id.textView1); } private class DownloadWebPageTask extends AsyncTaskString, Void, String { @Override protected String doInBackground(String... urls) { String response = ; for (String url : urls) { DefaultHttpClient client = new DefaultHttpClient(); HttpGet httpGet = new HttpGet(url); try { HttpResponse execute = client.execute(httpGet); InputStream content = execute.getEntity().getContent(); BufferedReader buffer = new BufferedReader(new InputStreamReader(content)); String s = ; while ((s = buffer.readLine()) != null) { response += s; } } catch (Exception e) { e.printStackTrace(); } } return response; } @Override protected void onPostExecute(String result) { textView.setText(result); } } public void readWebpage(View view) { DownloadWebPageTask task = new DownloadWebPageTask(); task.execute(new String[] { http://www.mysite.net/LEDstate.txt; }); } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] OOM with heap enough
As of 3.0 Bitmaps are allocated on Dalvik's heap. On Nov 21, 2012 10:23 AM, b0b pujos.mich...@gmail.com wrote: Bitmap data is not allocated in the Java heap but in a much smaller area of native memory. So you can have several MB of Java Heap free and still have Bitmap OOM. Bitmaps are a total PITA to manage with Android. But it's doable. Except that when you thnk you are done fixing all OOM, a new surprise always awaits you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] OOM with heap enough
And they were not allocated in a smaller area. They used to be allocated on the native heap but they counted against the Dalvik heap's usage (which is why you would get OOM anyway.) On Nov 21, 2012 10:23 AM, b0b pujos.mich...@gmail.com wrote: Bitmap data is not allocated in the Java heap but in a much smaller area of native memory. So you can have several MB of Java Heap free and still have Bitmap OOM. Bitmaps are a total PITA to manage with Android. But it's doable. Except that when you thnk you are done fixing all OOM, a new surprise always awaits you. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Best approach to handle Catch-Exception
Hi Guys, what is the best approach in a android application to handle Catch-Exceptions (java.lang.Exception) on the business layer? Cheers, Luiz -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Best approach to handle Catch-Exception
If I understand you correctly, you should proceed like with any other application. Which is: propagate errors to the GUI in order to make the user aware of the problem. But only under following conditions: * The user expects an immediate result but the action failed * The app cannot recover from that problem and requires the user's attention (like activating GPS, inserting SD card, corrupt / unformatted SD card etc.) If it is something the app can automatically recover from, do not bother the user at all. Typical scenarios are failed synchronization / download / upload attempts. Even in severe cases like data loss, if your app is able to fully restore the data from the cloud or a local backup I would not bother the user at all with these details. Stay silent and create a smooth and painless user experience. Most users are not interested in (problem) details anyway and they'd click away your notifications without reading them. You also should silently log all errors into a file. Provide a support feature that attaches the log file to an email. It's also a good idea to override the uncaught exception handler in order to log uncaught exceptions (but don't forget to invoke the default handler after logging, otherwise you won't get the app crash dialog). On Wednesday, November 21, 2012 12:53:04 PM UTC-6, Luiz Henrique wrote: Hi Guys, what is the best approach in a android application to handle Catch-Exceptions (java.lang.Exception) on the business layer? Cheers, Luiz -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Disable HDCP in Android 3.1
Ditto, did you find a solution? Nexus 10 has HDCP on and I need to turn it off... On Thursday, June 30, 2011 12:13:00 AM UTC-7, Pauland wrote: Ok, so nobody wants to answer this question, whatever the perfect spot where I ask ... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Best approach to handle Catch-Exception
Hi Nobu, we are sharing the same ideas about how and in what kind of condition should be showed error messages. Btw, I'm using ACRA to handle uncaught exception and it have worked fine. About catch-exception you understand me well. So, nowadays I'm using try/catch to grab the exceptions and sometimes there is a bunch of dirty code just to handle exceptions. I would like to know is there is some approach in android to handle in an unique Class/Method catch-exceptions. For example, something we can do using interceptors/AOP for others applications? I hope that I have been clear in my placements ;) Cheers, Luiz On Wed, Nov 21, 2012 at 2:10 PM, Nobu Games dev.nobu.ga...@gmail.comwrote: If I understand you correctly, you should proceed like with any other application. Which is: propagate errors to the GUI in order to make the user aware of the problem. But only under following conditions: * The user expects an immediate result but the action failed * The app cannot recover from that problem and requires the user's attention (like activating GPS, inserting SD card, corrupt / unformatted SD card etc.) If it is something the app can automatically recover from, do not bother the user at all. Typical scenarios are failed synchronization / download / upload attempts. Even in severe cases like data loss, if your app is able to fully restore the data from the cloud or a local backup I would not bother the user at all with these details. Stay silent and create a smooth and painless user experience. Most users are not interested in (problem) details anyway and they'd click away your notifications without reading them. You also should silently log all errors into a file. Provide a support feature that attaches the log file to an email. It's also a good idea to override the uncaught exception handler in order to log uncaught exceptions (but don't forget to invoke the default handler after logging, otherwise you won't get the app crash dialog). On Wednesday, November 21, 2012 12:53:04 PM UTC-6, Luiz Henrique wrote: Hi Guys, what is the best approach in a android application to handle Catch-Exceptions (java.lang.Exception) on the business layer? Cheers, Luiz -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Best approach to handle Catch-Exception
Luiz Henrique wrote: we are sharing the same ideas about how and in what kind of condition should be showed error messages. Btw, I'm using ACRA to handle uncaught exception and it have worked fine. ACRA? About catch-exception you understand me well. So, nowadays I'm using try/catch to grab the exceptions and sometimes there is a bunch of dirty code just to handle exceptions. I would like to know is there is some approach in android [sic] to handle in an unique Class/Method catch-exceptions. For example, something we can do using interceptors/AOP for others applications? Why would you call that code dirty? Is code that handles bad conditions somehow inferior to code that handles the happy path? I'm inclined to think the exact opposite. Much more likely to be good engineering than interceptors/AOP (huh?) would be good refactoring of your code. Dealing with exceptions is not an Android issue but a programming issue, and you need to fully understand what exceptions are and how they fit strategically. The boilerplate for exceptions can be verbose, but hey, at least you don't actually have to work for a living. The worst you can fear from it is a slight increase in callous on your fingertips. You reduce verbosity by isolating checked-exception handling to the lower-level routines. One standard (not necessarily best-practice) technique is to rethrow as a custom exception (checked or unchecked) which is handled by the top controller level in a user-friendly way. The lower-level routines do something pretty specific, say, open a resource, and eat all the checked exceptions that might engender, replacing them with defaults, custom exceptions or navigation, error return values, or whatever your strategy dictates. By relegating verbose exception handling to lower-level routines, the higher-level ones read much more like happy-path laconic self-documenting scripts. What do you mean by others applications? -- Lew -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Play a media file in the assets or res/raw folder in another app
Did you ever work this out? I'd be keen to know how if you did, thanks Russ On Friday, February 3, 2012 11:46:16 PM UTC, droid-stricken wrote: Hi All, I had posted this question yesterday on the stackoverflow. But no one seems to know the answer or have the time to make to share their thoughts. http://stackoverflow.com/q/9124314/693959 Is it possible to play a media file in the application's assets or res/ raw folder in another app like GALLERY or some other external media player? I am aware of the content-provider and content-resolver classes. But i have seen it being used only for sharing the application's database with other apps. Even if i created a content-provider for this video file, i am not sure how to consume it i.e be able to launch an intent and provide the video file as data to the 3rd party app. Any inputs is highly appreciated. Thanks. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Asset/Resource in Content Provider
Alex, I am having the same problem accessing resources through a content provider using all the resource sections to create a path. The weird thing is it workd from within the main app, but not passing a resource over the content provider. Did you ever solve this? Russ On Sunday, January 24, 2010 9:36:53 PM UTC, Alex wrote: Hey I need top specify a URI when opening an intent using the following line: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(mediaUri, image/png); My ContentProvider is all set up, but I have NO idea how to point the Uri to the resource or asset. the following does NOT work (cant find file): Uri mediaUri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + :// + getApplicationContext().getResources ().getResourcePackageName(R.drawable.icon) + / + R.drawable.icon); Cant get it working with assets OR resources Thanks Alex -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Play a media file in the assets or res/raw folder in another app
On Saturday, February 4, 2012 12:46:16 AM UTC+1, droid-stricken wrote: Hi All, I had posted this question yesterday on the stackoverflow. But no one seems to know the answer or have the time to make to share their thoughts. http://stackoverflow.com/q/9124314/693959 Is it possible to play a media file in the application's assets or res/ raw folder in another app like GALLERY or some other external media player? I am aware of the content-provider and content-resolver classes. But i have seen it being used only for sharing the application's database with other apps. Even if i created a content-provider for this video file, i am not sure how to consume it i.e be able to launch an intent and provide the video file as data to the 3rd party app. Any inputs is highly appreciated. Thanks. create a ContentProvider (in my case VideoProvider) and override openAssetFile like this: @Override public AssetFileDescriptor openAssetFile(Uri uri, String mode) throws FileNotFoundException { Log,d(TAG, uri: + uri.getPath()); AssetFileDescriptor fd = null; try { fd = getContext().getAssets().openFd(uri.getPath().substring(1)); } catch (IOException e) { e.printStackTrace(); } return fd; } in AndroidManifest add: provider android:name=.VideoProvider android:authorities=your.package..videoprovider/provider if you want external app to access it i think you could do it be creating an Intent like this: Uri movieUri = Uri.parse(content://your.package.videoprovider/movie.mp4) Intent intent = new Intent(); intent.setAction(android.content.Intent.ACTION_VIEW); intent.setDataAndType(movieUrl, video/*); startActivity(intent); where movie.mp4 sits in assets/movie.mp4 pskink -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Disable HDCP in Android 3.1
custom ROM like in xda On Wednesday, November 21, 2012 2:22:07 PM UTC-5, tgraupmann wrote: Ditto, did you find a solution? Nexus 10 has HDCP on and I need to turn it off... On Thursday, June 30, 2011 12:13:00 AM UTC-7, Pauland wrote: Ok, so nobody wants to answer this question, whatever the perfect spot where I ask ... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Automate update every x secs get data from myUrl
On Wed, Nov 21, 2012 at 12:40 PM, Antonis Kanaris ant...@in.gr wrote: i want to convert to automatic update.How i make this? In a word: AlarmManager. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Possible to replace the someone calling you screen
Is it possible to replace the built-in new-call screen (when someone calls you) with your own. Any help appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Replace built-in new phone call screen
Is it possible to replace the built-in new call arrived screen (i.e. when someone calls you). Any help appreciated. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to share resource folder independently in project ?
One idea I can think of is you can use build tool like Ant or Maven and download common resources from your repository and build the project. On Wednesday, November 21, 2012 12:29:23 AM UTC+11, Makrand wrote: I have one proper library project, it contais all resources and class files, this project contais all theme related images, I am sharing my library project for creating new Projects, all works fine. But when I want to change app theme related images, I need to update my library project images, but my library project already shared with some other projects so I dont want to touch it. There is one more way that I can add all new set of image in my New project but its increasing my project size and unnecessary I am shipping two sets on images. Is there any way to share resource folder independently with project? so depends on requirement I can share my resource folder with respected project. So it will be like this Library Project | |__ class files | |__ resource folder(contais all drawables and layouts) Can I choose specific resource folder at compile time ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Best approach to handle Catch-Exception
ACRA: bug reporting library that can report to a Google docs spreadsheet or other custom location. See : http://acra.ch/ -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: how to use android-support-v7-gridlayout project as a library project build in android2.3 launcher source code
anybody help? 在 2012年11月21日星期三UTC+8下午12时54分57秒,futurexiong写道: I am developing launcher base on android2.3 source code,I have tried to put android-support-v7-gridlayout.jar into libs and add LOCAL_STATIC_JAVA_LIBRARY in android.mk file and it complied well but have runtime error said NoClassDefFind R$dimen etc.I want to know whether we can build gridlayout project as a library project of Launcher in android source code environment,how to modify android.mk file? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Playing a part of the video
Can anybody help me out with this issue. I don't need any code. Guide me to the Class or documentation. Is this possible to do it in android (in iOS we can)? On Monday, 19 November 2012 19:56:24 UTC+5:30, praveen castelino wrote: I have a video of duration 180 seconds. I want to play only 30 seconds of this video starting from 60th second. i.e. only a part of the video needs to be played.(Start time : 60 sec, End time: 90 sec). Can this be doable in android? I have done the same on iOS but not able to find equivalent apis on android. It looks like MediaPlayer allows us to supply only the start time (i.e. seekto()) but not allows us to set the end time or the duration of the video. Any input on this would be great help to me. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] hi
First thanks for your replay and spend your valuable time for me. What ever u said entire thing is 100% right,but how can i solve my problem i did not have anybody for solve these problem. These is Login access using JSON webservices , Here My server code and Android is gave.when i running these code connection null is came in line number 54 in android code mobile class.if u have interest to solve these problem please solve me,database is not importent here.u can change whatever u have. plz execute and solve problem -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Customized Tab Layout in android.
Hello All , I am Working on Android Application and i needs to design a custom tab layout screen as shown Below , in which i wants to set a different Image in Middle tab, i have no clue whatsoever how to implement this, Please help me and guide me to how to do this. https://lh3.googleusercontent.com/-09HH2ip1uLs/UK2wJqd7poI/AEs/U1JBgJJCQ4M/s1600/screenshot.jpg Thanks Arun Joshi -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Best approach to handle Catch-Exception
Hi Lew, I agree with you and because that I'm spending a lot of time looking for the best solution to handler my exceptions in my android application. If you didn't understand this way, sorry. We have dozen of different technics to handle exceptions in a java application, AOP is just one them http://janistoolbox.typepad.com/blog/2009/12/errorhandlingaop.html The point is not if exceptions are important or not, particularly for me are very important for a success in a application (but it doesn't matter). So, this is my first android application and I just would like to heard and share some knowledge about usually how the guys handle your exceptions. Just that. ACRA is an awesome report bug solution to handle uncaught exceptions (100% free). Cheers, Luiz On Wed, Nov 21, 2012 at 3:30 PM, Lew lewbl...@gmail.com wrote: Luiz Henrique wrote: we are sharing the same ideas about how and in what kind of condition should be showed error messages. Btw, I'm using ACRA to handle uncaught exception and it have worked fine. ACRA? About catch-exception you understand me well. So, nowadays I'm using try/catch to grab the exceptions and sometimes there is a bunch of dirty code just to handle exceptions. I would like to know is there is some approach in android [sic] to handle in an unique Class/Method catch-exceptions. For example, something we can do using interceptors/AOP for others applications? Why would you call that code dirty? Is code that handles bad conditions somehow inferior to code that handles the happy path? I'm inclined to think the exact opposite. Much more likely to be good engineering than interceptors/AOP (huh?) would be good refactoring of your code. Dealing with exceptions is not an Android issue but a programming issue, and you need to fully understand what exceptions are and how they fit strategically. The boilerplate for exceptions can be verbose, but hey, at least you don't actually have to work for a living. The worst you can fear from it is a slight increase in callous on your fingertips. You reduce verbosity by isolating checked-exception handling to the lower-level routines. One standard (not necessarily best-practice) technique is to rethrow as a custom exception (checked or unchecked) which is handled by the top controller level in a user-friendly way. The lower-level routines do something pretty specific, say, open a resource, and eat all the checked exceptions that might engender, replacing them with defaults, custom exceptions or navigation, error return values, or whatever your strategy dictates. By relegating verbose exception handling to lower-level routines, the higher-level ones read much more like happy-path laconic self-documenting scripts. What do you mean by others applications? -- Lew -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: FM radio Android Application Developement
ya ,, this is an External Application only na.. then how he can made it... ?? Is there any other way for it... ? On Wednesday, November 21, 2012 10:57:52 AM UTC+5:30, Karunakaran Vikash wrote: Hi , I need to create a FM radio android application , is there any api or methods for developing this... anything available means ,just drop me a mail .. Any useful links , please update me... THanks in Advance ... Regards, V.Karunkaran -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How Android LVL react when one or more gmail accounts are logged in
Hello all I need some clarification on how android LVL will react when multiple gmail accounts are logged in the phone i,e one of the account may be valid account(account through which app was purchased) and other may be normal gmail accounts Will it actually validate the license check even phone has multiple accounts??? According to my knowledge it considers very first gmail account added to the phone and sends the appropriate response if app was purchsed through that account Please correct me if iam wrong waitng for some more info from you all -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en