[android-developers] Re: Nested layouts in separate XML
I am really surprised to see this thread! I have googled how to nest XML-based layouts, assuming it is possible, however found this. This is a basic functionality, guys. There are some threads around about why to use XML based layouts, MVC, etc... and I agree that extracting the view in XML is a good idea (I didn't liked it as a start), however we have to be able to reuse those layouts... Please consider extending the framework, this is important piece of functionality missing. And I cannot imagine being that hard - some cyclic dependencies checks, pure text insertions otherwise will do. -- 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: Should a service maintain a reference to a Broadcast Receiver
On Jan 31, 8:14 pm, AndroidDevTime androiddevd...@gmail.com wrote: Is it a bad practice to maintain a service level reference to a BroadcastReceiver? I do see there is a service level method service.registerReceiver Under what situations is it appropriate to register the BroadcastReceiver with a service? registerReceiver is actually a method defined by Context, from which Activities, Services, and Application all inherit. You register a broadcast receiver in a Service when that service needs to know about a broadcast during its lifetime, just like any Activity. In other words, there's nothing to sweat. Just unregister it before it's destroyed. To hold a static reference to a broadcast receiver in a service? Thanks. That won't fly with Android. When a Service is destroyed, and you haven't unregistered all your receiver, Android will complain and force them to become unregistered, just like Activities. Anyway, what are you doing that makes it necessary to have a static member in a Service? Doug -- 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: Subclassing Android Application
Hi, This has been discussed fairly extensively eg http://groups.google.com/group/android-developers/browse_thread/thread/b48f0fa3784f8e27/f2c256026a0962cf?lnk=gstq=One+process,+two+live+Application+objects%3F#f2c256026a0962cf Regards On Feb 1, 3:50 pm, TreKing treking...@gmail.com wrote: On Mon, Jan 31, 2011 at 10:33 PM, AndroidDevTime androiddevd...@gmail.comwrote: Are there any compatibility issues or disadvantages with subclassing the Android application? What compatibility issues would there be? --- -- 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] Meaning of getMobileRxPackets and getTotalRxBytes in TrafficStats
What exactly means getMobileRxBytes () ? Get the total number of bytes received through the mobile interface. Total number since when ? Device boot, phone unplug ? Also getTotalRxBytes ? Get the total number of bytes received through all network interfaces. What interfaces beside mobile and WI-FI ? If only these two, it's okay to assume that getTotalRxBytes - getMobileRxBytes = WI-FI traffic ? -- 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] opengles 2.0 sdk issues on Droid X
I'm having some problems with the froyo sdk implementation of gles20. My game is working without problems on two Snapdragon devices (Sharp Galapagos and HTC Desire). However, they will not work properly on a Droid X. So far, I have these two problems: 1. Shaders will not compile on the Droid X (using GLES20.glCreateProgram(), GLES20.glGetShaderiv() returns 0) 2. Transparency works sometimes and not other times on the Droid X. To get my game working on the Droid X, I have reduced the shaders to simple pass-through shaders, and removed transparencies. This isn't really a solution at all. However, I don't have a Droid X or even another phone with an SGX gpu to test on. Does anyone have any insight into this 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] Re: Problems storing images with Base64 encode into a row of a SQL DB
Get the database from your device, or emulator, and check it with local tools. SQLite3 has a lot of GUIs BLOBs were designed specifically for usage as you need. On 31 янв, 20:02, saex elpablos...@gmail.com wrote: 0 down vote favorite Hi i'm encodding images with Base64 into Strings, and i am uploading these images into a remote database, in a row of the table USER. That row is TEXT, because i dont know if there is anothr String type with more space than TEXT. When i store very small images, with 5 or 10 KB of space, they store OK, and when i get these images back from the sql DB into my app, i can decode them into BitMap and show them into a ImageView. THE PROBLEM: When i store images with for example 110 KB of space, i think they doesn't store OK in the TEXT row of my table USER in the SQL DB, because when i try to decode them, i got an error, they can't be decoded, but i dont know why, because the decode function of Base64 simply returns null when he can't decode. There is a way to solve it? How munch KB can have a image to be stored into the row of a databse? The better option for the row is to be TEXT ? or there is another Type that can store more higher Strings? 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: Picking images from gallery (SD Card) on my app… ¿How to allow only max 500kb photos?
new File(filePath).length(); // gets you size in bytes On 31 янв, 18:58, saex elpablos...@gmail.com wrote: Hi, **WHAT I HAVE DONE NOW:** i am picking images on my app with android, and showing them on a ImageView of my layout, and sometimes i got an exception `java.lang.OutOfMemoryError: bitmap size exceeds VM budget`. This happens when the photos are higher than 500kb. **WHAT I NEED TO DO (AND I DONT KNOW HOW TO DO IT):** then, what i want to do is to allow the user only to select photos of maximum 500kb. And if the user selects a photo Higher than 500kb, then, my app should show a toast telling the user that only can select photos of max 500kb ¿how to do it? this is my code: changeImageButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI); startActivityForResult(i, ACTIVITY_SELECT_IMAGE); } }); protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { super.onActivityResult(requestCode, resultCode, imageReturnedIntent); switch(requestCode) { case 1: { setResult(1); finish(); } case ACTIVITY_SELECT_IMAGE: if(resultCode == RESULT_OK){ Uri selectedImage = imageReturnedIntent.getData(); String[] filePathColumn = {MediaStore.Images.Media.DATA}; Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null); cursor.moveToFirst(); int columnIndex = cursor.getColumnIndex(filePathColumn[0]); String filePath = cursor.getString(columnIndex); cursor.close(); selectedPhoto = BitmapFactory.decodeFile(filePath); //profileImage.setImageBitmap(selectedPhoto); profileImage.setImageBitmap(Bitmap.createScaledBitmap(selectedPhoto, 80, 80, false)); } } } profileImage is a ImageView of my layout. and i use scaled butmap to resice the image to 80x80 please give me some help to do that, im searching on google and i can't find nothing -- 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