Re: [android-developers] Re: Where in code would i resize an image taken using intent?
Daniel, In my case, the large image is read from storage resized then saved to storage. Dave Truby On Apr 12, 2015 12:37 AM, "Daniel Chacon" wrote: > So what you are doing is resizing before or after being saved or uploaded? > > On Sat, Apr 11, 2015 at 6:59 AM, Dave Truby wrote: > >> Dan, >> >> I am doing the following in my Over Time app. Maybe it helps you. >> >> >> File aThumbnail = new File(pDir, TbsFile.THUMBNAIL_FILENAME); >> >> final float aRatio = (float) pPictureWidth / (float) pPictureHeight; >> >> final int aThumbnailWidth = Math.round(pThumbnailHeight * aRatio); >> >> final BitmapFactory.Options anOptions = new BitmapFactory.Options(); >> >> anOptions.inJustDecodeBounds = false; >> >> anOptions.inSampleSize = this.calculateInSampleSize(pPictureWidth, >> pPictureHeight, aThumbnailWidth, pThumbnailHeight); >> >> Bitmap aBitmap = >> BitmapFactory.decodeFile(pImageToMakeThumbnail.getAbsolutePath(), >> anOptions); >> >> Bitmap aScaledBitmap = Bitmap.createScaledBitmap(aBitmap, >> aThumbnailWidth, pThumbnailHeight, true); >> >> this.saveThumbnail(pContext, aThumbnail, aScaledBitmap); >> >>aScaledBitmap.recycle(); >> >> } >> >> private int calculateInSampleSize(final int pPictureWidth, final int >> pPictureHeight, >> >> final int pThumbnailWidth, final int pThumbnailHeight) { >> >> int aInSampleSize = 1; >> >> if (pPictureHeight > pThumbnailHeight || pPictureWidth > >> pThumbnailWidth) { >> >> final int aHeightRatio = Math.round((float) pPictureHeight / (float) >> pThumbnailHeight); >> >> final int aWidthRatio = Math.round((float) pPictureWidth / (float) >> pThumbnailWidth); >> >> aInSampleSize = aHeightRatio < aWidthRatio ? aHeightRatio : aWidthRatio; >> >> } >> >> return aInSampleSize; >> >> } >> >> private void saveThumbnail(final Context pContext, final File >> pThumbnail, final Bitmap pScaledBitmap) { >> >> boolean isCreated = false; >> >> FileOutputStream anOutputStream = null; >> >> try { >> >> anOutputStream = new FileOutputStream(pThumbnail); >> >> pScaledBitmap.compress(Bitmap.CompressFormat.JPEG, >> >> TbsCreateThumbnailAsyncTask.JPEG_COMPRESSION, anOutputStream); >> >> isCreated = true; >> >> } catch (IOException anIoEx) { >> >> this.error("saveThumbnail()", anIoEx); >> >> } catch (Exception anEx) { >> >> this.error("saveThumbnail()", anEx); >> >> } finally { >> >> if (null != anOutputStream) { >> >> try { >> >> anOutputStream.close(); >> >> } catch (IOException e) { >> >> // nothing >> >> } >> >> } >> >> if (isCreated) { >> >> MediaScannerConnection.scanFile(pContext, >> >>new String[] { pThumbnail.getAbsolutePath() }, null, >> >>new MediaScannerConnection.OnScanCompletedListener() { >> >>@Override >> >>public void onScanCompleted(final String pPath, final Uri pUri) { >> >> TbsCreateThumbnailAsyncTask.this.info("onScanCompleted()", "Scanned >> thumbnail " + pPath + TbsLog.PERIOD); >> >>} >> >>}); >> >> } >> >> } >> >> } >> >> >> On Friday, April 10, 2015 at 5:27:42 PM UTC-4, Dan Cha wrote: >>> >>> So ive been reading a few posts some using Bitmap.createScaledBitmap, >>> some using .compress feature and each one i try, never throws an exception >>> or error, but file never gets resized. >>> >>> I found this routine, but it doesnt do anything as far as the image >>> taken. So basically within my app i allow the user to take a pic to attach >>> to the submission. >>> When you take the image, it displays a thumbnail on the screen, at this >>> point the image is already saved to the phones gallery. >>> I need to resize it (without changing the proportions) to make sure that >>> the image is no larger than 200px wide or high because once you submit the >>> form, im uploading the image to our server. >>> >>> public Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) { >>> int width = bm.getWidth(); >>> int height = bm.getHeight(); >>> float scaleWidth = ((float) newWidth) / width; >>> float scaleHeight = ((float) newHei
[android-developers] Re: Where in code would i resize an image taken using intent?
Dan, I am doing the following in my Over Time app. Maybe it helps you. File aThumbnail = new File(pDir, TbsFile.THUMBNAIL_FILENAME); final float aRatio = (float) pPictureWidth / (float) pPictureHeight; final int aThumbnailWidth = Math.round(pThumbnailHeight * aRatio); final BitmapFactory.Options anOptions = new BitmapFactory.Options(); anOptions.inJustDecodeBounds = false; anOptions.inSampleSize = this.calculateInSampleSize(pPictureWidth, pPictureHeight, aThumbnailWidth, pThumbnailHeight); Bitmap aBitmap = BitmapFactory.decodeFile(pImageToMakeThumbnail.getAbsolutePath(), anOptions); Bitmap aScaledBitmap = Bitmap.createScaledBitmap(aBitmap, aThumbnailWidth, pThumbnailHeight, true); this.saveThumbnail(pContext, aThumbnail, aScaledBitmap); aScaledBitmap.recycle(); } private int calculateInSampleSize(final int pPictureWidth, final int pPictureHeight, final int pThumbnailWidth, final int pThumbnailHeight) { int aInSampleSize = 1; if (pPictureHeight > pThumbnailHeight || pPictureWidth > pThumbnailWidth) { final int aHeightRatio = Math.round((float) pPictureHeight / (float) pThumbnailHeight); final int aWidthRatio = Math.round((float) pPictureWidth / (float) pThumbnailWidth); aInSampleSize = aHeightRatio < aWidthRatio ? aHeightRatio : aWidthRatio; } return aInSampleSize; } private void saveThumbnail(final Context pContext, final File pThumbnail, final Bitmap pScaledBitmap) { boolean isCreated = false; FileOutputStream anOutputStream = null; try { anOutputStream = new FileOutputStream(pThumbnail); pScaledBitmap.compress(Bitmap.CompressFormat.JPEG, TbsCreateThumbnailAsyncTask.JPEG_COMPRESSION, anOutputStream); isCreated = true; } catch (IOException anIoEx) { this.error("saveThumbnail()", anIoEx); } catch (Exception anEx) { this.error("saveThumbnail()", anEx); } finally { if (null != anOutputStream) { try { anOutputStream.close(); } catch (IOException e) { // nothing } } if (isCreated) { MediaScannerConnection.scanFile(pContext, new String[] { pThumbnail.getAbsolutePath() }, null, new MediaScannerConnection.OnScanCompletedListener() { @Override public void onScanCompleted(final String pPath, final Uri pUri) { TbsCreateThumbnailAsyncTask.this.info("onScanCompleted()", "Scanned thumbnail " + pPath + TbsLog.PERIOD); } }); } } } On Friday, April 10, 2015 at 5:27:42 PM UTC-4, Dan Cha wrote: > > So ive been reading a few posts some using Bitmap.createScaledBitmap, some > using .compress feature and each one i try, never throws an exception or > error, but file never gets resized. > > I found this routine, but it doesnt do anything as far as the image taken. > So basically within my app i allow the user to take a pic to attach to the > submission. > When you take the image, it displays a thumbnail on the screen, at this > point the image is already saved to the phones gallery. > I need to resize it (without changing the proportions) to make sure that > the image is no larger than 200px wide or high because once you submit the > form, im uploading the image to our server. > > public Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) { > int width = bm.getWidth(); > int height = bm.getHeight(); > float scaleWidth = ((float) newWidth) / width; > float scaleHeight = ((float) newHeight) / height; > // CREATE A MATRIX FOR THE MANIPULATION > Matrix matrix = new Matrix(); > // RESIZE THE BIT MAP > matrix.postScale(scaleWidth, scaleHeight); > > // "RECREATE" THE NEW BITMAP > Bitmap resizedBitmap = Bitmap.createBitmap(bm, 0, 0, width, height, > matrix, false); > return resizedBitmap;} > > > When the user clicks the image button on the screen, the camera opens and > allows them to take the pic, ive tried to call the above routine within this > event after everything so that i know the file is created and exists. > > > Here is the event for that: > > private ImageButton.OnClickListener takePicture_Button_listener = new > ImageButton.OnClickListener() > { > public void onClick(View v) > { > StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() > .detectDiskReads() > .detectDiskWrites() > .detectNetwork() > .penaltyLog() > .build()); > // create Intent to take a picture and return control to the > calling application > Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); > > //User fileUri for full path to image taken. > fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a > file to save the image > fname = > fileUri.toString().substring(fileUri.toString().lastIndexOf("/")+1); > intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the > image file name > > // start the image capture
[android-developers] Bluetooth devices connected list - getConnectedDevices()
This call is for bluetooth low energy connections. Are you sure you have a low energy device connected? It looks like you are connecting a mouse, I'm not sure that is a low energy device. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[android-developers] Re: Choreographer regularly skipping frames during OpenGL Render
Thanks for the response, Doug, but we're talking about two different things. I'm not referring to the errors that show up the log tagged Choreographer when the frame warning limit is triggered on the main thread. I'm talking about actually using the Choreographer API to render OpenGL content locked to VSYNC. These delays are on the rendering threads. While I understand frames dropping periodically when the system is servicing other work, the inability to manage even a few second without skipping several VSYNC intervals indicates to me that something else is wrong with the GL code. Thanks again, Dave Smith, PE Double Encore, Inc. On Sunday, April 13, 2014 12:51:07 PM UTC-6, Doug wrote: > > Bear in mind that anything could be causing main thread delays. It could > be your code. It could be other threads in your app's process. It could > be other apps running on the device. It could be Android itself. It could > be any combination of these things. This is to be expected with > multitasking multiuser operating systems and the wide variety of devices > out there and their hardware capabilities. > > The Choreographer itself doesn't start complaining about skipped frames in > logcat until after 30 frames have been skipped: > > private static final int SKIPPED_FRAME_WARNING_LIMIT = > SystemProperties.getInt( > "debug.choreographer.skipwarning", 30); > > So maybe you can lighten up your own acceptable threshold for frames > skipped (unless you're actually observing the jank that you're trying to > avoid)? > > Doug > > On Friday, April 11, 2014 10:37:39 AM UTC-7, Dave Smith wrote: >> >> Hello all - >> >> I am working on an application that is using Choreographer and OpenGL to >> render flash patterns on the display. Our GL calls are quite simple, >> simply toggling the display back and forth between white and black using >> glClearColor() based on the frame time and status of the pattern we want to >> apply. The timing of this pattern if very critical, and I am having severe >> issues getting consistent behavior out of the timing pulses we received >> from Choreographer to do the rendering. >> >> For simplicity sake, I have basically copied the Basic Dream application >> in AOSP, so 95% of my code looks exactly like this sample: >> >> https://android.googlesource.com/platform/packages/screensavers/Basic/+/master >> >> Our only change is that, where they call mSquare.draw() inside of >> doFrame(), we have another method called drawFrame() that does the >> following: >> >> private void drawFrame() { >> final boolean nextBit = mPattern[mIndex]; >> >> if (nextBit) { >> glClearColor(1.0f, 1.0f, 1.0f, 1.0f); >> } else { >> glClearColor(0.0f, 0.0f, 0.0f, 1.0f); >> } >> glClear(GL_COLOR_BUFFER_BIT); >> >> return true; >> } >> >> However, for the purposes of this discussion, you can see the *exact >> same behavior* by simply running the AOSP sample as an application (i.e. >> changing the Colors class from a DreamService to a launcher Activity). >> >> The problem is that on a regular basis (at least once per second, often >> many times), the debug logging returns that the frame callback took 33ms >> (instead of 16ms), and in many cases 50ms+! I can understand skipping a >> rare frame here or there, but skipping 3-4 frames at once seems like I'm >> missing something big here. Not all devices do this, but high-end devices >> like the Nexus 5 and GS4 do. Devices we've tested like the Note 3, GS3, >> and Moto X don't seem to do so nearly as often. Example typical logcat >> over a period of 30 seconds: >> >> 04-11 11:35:43.918 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (49865722 ms) frame 2 >> 04-11 11:35:43.948 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 3 >> 04-11 11:35:43.988 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (33233641 ms) frame 4 >> 04-11 11:35:44.018 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (33233644 ms) frame 5 >> 04-11 11:35:45.860 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 115 >> 04-11 11:35:46.881 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (33233641 ms) frame 175 >> 04-11 11:35:47.692 10441-10455/com.android.dreams.basicgl >> V/ColorsGLRenderer﹕ JANK! (33233642 ms) frame 222 >> 04-
[android-developers] Choreographer regularly skipping frames during OpenGL Render
Hello all - I am working on an application that is using Choreographer and OpenGL to render flash patterns on the display. Our GL calls are quite simple, simply toggling the display back and forth between white and black using glClearColor() based on the frame time and status of the pattern we want to apply. The timing of this pattern if very critical, and I am having severe issues getting consistent behavior out of the timing pulses we received from Choreographer to do the rendering. For simplicity sake, I have basically copied the Basic Dream application in AOSP, so 95% of my code looks exactly like this sample: https://android.googlesource.com/platform/packages/screensavers/Basic/+/master Our only change is that, where they call mSquare.draw() inside of doFrame(), we have another method called drawFrame() that does the following: private void drawFrame() { final boolean nextBit = mPattern[mIndex]; if (nextBit) { glClearColor(1.0f, 1.0f, 1.0f, 1.0f); } else { glClearColor(0.0f, 0.0f, 0.0f, 1.0f); } glClear(GL_COLOR_BUFFER_BIT); return true; } However, for the purposes of this discussion, you can see the *exact same behavior* by simply running the AOSP sample as an application (i.e. changing the Colors class from a DreamService to a launcher Activity). The problem is that on a regular basis (at least once per second, often many times), the debug logging returns that the frame callback took 33ms (instead of 16ms), and in many cases 50ms+! I can understand skipping a rare frame here or there, but skipping 3-4 frames at once seems like I'm missing something big here. Not all devices do this, but high-end devices like the Nexus 5 and GS4 do. Devices we've tested like the Note 3, GS3, and Moto X don't seem to do so nearly as often. Example typical logcat over a period of 30 seconds: 04-11 11:35:43.918 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (49865722 ms) frame 2 04-11 11:35:43.948 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 3 04-11 11:35:43.988 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233641 ms) frame 4 04-11 11:35:44.018 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233644 ms) frame 5 04-11 11:35:45.860 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 115 04-11 11:35:46.881 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233641 ms) frame 175 04-11 11:35:47.692 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233642 ms) frame 222 04-11 11:35:48.242 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264160 ms) frame 255 04-11 11:35:49.373 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233643 ms) frame 322 04-11 11:35:53.908 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33268229 ms) frame 594 04-11 11:35:56.190 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 730 04-11 11:35:56.690 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233643 ms) frame 759 04-11 11:35:57.751 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (49965416 ms) frame 821 04-11 11:35:57.781 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33164467 ms) frame 822 04-11 11:35:58.952 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33233643 ms) frame 891 04-11 11:36:04.678 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264161 ms) frame 1235 04-11 11:36:05.919 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264159 ms) frame 1308 04-11 11:36:07.781 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33298746 ms) frame 1419 04-11 11:36:07.821 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (49800618 ms) frame 1420 04-11 11:36:08.672 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33325196 ms) frame 1470 04-11 11:36:11.955 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264160 ms) frame 1666 04-11 11:36:13.687 10441-10455/com.android.dreams.basicgl V/ColorsGLRenderer﹕ JANK! (33264159 ms) frame 1770 Any help from the OpenGL experts in the room is greatly appreciated! Is there something the sample is doing poorly that I just unknowingly copied into my own 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscrib
Re: [android-developers] Using ACTION_OPEN_DOCUMENT for editing files
Thanks for the thoughts, Jeff. I understand your reasoning, so perhaps the best course of action is to modify the example documentation. The "Edit a document" section of the SAF Guide (https://developer.android.com/guide/topics/providers/document-provider.html#edit) states that to "edit a text document in place", the correct choice is ACTION_OPEN_DOCUMENT. Based on what you are saying, since ACTION_CREATE_DOCUMENT allows you to pick an existing file, that is the better choice for "in place editing". The guide should probably either be changed to reflect ACTION_CREATE_DOCUMENT for editing, or to indicate that using ACTION_OPEN_DOCUMENT should include a branch check on FLAG_SUPPORTS_WRITE to determine if the edit can happen in place, or if ACTION_CREATE_DOCUMENT will need to be used anyway to create a new file for the edit changes. Thanks again, Dave Smith @devunwired > -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Using ACTION_OPEN_DOCUMENT for editing files
As far as I can tell from the documentation and testing with the new Storage Access Framework and Intent.ACTION_OPEN_DOCUMENT, there doesn't seem to be a way (via an extra or otherwise) to pass with the Intent request to open a document to only return documents from providers that support writing (i.e. have FLAG_SUPPORTS_WRITE set). Instead, we are forced to check a document selection made by the user (via a metadata query) to determine if the document supports write before we attempt to open an OutputStream or ParcelFileDescriptor in "w" mode. Is this correct, or have I overlooked something? This seems to be a large missing piece in the new Storage Access Framework when attempting to allow a user to open an existing document to be edited as it forces the user to make a selection first, then have us check if they can write, throw and error if they cannot, and force them to pick again. Furthermore, we cannot say that it is uncommon for documents providers not to support writing, because even the system media documents provider (i.e. the source for images/videos) does not support write and will throw and IllegalArgumentException ("Media is read-only") when one attempts to write to one of its files (as an image editing app, the most common example used in the docs, would attempt to do). Is there a proper method with the new SAF of limiting selections to writable providers only? Feedback appreciated for anything I may have missed here. As it stands, suggesting that developers use ACTION_OPEN_DOCUMENT for in-place editing doesn't seem like a viable approach. Dave Smith @devuwired -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Deep sleep after 1 hour?
Heres a starter http://stackoverflow.com/questions/1082437/android-alarmmanager but you will probably need to do a bit more research on AlarmManager. On Tuesday, 23 April 2013 09:51:00 UTC+1, paladin wrote: > > It's actually sending the location of the phone every 30 seconds to the > server. Where would the alarm be located that you're talking about? > > On Tuesday, April 23, 2013 4:26:11 AM UTC-4, Dave Shortman wrote: >> >> Does the app do anything else other than ping the server? Best way to >> approach this really would be to set an alarm which fires every 30 seconds, >> when you receive the alarm take a partial wakelock and fire a service to >> perform the ping, this service should also take and release a wakelock >> whilst performing the ping. >> >> On Monday, 22 April 2013 22:00:32 UTC+1, paladin wrote: >>> >>> I have an app that is supposed to send a ping to a server every 30 >>> seconds. When the app goes to sleep, it's still supposed to do this, but >>> I've been testing and it seems to stop sending any updates after 1 hour, >>> consistently. Is this a "deep sleep"? I have seen no documentation on this. >>> Has anyone experienced this? Would anyone know how to keep it from going >>> into deep sleep? >> >> -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Deep sleep after 1 hour?
Does the app do anything else other than ping the server? Best way to approach this really would be to set an alarm which fires every 30 seconds, when you receive the alarm take a partial wakelock and fire a service to perform the ping, this service should also take and release a wakelock whilst performing the ping. On Monday, 22 April 2013 22:00:32 UTC+1, paladin wrote: > > I have an app that is supposed to send a ping to a server every 30 > seconds. When the app goes to sleep, it's still supposed to do this, but > I've been testing and it seems to stop sending any updates after 1 hour, > consistently. Is this a "deep sleep"? I have seen no documentation on this. > Has anyone experienced this? Would anyone know how to keep it from going > into deep sleep? -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Cannot get the initial SDK setup working, nightmare
Using the AVD tool (inside Eclipse, menu "Window" -> "Android Virtual Device Manager"), create at least one virtual device. See http://developer.android.com/tools/devices/index.html After you have a virtual device created, start it by selecting it in the list (in AVD manager) then click the "Start" button. Note: depending on your computer, it may take a while for the emulator to start. After you see the emulator window and the android virtual device is fully booted, click around to see how it works (it is slightly different than a real device). With the emulator running, right click on your android project and select "Run as" -> "Android application". You may be asked to select a device (pick the AVD you just created). I find it easier to run my android project on my phone (connected via usb). See http://developer.android.com/tools/device.html On Sunday, March 31, 2013 7:46:15 AM UTC-4, NewToAndroid wrote: > > Hi All, > > I am on a Windows Vista (32 bit) laptop, using Java version 1.6.0_29. I > downloaded the "Android SDK ADT Bundle" from developer.android.com. I am > under impression that, I need not do any other setup/installation when I am > using the bundle. Using a Windows account which is administrator. Created > the basic "Hallo World App" which is shown here " > http://developer.android.com/training/basics/firstapp/creating-project.html"; > . Now trying to run it on emulator, which is proving to be a nightmare (so > much so that, I am on the verge of giving up learning Android development). > 1) When I run the application, should the emulator be already running? or > Eclipse will start it? > 2) When I click on "Run -> Run" or "Run -> Run as -> Android Application", > nothing happens, no prompts, no messages on console, nothing. I am not sure > if I should wait for something to happen or there is something missing? > 3) Emulator is already running. Clicked on Run -> Run. Nothing happened > > Are there any configurations, parameters, which need to be done before I > try to run the project? > > 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: Error in the "Interacting with other apps" class on developer.android.com
In the link you provided I see the Uri.parse() syntax. On Saturday, March 30, 2013 4:09:03 PM UTC-4, Mateusz Matlengiewicz wrote: > > Hi, > > I'm new to Android app developement so forgive me if what I write is > untrue. > I was looking throu the starting classes and in > http://developer.android.com/training/basics/intents/result.html#StartActivityI > found this line of code: > > > Intent pickContactIntent = new Intent(Intent.ACTION_PICK, new > Uri("content://contacts")); > > My Eclipse IDE is showing me an error with the Uri class, after some > searching I managed to get it working with > > Intent pickContactIntent = new Intent(Intent.ACTION_PICK, > Uri.parse("content://contacts")); > > Now my question is am I doing something wrong or is it really an error in the > tutorial? > > Sincerly, > MM > > > -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: App ran at startup
You can have an activity started at boot by doing the following: public class BootReceiver extends BroadcastReceiver { public void onReceive(Context context) { context.startActivity(new Intent(context, SomeActivity.class)); } } On Saturday, March 23, 2013 6:22:44 PM UTC-4, J4ckkn1fe wrote: Is there anyway to make an app run at startup and open a locked browser, > user cannot minimize it or close. The said phone would not have any other > apps everything would be run through the website. Also the phone > wouldn't receive calls. You can compare the functionality I want to achieve > to that of the itouch. Except everything would be ran through a website. Is > this possible with android if I heavily modded it? -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[android-developers] Re: How to dynamically add new ImageView instances to RelativeLayout?
You are setting the id in tiles[i].setId(i); Also, titles[i] does not appear to have any children, so why tiles[i].findViewById() I'm probably not seeing what you are trying to do. On Sunday, March 31, 2013 6:10:00 AM UTC-4, langui...@gmail.com wrote: > > What I am trying to do is create *N* (in this case 9) copies of the > ImageView object R.id.tile, place each of them at different coordinates > on the layout, and give each its own individual identifier. > > *BoardLayout.class:* > > @Overrideprotected void onCreate(Bundle savedInstance){ > super.onCreate(savedInstance); > setContentView(R.layout.board_layout); > entire_layout = (RelativeLayout)findViewById(R.layout.board_layout); > inner_layout = (RelativeLayout)findViewById(R.id.board); > View[] tiles = new ImageView[9]; > > > for(int i = 0; i tiles[i] = (ImageView)findViewById(R.id.tile); > tiles[i].setId(i); > params = new RelativeLayout.LayoutParams(-1, 345); > params.leftMargin = 32*2*3; > params.topMargin = 34*2*3; > layout.addView(tiles[i].findViewById(R.id.tile)); > } > ... > > > *board_layout.xml:* > > xmlns:android="http://schemas.android.com/apk/res/android"; > android:layout_width="fill_parent" > android:layout_height="fill_parent" > android:background="@drawable/backgroundcolor" > android:orientation="vertical" > > > android:id="@+id/topbar" > ... > > > android:id="@+id/imagebutton" > ... /> > > > > android:id="@+id/board" > android:layout_width="match_parent" > android:layout_height="345dp" > android:layout_centerVertical="true" > android:background="@drawable/wwfboard" > > > android:id="@+id/myView" > android:layout_width="fill_parent" > android:layout_height="fill_parent" /> > > android:id="@+id/tile" > android:layout_width="21dp" > android:layout_height="21dp" > android:src="@drawable/tile" /> > > > > However, I keep getting the *"Source not found"* error on the last line: > layout.addView(tiles[i].findViewById(R.id.tile));.. > > Any ideas why? > > (Side question: is RelativeLayout better than AbsoluteLayout for working > with coordinates?) > > -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [android-developers] Efficient Tablet Resource Selection
Hey Mark - Apologies, I misspoke on the newer devices. That part of the equation does work as expected for 3.2+ devices since smalles width is a higher priority selector. You make a valid point about older devices with a single qualifier and how eliminating just flags the device didn't understand rather than the whole directory would make the resources look like default resources in that case, and cause overlap in others. It makes sense why it doesn't work the way I had hoped. The larger problem this creates is becoming more notable as higher resolution, larger screen phones become available. The biggest issue with the "5 directory" solution I posted above is that it allows newer handset devices that understand they are smaller than 600dp, but are physically large enough to report "large" will now drop into the wrong bucket (i.e the upcoming Droid DNA). The hope was that by combining the two into a single directory we could reduce code duplication and close those loopholes, but I'm not sure a solution exists here. Perhaps the only true is answer is two APKs on each side of the division line. Or maybe eliminating "large" as an option...if it's pre-3.2 and not a 10" tablet perhaps it deserves to run the same UI as the handset... If only there was a market qualifier to mask out specific versions so we could support 2.2 - 4.1 with a single APK, just excluding 3.0 and 3.1 ;p Dare to dream... On Wednesday, November 7, 2012 9:13:10 AM UTC-7, Mark Murphy (a Commons Guy) wrote: > > On Wed, Nov 7, 2012 at 10:38 AM, Dave Smith > > wrote: > > In my mind, the old devices that don't understand the "sw" qualifier > should > > just ignore its existence and the two directories should just look like > > "large" and "xlarge". > > If a directory has an unrecognized qualifier, the directory is > skipped; the qualifier is not simply ignored. Hence, older devices > will not "see" your -swNNNdp resources. You can demonstrate this by > taking a vanilla project, renaming res/layout/ to res/layout-swNNNdp/ > (for some likely value of NNN), and running it on an old emulator. > > > On the other side, with new devices, the "sw" > > qualifier should take precedence so the "large" and "xlarge" should > become > > irrelevant. > > Hmmm... > > I just ran a test on a project, where I changed it to have just one > layout resource directory: res/values-sw100dp-normal/. That directory > was picked up by a 4.0.3 WVGA800 emulator. Given your description, I > would have expected it to fail here with a ResourceNotFoundException, > since there is no place to fail over to. > > Do you happen to have a test project that demonstrates what you're seeing? > > -- > 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] Efficient Tablet Resource Selection
I am trying to develop an efficient method of including resource qualifiers to appropriately select the layouts (and other resources really) for handsets, small tablets, and large tablets. To properly support devices on both sides of Android 3.2, when smallest width was introduced, I had hoped to be able to create a hierarchy like so: res/layout/ + Default and handset-specific layouts res/layout-sw600dp-large/ + Small Tablet assets, where necessary res/layout-sw720dp-xlarge/ + Large Tablet assets, where necessary However, constructing a simple test application in this manner reveals that the concept won't work. All devices load the default resources, regardless of their OS version and display configuration. The primary point of this method is to eliminate the duplication that would otherwise be required to place the "sw600dp" asset and "large" asset (which are the same) into separate directories. Even aliasing a single layout into the two directories represents a duplication of code. To support older devices, it would be nice to continue to use just the old qualifiers, but newer handset devices with larger screens are starting to creep into the "large" category, forcing the use of smallest width where available. So my first question here is: I know my original idea does not work, but I want to know WHY it doesn't work?? In my mind, the old devices that don't understand the "sw" qualifier should just ignore its existence and the two directories should just look like "large" and "xlarge". On the other side, with new devices, the "sw" qualifier should take precedence so the "large" and "xlarge" should become irrelevant. As a result, the method with the least code duplication that I can come up with is as follows: res/layout/ + All layout assets, with tablet specific names in cases where necessary res/values-sw600dp/ + Aliases to apply small tablet layouts with the default name res/values-large/ + Same aliases to apply small tablet layouts with the default name res/values-sw720dp/ + Aliases to apply large tablet layouts with the default name res/values-xlarge/ + Same aliases to apply large tablet layouts with the default name This reduces the duplication to at least one line in two places rather than copying an entire file. Does anyone know of a method that works that would clean this up even further? 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] Help with bluetooth printing Please
Can Somebody help please? I think I have tried every app available for bluetooth printing and have pulled all my hair out now ,The problem is. I have installed printer share onto my HTC phone which is running android 2.3.5 and on my Samsung tablet galaxy tab 2 which is running android 4.0.4. and printing on a bluetooth HP deskjet 450 it all works fine when printing from my HTC phone but when trying to print from the tablet it starts to print and then a message comes up: *software caused connection abort*? It seams the samsung tablets sends the information too quick to the print. When printing from HTC phone when it is sending information to the printer the percentage numbers go up slower than when sending from Samsung which makes me think why it is aborting? Hope somebody can help please -- 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: installation of audio in /mnt/sdcard
Ok, that is a pity, because the app would contain code that will never be used again. I know it is probably not much space, but not neat to my opinion. On Mon, Sep 10, 2012 at 10:29 PM, lbendlin wrote: > not to my knowledge. > > > On Monday, September 10, 2012 4:12:33 PM UTC-4, drstikko wrote: > >> In linux for example you can use an install script >> that is part of the install package or organize it >> in such a way that the distro 'knows' where to place it. >> >> I don't like it that the app itself has to do install tasks >> >> Is there such an approach? >> >> On Mon, Sep 10, 2012 at 10:04 PM, lbendlin wrote: >> >>> Not sure what you mean. This is all very pedestrian. use standard file >>> management routines. Inputstream, outputstream etc. Here is an example to >>> copy a database from the package to a usable location >>> >>> InputStream myInput = myContext.getAssets().open(DB_**NAME); >>> // Path to the just created empty db >>> String outFileName = DB_PATH + DB_NAME; >>> // Open the empty db as the output stream >>> OutputStream myOutput = new FileOutputStream(outFileName); >>> // transfer bytes from the inputfile to the outputfile >>> byte[] buffer = new byte[1024]; >>> int length; >>> while ((length = myInput.read(buffer)) > 0) { >>> myOutput.write(buffer, 0, length); >>> } >>> >>> // Close the streams >>> myOutput.flush(); >>> myOutput.close(); >>> myInput.close(); >>> buffer = null; >>> >>> >>> >>> >>> On Monday, September 10, 2012 5:27:25 AM UTC-4, drstikko wrote: >>>> >>>> Ok, but how do I do that? >>>> Is there a standard scriptname that contains these commands? >>>> >>>> Dave >>>> >>>> Op zaterdag 8 september 2012 14:30:48 UTC+2 schreef lbendlin het >>>> volgende: >>>>> >>>>> During the initial run of your application you can copy the required >>>>> files from the package to the sd card.Bonus points if you use the standard >>>>> folder ( /data/Android/your.app.name/**fi**les<http://your.app.name/files> >>>>> or some such) >>>>> >>>>> On Friday, September 7, 2012 7:53:45 AM UTC-4, drstikko wrote: >>>>> >>>>>> Hello, >>>>>> >>>>>> as far as I know only audio that is located in /mnt/sdcard is played >>>>>> by the webview class. >>>>>> No my question is: "how do I let the installation apk install the in >>>>>> a folder on /mnt/sdcard?" >>>>>> Or if people think it is possible to play them from the res or assets >>>>>> folder : "how do I do that?" >>>>>> >>>>>> regards, >>>>>> >>>>>> Dave >>>>>> >>>>> -- >>> 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=en<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 > -- 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: installation of audio in /mnt/sdcard
In linux for example you can use an install script that is part of the install package or organize it in such a way that the distro 'knows' where to place it. I don't like it that the app itself has to do install tasks Is there such an approach? On Mon, Sep 10, 2012 at 10:04 PM, lbendlin wrote: > Not sure what you mean. This is all very pedestrian. use standard file > management routines. Inputstream, outputstream etc. Here is an example to > copy a database from the package to a usable location > > InputStream myInput = myContext.getAssets().open(DB_NAME); > // Path to the just created empty db > String outFileName = DB_PATH + DB_NAME; > // Open the empty db as the output stream > OutputStream myOutput = new FileOutputStream(outFileName); > // transfer bytes from the inputfile to the outputfile > byte[] buffer = new byte[1024]; > int length; > while ((length = myInput.read(buffer)) > 0) { > myOutput.write(buffer, 0, length); > } > > // Close the streams > myOutput.flush(); > myOutput.close(); > myInput.close(); > buffer = null; > > > > > On Monday, September 10, 2012 5:27:25 AM UTC-4, drstikko wrote: >> >> Ok, but how do I do that? >> Is there a standard scriptname that contains these commands? >> >> Dave >> >> Op zaterdag 8 september 2012 14:30:48 UTC+2 schreef lbendlin het volgende: >>> >>> During the initial run of your application you can copy the required >>> files from the package to the sd card.Bonus points if you use the standard >>> folder ( /data/Android/your.app.name/**files<http://your.app.name/files> >>> or some such) >>> >>> On Friday, September 7, 2012 7:53:45 AM UTC-4, drstikko wrote: >>> >>>> Hello, >>>> >>>> as far as I know only audio that is located in /mnt/sdcard is played by >>>> the webview class. >>>> No my question is: "how do I let the installation apk install the in a >>>> folder on /mnt/sdcard?" >>>> Or if people think it is possible to play them from the res or assets >>>> folder : "how do I do that?" >>>> >>>> regards, >>>> >>>> Dave >>>> >>> -- > 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] upload photos on web server.
I worked on android, I am not newbie to it. actually, I got the idea but it was not impressive. but i need help for it. or any thing which can help me to sort out the problem. 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] Messenger from Remote Service Causing Memory Leak
Dianne - Thanks so much for the insight! That seems very much to be the case because if I force a GC through DDMS on the remote process, all those objects in the application process finally get released. Something else I would recommend is to not do a design where you > instantiate Messenger objects for each IPC you do. Create one Messenger > that you pass in to each IPC call. Otherwise you can generate a lot of > remoted objects that are being kept around due to other processes > continuing to hold references because the other side is not aggressively > garbage collecting since all the objects it is creating due to these calls > are small. Your point is well taken about the design issue; this statement looks to describe my application exactly. The service has so few objects it rarely ever triggers GC, but it is in control of all the other objects in my application process. I will take a look at this and the workaround you proposed as well. Thanks again! Dave Smith @devunwired On Thursday, August 30, 2012 4:12:02 PM UTC-6, Dianne Hackborn wrote: > > It is true that sending a messenger across processes will require holding > a GREF on it for the other process to communicate with it. Barring bugs > (which have happened but I am not sure if in any released platform > versions), the GREF will be released when the other process itself no > longer holds a reference on this. When we are talking about things in > Dalvik "no longer holds a reference" generally means "the other side has > garbage collected the Java proxy object." > > What this means is that when you throw a Messenger (or any IBinder object) > across to another process, the Dalvik VM in your own process can no longer > manage the memory of that object itself and is dependent on all remote > objects releasing it until it can be released locally. And this will > include all objects that the IBinder has any references to as well. > > A common pattern to deal with this is to use a WeakReference in your > IBinder/Messenger that holds the references to the rest of your objects > that it will access. This allows your local garbage collector to clean up > all of those other objects (which may be quite heavy, holding big things > like bitmaps and such) even though a remote process still has a reference > on your IBinder. Of course if you do this, there needs to be something > else holding a reference on these other objects until they are no longer > needed, or else the garbage collector could clean them up *before* they are > no longer needed. > > Something else I would recommend is to not do a design where you > instantiate Messenger objects for each IPC you do. Create one Messenger > that you pass in to each IPC call. Otherwise you can generate a lot of > remoted objects that are being kept around due to other processes > continuing to hold references because the other side is not aggressively > garbage collecting since all the objects it is creating due to these calls > are small. > > -- > Dianne Hackborn > Android framework engineer > hac...@android.com > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- 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] Messenger from Remote Service Causing Memory Leak
I have an application that communicates with a Service in a remote process using the Messengerinterface. Here is the basic architecture of how things are set up: - The application generates several "Operation" objects that require access to the service. - Each "Operation" contains a Handler wrapped in a Messenger used as a callback receive the response data back from the Service - When the operation executes, it wraps its Messenger into an Intent and calls startService() to pass the message to the remote service - The remote service does some work based on the parameters of the Intent and then returns the response by sending a Message to the Messenger for that operation. Here is the basic code present in the operation: public class SessionOperation { /* ... */ public void runOperation() { Intent serviceIntent = new Intent(SERVICE_ACTION); /* Add some other extras specific to each operation */ serviceIntent.putExtra(Intent.EXTRA_EMAIL, replyMessenger); context.startService(serviceIntent); } private Handler mAckHandler = new Handler() { @Override public void handleMessage(Message msg) { //Process the service's response } }; protected Messenger replyMessenger = new Messenger(mAckHandler); } And a basic snippet of how the service is structured: public class WorkService extends Service { private ServiceHandler mServiceHandler; private final class ServiceHandler extends Handler { public ServiceHandler(Looper looper) { super(looper); } @Override public void handleMessage(Message msg) { onHandleIntent((Intent)msg.obj); } } @Override public int onStartCommand(Intent intent, int flags, int startId) { //If intent has a message, queue it up Message msg = mServiceHandler.obtainMessage(); msg.obj = intent; mServiceHandler.sendMessage(msg); return START_STICKY; } private void onHandleIntent(Intent intent) { Messenger replyTarget = intent.getParcelableExtra(Intent.EXTRA_EMAIL); /* Do some work */ Message delivery = Message.obtain(...); replyTarget.send(delivery); } } This all works fantastically well. I can send tons of operations from several different applications to the same service and they all process and send their response to just the right place. However... I noticed that if the application ran long enough and with enough activity it would crash with anOutOfMemoryError. Upon looking at the HPROF data in MAT, I noticed that all these operations where staying in memory, and they were held hostage from the Garbage Collector because of theMessenger. Apparently, the Messenger instance is creating a long-term native connection to Binder that counts as a GC Root, which is keeping each "Operation" object in memory indefinitely. [image: MAT Trace Example] Does anyone know if there is a way to clear or disable the Messenger when the "Operation" is over so it doesn't create this memory leak? Is there perhaps a better way to implement the IPC to the Servicein the same fashion, so that multiple disparate objects can make a request and get a result asynchronously? I'm not convinced that just switching to using a bound service implementation will solve this issue as I would will need the Messenger to process the callback. -- 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: ViewPager and setClipChildren(false)
Which is why we will all be eagerly watching the bug that Mark filed in anticipation :) Cheers, Dave Smith @devunwired On Wednesday, August 29, 2012 3:24:50 AM UTC-6, Romain Guy (Google) wrote: > > Note that using software layers comes at a performance and memory cost. > > > On Tue, Aug 28, 2012 at 4:45 PM, Dave Smith > > wrote: > >> Thesalan - >> >> Calling setLayerType() on just the View will work, but you have to do it >> on the correct view. In this case, the issue that doesn't work with >> hardware acceleration is the parent ViewGroup clipping its children, so the >> PagerContainer in the example is the view that you need to call it on, not >> the ViewPager itself. If you modify PagerContainer.java in the gist like >> so: >> >> private void init() { >> setClipChildren(false); >> setLayerType(View.LAYER_TYPE_SOFTWARE, null); >> } >> >> You should be able to enable hardware acceleration in your manifest and >> the pager code will still work as expected. I will update the gist example >> when I have a spare moment with some discussion, and I have starred the >> issue Mark created (you should do the same). >> >> Cheers, >> Dave Smith >> @devunwired >> > > -- > Romain Guy > Android framework engineer > roma...@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] Re: ViewPager and setClipChildren(false)
Thesalan - Calling setLayerType() on just the View will work, but you have to do it on the correct view. In this case, the issue that doesn't work with hardware acceleration is the parent ViewGroup clipping its children, so the PagerContainer in the example is the view that you need to call it on, not the ViewPager itself. If you modify PagerContainer.java in the gist like so: private void init() { setClipChildren(false); setLayerType(View.LAYER_TYPE_SOFTWARE, null); } You should be able to enable hardware acceleration in your manifest and the pager code will still work as expected. I will update the gist example when I have a spare moment with some discussion, and I have starred the issue Mark created (you should do the same). Cheers, Dave Smith @devunwired On Monday, August 27, 2012 2:29:20 AM UTC-6, Thesalan wrote: > > Hi! > > I started Android development last week, and I have a problem with a code > on some devices : > > I have to develop an application with a specific controller like a > horizontal wheel. To do this, I want to use the ViewPager, with > setClipChildren(false) to extend the view. I based on the following code : > https://gist.github.com/8cbe094bb7a783e37ad1 > > The result looks like this : > > > <https://lh4.googleusercontent.com/-DjFOnG7O0wY/UDstWN3AE2I/AfE/yWpndOBTWIA/s1600/emulator.png> > The ViewPager here is just on "Item4", and with setClipChildren(false) we > can see the other item. > > This works greats on emulator (tested on API 7 to 16) and some devices! > > But I encounter some problems on more recent devices, like HTC One X > (Android 4.0.4) and a Nexus S (CM10 - Android 4.1.1) : the ViewPager > doesn't really extended! Just the current item is shown, and when you are > sliding, the next item is shown : > > > <https://lh3.googleusercontent.com/-clS7voj3rLk/UDsvfP1HnhI/AfM/K8uMV_9PLFA/s1600/onex_current.png> > > When sliding : > > > <https://lh5.googleusercontent.com/-3tYaKu_Oz7w/UDsvnljXJ0I/AfU/JEaCZolThJ4/s1600/onex_sliding.png> > > > > Anybody else already encounter this problem? I think is an optimization on > these devices, but how can I bypass this? > > 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
[android-developers] Re: ADB and Mountain Lion Issues
It's too early to tell at this point, but the 10.8.1 update seems to have helped quite a bit. I'm not longer needing to play USB Port roulette in order to get the device to pick up. At least for now. -- 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: ADB and Mountain Lion Issues
Macbook Pro, and it definitely does. Symptoms are the same regardless of device. On Friday, August 10, 2012 4:02:33 PM UTC-6, bob wrote: > > I have the Galaxy Tab 10.1, and it doesn't give me any trouble. Are you > sure it gives you trouble? > > Also, are you on Macbook Air or Pro? I'm on Pro. > -- 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: ADB and Mountain Lion Issues
Galaxy Tab 10.1, Nexus 7, Droid 2, Droid Intercept; I'm fairly confident it's not device/manufacturer specific. Wondering if there's a USB cache I can clear... -- 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: ADB and Mountain Lion Issues
This definitely does help, but only for 1-2 times; then I have to move the port again. This is definitely faster than rebooting the devices, though, so this will be my new go-to workaround. It just feels like there's a bug somewhere in how it picks up connected devices, or how it reads the enumeration info in the new Mac OS. Does ADB have a cache of devices it's seen that might not be clearing properly? On Wednesday, August 8, 2012 11:24:55 AM UTC-6, Kenneth wrote: > > Try using a different usb port. Fixed it for me. I'm using the new MacBook > Pro. > -- 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: ADB and Mountain Lion Issues
As an addition to this, I have noticed that I can almost always get the devices to detect if I power them down and then back up while still connected to USB. The problem arises trying to get ADB to pick them up if they are connected while alive. -- 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] ADB and Mountain Lion Issues
I noticed that, as soon as I upgraded to Mac OS Mountain Lion (10.8) I have been unable to reliably get any of my devices to connect with ADB (Galaxy Nexus, Nexus S, HTC EVO 4G, just to name a few). It can take upwards of 10-15 cable re-plugs, re-starts of the ADB server, and toggling USB Debugging on the device before it finally shows up. I attempted to load the Android File Transfer Application (http://www.android.com/filetransfer/) thinking it might have something to do with the lack of MTP support on Mac OS, but that did not seem to change anything. There are no further updates to SDK beyond 20.0.1 that I can see which might address the issue either. Has anyone else who upgraded noticed this? -- 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] backend for app?
is there a better backend for apps? i know php and mysql. should i just go with what i know? -- 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: Renderscript Deprecated
To add a little more context to the deprecation notice (I think the choice of the word "experimental" is a little misleading, sorry for the confusion): The feedback we got from internal and external app developers was that they preferred to use OpenGL directly because of familiarity & portability either through our Java bindings or NDK. In contrast, we do see interest in the compute API of Renderscript. Hence we've decided to no longer evolve the RS graphics APIs (hence deprecation notice) and instead focus on building out Renderscript's GPU-compute support and developing Renderscript further especially for applications such as image processing. Dave On Saturday, June 30, 2012 2:45:17 PM UTC-7, Mark Murphy (a Commons Guy) wrote: > > On Sat, Jun 30, 2012 at 5:18 PM, Romain Guy > wrote: > > - Renderscript Graphics has always been hardware accelerated > > The point is that, according to the 4.1 release notes, we should no > longer use "Renderscript Graphics": > > https://developer.android.com/about/versions/android-4.1.html#Renderscript > > "Note: The experimental Renderscript graphics engine is now deprecated". > > The concerns are: > > 1. Why were we not told that this was "experimental" at the time > Renderscript Graphics was announced? I see no evidence on the Web that > Renderscript Graphics was described as "experimental". > > 2. If half a subsystem is now deprecated, why is that announcement > buried in release notes, rather than being called out a bit more > visibly? > > At the end of the day, Google can do whatever it wants to. Personally, > I am just trying to figure out where the communications breakdowns > occurred. > > Thanks! > > -- > 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 3.7 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] Using searchview in ActionBar can't save state between rotation because onCreateOptionsMenu called twice
Has anyone seen this behavior in ICS? What's happening is if a fragment is participating in the options menu for an activity both the activity's and fragments onCreateOptionsMenu is being called twice when the phone is rotated but only once when the activity is initially started. (See my linked stackoverflow.com question below for complete code and output) The bigger problem is that if a fragment adds a SearchView to the options menu, the SearchView can't remember it's state when the phone is rotated. It's no longer has any text in the textview after the rotation. If the activity uses a searchview, the state is saved correctly when rotated. I've seen this on the emulator running ICS 4.0 (API 14) and 4.0.3 (API 15) and also Verizon Galaxy Nexus running 4.0.4 build IMM76K. I can't figure out what's causing the onCreateOptionsMenu to be called twice. It doesn't make sense that this would be the normal way to create the options menu when rotating the phone. Maybe I'm doing something wrong to cause this? or I need to handle the onCreateOptionsMenu differently when the phone state is changed. Here's my question on stack overflow. This is complete with example code and log output of what I'm seeing. http://stackoverflow.com/questions/11003941/android-oncreateoptionsmenu-called-twice-when-restoring-state#comment14380762_11003941 Thanks ahead of time for any 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
[android-developers] Installing PFX file in Andriod device through Phonegap
I am getting user specific pfx file by clicking office url. I can manually Install that pfx from my SD card to Andriod device. My question is . I have created one phonegap APK and after clicking my application ICON it should check for certificate is installed in my device or not ? if not then it should autometically install PFX file from perticular url by providing password . If it is alreay there then it should continue to login screen screen. Regards Rajeev Dave -- 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: GridLayout Text Clipping using Support Library
Same here. GridLayout library hasn't been user friendly. The documentation doesn't make any note of the fact that you need to use your own namespace for columnCount if you are targeting 4.0 and now this... I would advise people to use something else unless then really need the grid. On Apr 10, 9:55 am, Scott Olcott wrote: > This is happening on Gingerbread and ICS. When will the source for the > support library GridLayout be available in AOSP? Currently there is no way > to debug what is happening because there is no source available. > > > > > > > > On Monday, April 9, 2012 11:28:46 AM UTC-6, Romain Guy (Google) wrote: > > > You set the width of GridLayout to "wrap_content" so it will extend as > > far as its content can go. > > > On Mon, Apr 9, 2012 at 10:24 AM, Scott Olcott wrote: > > > I am using the GridLayout that is in r7 of the support library. I am > > having > > > an issue with text being clipped at the edge of the screen instead of > > being > > > wrapped. Here is a layout that reproduces the issue. > > > > > > xmlns:android="http://schemas.android.com/apk/res/android"; > > > android:layout_width="wrap_content" > > > android:layout_height="wrap_content" > > > > > > > android:minWidth="100dp" > > > android:text="test123" /> > > > > > > android:text="test test test test tes test tes test test test > > test > > > test test test" /> > > > > > > > When using the ICS version of GridLayout I can just add > > > android:layout_width="0dp" and android:layout_gravity="fill_horizontal" > > to > > > the TextView and it wraps the text instead clipping. However when I try > > > that using the support library GridView the whole TextView disappears. I > > > attached a screenshot from the Graphic Layout view in Eclipse that > > > demonstrates what is happening. It looks like the second TextView is not > > > inheriting it's size from it's container but is the same width as the > > > device. > > > > Is there a different way to get this to work correctly? > > > > -- > > > 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] Reading files in a background thread
I have a class that reads from an input file fine but when I add it to an Async thread it errors on openFileInput with the method being undefined even though I have imported exactly the same classes Am I not allowed to use this method in the background? code snippet is: public class buildcustomer extends AsyncTask { @Override protected String doInBackground(TextView... tv) { try { FileInputStream inFile = openFileInput("customer.csv"); InputStreamReader isr = new InputStreamReader(inFile); BufferedReader in = new BufferedReader(isr); while(!end){ String l_line = in.readLine(); -- 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] AdapterView and Selector functionality
How do I get the Selector highlighting functionality in an AdapterView? I cannot do: android:listSelector="@drawable/myadapterview_background" like in a gridview, because android:listSelector is not there. -- 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: Is there a way to change GridView zigzag direction and enforce column or row move?
Okay thanks On 17 jan, 13:41, Mark Murphy wrote: > On Tue, Jan 17, 2012 at 7:31 AM, Dave wrote: > >http://developer.android.com/reference/android/widget/GridView.html > > > The default way the elements of the array is put in a GridView is > > zigzagging left-right-down. > > > e.g. array {1,2,3,4,5,6,7,8,9,10} becomes > > by default (with columns fixed to 3) > > > 1,2,3 > > 4,5,6 > > 7,8,9 > > 10 > > > Is there a way to get to zigzag up-down-right (with rows fixed to 3)? > > > 1,4,7,10 > > 2,5,8 > > 3,6,9 > > Change your adapter to serve out the items in that order. Or, rewrite > GridView. Note that your example shows a mismatch of columns (4 in > first row, 3 in others), which GridView does not support, except for > the last row. > > > Also I like to be able to enforce a column move in getView. Free > > zigzag style: No fixed number of columns columns or rows: > > For instance in free up-down-right zigzag > > 1,5,6,9 > > 2, 7,10 > > 3, 8 > > 4 > > Write your own AdapterView. > > If you do not need selection events and your roster of items is small > enough (<100), the new GridLayout in Android 4.0, wrapped in a > ScrollView, can probably handle what you need. I think I saw a > backport of GridLayout for earlier versions of Android floating around > GitHub. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > _The Busy Coder's Guide to Android Development_ Version 3.7 Available!- Tekst > uit oorspronkelijk bericht niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - -- 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] Is there a way to change GridView zigzag direction and enforce column or row move?
http://developer.android.com/reference/android/widget/GridView.html The default way the elements of the array is put in a GridView is zigzagging left-right-down. e.g. array {1,2,3,4,5,6,7,8,9,10} becomes by default (with columns fixed to 3) 1,2,3 4,5,6 7,8,9 10 Is there a way to get to zigzag up-down-right (with rows fixed to 3)? 1,4,7,10 2,5,8 3,6,9 Also I like to be able to enforce a column move in getView. Free zigzag style: No fixed number of columns columns or rows: For instance in free up-down-right zigzag 1,5,6,9 2, 7,10 3, 8 4 In free left-right-down zigzag 1,2 3 4,5,6,7 8,9,10 And then in getView with a command tell the GridView to go to the next column or row. I now kind of solved it with row and column data in a database table, sort it in a query and inserting dummy elements to the array to get the right layout, but I wonder if there is a more direct and efficient way to this. The database is also larger and filled with presentation data which is undesirable. e.g. in free up-down-right zigzag I have 10 domain data elements but with inserting 6 dummy elements the array size is increased to 16. It would be more efficient to keep the array size 10. Or are there alternative views which do this job 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] Re: How to make eclipse-adt graphical layout editor work independent of path
I made an enhancement request: http://code.google.com/p/android/issues/detail?id=24178 On 10 jan, 14:42, Dave wrote: > For the apk file the locations are fixed, yes, but technically Eclipse > could freely choose the file and folder locations in the eclipse > project and compile and package to the right location in the apk file > if only the eclipse-adt plugin would support that. It would make the > eclipse-adt plugin's editors more reusable. > > On 10 jan, 13:25, "sell.bergstr" > wrote: > > > > > simple answer: no way. Resources have their fixed place for android, > > and eclipse goes with that, obviously- Tekst uit oorspronkelijk bericht > > niet weergeven - > > - Tekst uit oorspronkelijk bericht weergeven - -- 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 make eclipse-adt graphical layout editor work independent of path
For the apk file the locations are fixed, yes, but technically Eclipse could freely choose the file and folder locations in the eclipse project and compile and package to the right location in the apk file if only the eclipse-adt plugin would support that. It would make the eclipse-adt plugin's editors more reusable. On 10 jan, 13:25, "sell.bergstr" wrote: > simple answer: no way. Resources have their fixed place for android, > and eclipse goes with that, obviously -- 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: [eclipse-adt plugin] How to make eclipse-adt graphical layout editor work independent of path
So in short my question is: I like to be able to freely choose the location of res and assets folders and AndroidManifest.xml file while the eclipse-adt plugin must still work with that. On 9 jan, 16:07, Dave wrote: > Hello, > it seems that the graphical layout editor of eclipse-adt only renders > properly if the xml layout file is in the folder > \res\layout > > I am using: > Eclipse 3.7.1 maintenance build M20111214-1406 > JDK6_30 > eclipse-adt plugin ADT 16.0.1 > > How can I make it work independent of the location of the folder > e.g. > \src\main\res\layout > I see the graphical layout tab but is doesn't render well > > Same if I copy res to gen e.g. > \src\main\res\layout > and open an layout xml file with Open With Android Layout Editor > I do see Graphical Layout tab but widgets of the graphical layout > editor are uninitialized and layout of the xml file is not rendered. > > Can this be done by configuration or is it a bug/ "not yet implemented > feature" in the eclipse-adt plugin? > > Any hints/ideas are welcome. -- 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][eclipse-adt plugin] How to make eclipse-adt graphical layout editor work independent of path
Hello, it seems that the graphical layout editor of eclipse-adt only renders properly if the xml layout file is in the folder \res\layout I am using: Eclipse 3.7.1 maintenance build M20111214-1406 JDK6_30 eclipse-adt plugin ADT 16.0.1 How can I make it work independent of the location of the folder e.g. \src\main\res\layout I see the graphical layout tab but is doesn't render well Same if I copy res to gen e.g. \src\main\res\layout and open an layout xml file with Open With Android Layout Editor I do see Graphical Layout tab but widgets of the graphical layout editor are uninitialized and layout of the xml file is not rendered. Can this be done by configuration or is it a bug/ "not yet implemented feature" in the eclipse-adt plugin? Any hints/ideas are welcome. -- 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: Access denied error while trying to install new API
Right click on the sdkmanager.exe file & select the option 'Run as Administrator'. Your problem is solved. -Dave On Dec 30 2011, 11:09 pm, assefa wrote: > Hi, > > Not sure if this thread is still relevant but if it is, I had the > same issue on windows and I was able to solve it by running the > Android SDK Manager as Administrator. > > regards, > > On Dec 21, 5:15 am, Anil Jagtap wrote: > > > > > This is just an try to figure out what is going on. > > It looks like you are installing on Windows and the file which is > > giving problem is for Linux. > > On Linux I would have checked permissions for all the folder tree for > > such an error. Have no slightest idea about file permissions on > > Windows, can you check permissions on folders? > > Cheers > > -- > > anil jagtap > > Android Application Developer > > > On Dec 14, 4:26 pm, "Uday (Dave)" wrote: > > > > Hi, I have installed the android sdk 16 on my Windows7 machine I have > > > installed the Android2.1 API initially without any glitch. But then > > > again when I try to install the other APIs using the SDK manager, it > > > gives me: > > > > Downloading SDK Platform Android 2.3.3, API 10, revision 2 > > > > File not found: C:\Program Files (x86)\Android\android-sdk\temp > > > \android-2.3.3_r02-linux.zip (Access is denied) > > > > Downloading Samples for SDK API 10, revision 1 > > > > File not found: C:\Program Files (x86)\Android\android-sdk\temp > > > \samples-2.3.3_r01-linux.zip (Access is denied) > > > > Skipping 'Google APIs by Google Inc., Android API 10, revision 2'; it > > > depends on 'SDK Platform Android 2.3.3, API 10, revision 2' which was > > > not installed. > > > > Done. Nothing was installed > > > > Thanks, > > > > Dave- Hide quoted text - > > - Show quoted text - -- 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] Access denied error while trying to install new API
Hi, I have installed the android sdk 16 on my Windows7 machine I have installed the Android2.1 API initially without any glitch. But then again when I try to install the other APIs using the SDK manager, it gives me: Downloading SDK Platform Android 2.3.3, API 10, revision 2 File not found: C:\Program Files (x86)\Android\android-sdk\temp \android-2.3.3_r02-linux.zip (Access is denied) Downloading Samples for SDK API 10, revision 1 File not found: C:\Program Files (x86)\Android\android-sdk\temp \samples-2.3.3_r01-linux.zip (Access is denied) Skipping 'Google APIs by Google Inc., Android API 10, revision 2'; it depends on 'SDK Platform Android 2.3.3, API 10, revision 2' which was not installed. Done. Nothing was installed Thanks, Dave -- 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] ViewRoot and the repaint process
I'd like to get pixel access to the Bitmap to be able to transmit graphics over the wire. It seems this could be possible via the Canvas Bitmap. But since ViewRoot is final I'm not sure "where" I can intercept this information in the drawing process. Is there an appropriate spot in the rendering processes where I can grab pixels from the Bitmap for the current View Tree? Thank you, Dave -- 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 topics to learn in android to accomplish making a voice recorder &image capture app?
I am starting to learn android framework.But the purpose of learning it is so i can make a mobile app to record voice and capture pictures.The mobile app will be intergrated with a web application,where those captured images and audio files will be uploaded.Question is What topics i need to concetrate with to accomplish that(besides the fundamentals/basics of android)?Also which is the latest framework version?Thank you 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
[android-developers] problem of using intent to start activity of an add-on package
Hi, I am using an add-on in my app. When I try to start an activity defined in the add-on package, it complains ActivityNotFoundException: in my code: package com.a.c.demo.search; import com.a.b.SearchActivity; import com.a.c.demo.R; public class ActivityDemo extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Button btn = (Button) findViewById(R.id.launch_search_activity); btn.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Intent i = new Intent(); i.setClassName("com.a.b", "com.a.b.SearchActivity"); i.putExtra(KEY_SEARCH_HINT_TEXT, "Search"); ActivityDemo.this.startActivityForResult(i, SEARCH_CODE); } }); } the add-on is in the java build path. When I ran the app, I got error from log cat: ActivityNotFoundException: Unable tofind explicit activity class {com.a.b/ com.a.b.SearchActivity}; have you declared this activity in your AndroidManifest.xml? Please help me out on this issue. Thanks a lot. dave -- 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 Loading multiple markers on same location
No Google won't do it for you..did you look at discussion forum?..I think they have shared one example there On Mon, May 30, 2011 at 4:25 PM, NB Books wrote: > The real answer has to do with "clustering" icons based on proximity, and > tabbed infowindows. > > I store my geocoded addresses in SQL and use PHP to echo the var markers > code lines. > > I don't know MySQL/PHP that well that I can sort the lat and lng columns > and find those that are the same, then build a cluster icon. I don't know > java to do that. I don't know java more than enough to put lines of code > together from examples. > > I just wish Google had a setting that automatically did clustering > of markers with same lat & lng for us. > > And the next thing I am trying to figure out how to do: have a html list of > the marker place names in one TD where the text hyperlinks to the marker and > opens its infowindow. > > Just like Google Maps does with you use it manually. > > > > On May 30, 2011, at 10:06 PM, Akshay Dave wrote: > >I have found the discussion on the same problem I had... > > Here it is Issue log and solution - > http://groups.google.com/group/Google-Maps-API/browse_thread/thread/23d5467e4211c143#<https://pod51000.outlook.com/owa/redir.aspx?C=8WHc5E_fX0e54gxxenPbX2C7eRO27s0Iiv3tmjHHFqcS0mXZK7D-cont4UuOllqhP5uObNSi1vY.&URL=http%3a%2f%2fgroups.google.com%2fgroup%2fGoogle-Maps-API%2fbrowse_thread%2fthread%2f23d5467e4211c143%23> > > So what you do is make offset for each marker on same lat/lang on hover... > >Hope it helps > > Akshay > > On Sun, May 29, 2011 at 1:26 PM, NB Books wrote: > >> Could you share? >> >> I have the same problem. Multiple people with same lat/lng, only the >> "last" person in the Array gets in the InfoWindow for the marker at >> that point. >> >> >> >> On Feb 22, 4:23 am, Akshay Dave wrote: >> > I figured it out...thanks anyways..! >> > >> > >> > >> > On Mon, Feb 21, 2011 at 1:18 PM, Akshay Dave wrote: >> > > Hi, >> > > I am currently doing mashup of linkedin and google map API using >> > > PHP/mysql >> > >> > > I use following code snippet to plot the markers on google map >> > > http://code.google.com/apis/maps/articles/phpsqlajax.html >> > >> > > So I get city/state from linked in and not address. Sometimes it >> happens >> > > that multiple profile have same city and state(more than 20) >> > >> > > Hence it is kind of challenge for me to load markers for multiple >> > > profiles with same city. >> > >> > >I would appreciate any comments/suggestions for the same. >> > >> > > Many Thanks >> > > Akshay >> > > > -- 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 Loading multiple markers on same location
I have found the discussion on the same problem I had... Here it is Issue log and solution - http://groups.google.com/group/Google-Maps-API/browse_thread/thread/23d5467e4211c143#<https://pod51000.outlook.com/owa/redir.aspx?C=8WHc5E_fX0e54gxxenPbX2C7eRO27s0Iiv3tmjHHFqcS0mXZK7D-cont4UuOllqhP5uObNSi1vY.&URL=http%3a%2f%2fgroups.google.com%2fgroup%2fGoogle-Maps-API%2fbrowse_thread%2fthread%2f23d5467e4211c143%23> So what you do is make offset for each marker on same lat/lang on hover... Hope it helps Akshay On Sun, May 29, 2011 at 1:26 PM, NB Books wrote: > Could you share? > > I have the same problem. Multiple people with same lat/lng, only the > "last" person in the Array gets in the InfoWindow for the marker at > that point. > > > > On Feb 22, 4:23 am, Akshay Dave wrote: > > I figured it out...thanks anyways..! > > > > > > > > On Mon, Feb 21, 2011 at 1:18 PM, Akshay Dave wrote: > > > Hi, > > > I am currently doing mashup of linkedin and google map API using > > > PHP/mysql > > > > > I use following code snippet to plot the markers on google map > > > http://code.google.com/apis/maps/articles/phpsqlajax.html > > > > > So I get city/state from linked in and not address. Sometimes it > happens > > > that multiple profile have same city and state(more than 20) > > > > > Hence it is kind of challenge for me to load markers for multiple > > > profiles with same city. > > > > >I would appreciate any comments/suggestions for the same. > > > > > Many Thanks > > > Akshay > -- 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: v4 Fragments library VerifyError crash
Aye, I'm going to try enabling/disabling certain optimisation passes and see if I can isolate the one causing this issue. -dave On May 26, 8:10 am, Zsolt Vasvari wrote: > I've seen problems like this. There appears to be no discernable > rhyme and reason as to when a VerifyError will be thrown. The only > way to know is to run your code. > > If it only happens with the release build, I suspect a ProGuard > optimization issue. > > On May 26, 3:05 pm, Dave Johnston wrote: > > > > > > > > > I managed to extract a crash log. This crash also happens on the > > emulator: > > > 05-26 06:57:08.516: ERROR/dalvikvm(339): Could not find method > > android.app.Activity.invalidateOptionsMenu, referenced from method > > android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu > > 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: unable to resolve virtual > > method 124: Landroid/app/Activity;.invalidateOptionsMenu ()V > > 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: rejecting opcode 0x6e at > > 0x0006 > > 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: rejected Landroid/ > > support/v4/app/FragmentActivity;.supportInvalidateOptionsMenu ()V > > 05-26 06:57:08.516: WARN/dalvikvm(339): Verifier rejected class > > Landroid/support/v4/app/FragmentActivity; > > 05-26 06:57:08.516: WARN/dalvikvm(339): Class init failed in > > newInstance call (Luk/co/johnsto/android/alf/activities/HomeActivity;) > > 05-26 06:57:08.526: DEBUG/AndroidRuntime(339): Shutting down VM > > 05-26 06:57:08.526: WARN/dalvikvm(339): threadid=3: thread exiting > > with uncaught exception (group=0x4001aa28) > > > Only appears to occur in release builds. Any ideas? > > > -dave > > > On May 17, 7:44 am, Dave Johnston wrote: > > > > A user of mine is encountering a crash every time they start my > > > application: > > > > java.lang.VerifyError: android.support.v4.app.FragmentManagerImpl > > > at android.support.v4.app.FragmentActivity.(SourceFile:87) > > > (...) > > > > Their phone is a Sony Ericsson U20i (Xperia X10 Mini Pro) running > > > Android 1.6. > > > > I understand the Fragments compatibility library supports Android 1.6, > > > and thatVerifyErrorexceptions typically occur on outdated or > > > unsupported systems, so would this error suggest the U20i isn't > > > entirely compatible? > > > > Regards, > > > Dave- Hide quoted text - > > > - Show quoted text - -- 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: v4 Fragments library VerifyError crash
Aha, appears to be the optimisation step of ProGuard! -dave On May 26, 8:05 am, Dave Johnston wrote: > I managed to extract a crash log. This crash also happens on the > emulator: > > 05-26 06:57:08.516: ERROR/dalvikvm(339): Could not find method > android.app.Activity.invalidateOptionsMenu, referenced from method > android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu > 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: unable to resolve virtual > method 124: Landroid/app/Activity;.invalidateOptionsMenu ()V > 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: rejecting opcode 0x6e at > 0x0006 > 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: rejected Landroid/ > support/v4/app/FragmentActivity;.supportInvalidateOptionsMenu ()V > 05-26 06:57:08.516: WARN/dalvikvm(339): Verifier rejected class > Landroid/support/v4/app/FragmentActivity; > 05-26 06:57:08.516: WARN/dalvikvm(339): Class init failed in > newInstance call (Luk/co/johnsto/android/alf/activities/HomeActivity;) > 05-26 06:57:08.526: DEBUG/AndroidRuntime(339): Shutting down VM > 05-26 06:57:08.526: WARN/dalvikvm(339): threadid=3: thread exiting > with uncaught exception (group=0x4001aa28) > > Only appears to occur in release builds. Any ideas? > > -dave > > On May 17, 7:44 am, Dave Johnston wrote: > > > > > > > > > A user of mine is encountering a crash every time they start my > > application: > > > java.lang.VerifyError: android.support.v4.app.FragmentManagerImpl > > at android.support.v4.app.FragmentActivity.(SourceFile:87) > > (...) > > > Their phone is a Sony Ericsson U20i (Xperia X10 Mini Pro) running > > Android 1.6. > > > I understand the Fragments compatibility library supports Android 1.6, > > and thatVerifyErrorexceptions typically occur on outdated or > > unsupported systems, so would this error suggest the U20i isn't > > entirely compatible? > > > Regards, > > Dave -- 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: v4 Fragments library VerifyError crash
I managed to extract a crash log. This crash also happens on the emulator: 05-26 06:57:08.516: ERROR/dalvikvm(339): Could not find method android.app.Activity.invalidateOptionsMenu, referenced from method android.support.v4.app.FragmentActivity.supportInvalidateOptionsMenu 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: unable to resolve virtual method 124: Landroid/app/Activity;.invalidateOptionsMenu ()V 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: rejecting opcode 0x6e at 0x0006 05-26 06:57:08.516: WARN/dalvikvm(339): VFY: rejected Landroid/ support/v4/app/FragmentActivity;.supportInvalidateOptionsMenu ()V 05-26 06:57:08.516: WARN/dalvikvm(339): Verifier rejected class Landroid/support/v4/app/FragmentActivity; 05-26 06:57:08.516: WARN/dalvikvm(339): Class init failed in newInstance call (Luk/co/johnsto/android/alf/activities/HomeActivity;) 05-26 06:57:08.526: DEBUG/AndroidRuntime(339): Shutting down VM 05-26 06:57:08.526: WARN/dalvikvm(339): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) Only appears to occur in release builds. Any ideas? -dave On May 17, 7:44 am, Dave Johnston wrote: > A user of mine is encountering a crash every time they start my > application: > > java.lang.VerifyError: android.support.v4.app.FragmentManagerImpl > at android.support.v4.app.FragmentActivity.(SourceFile:87) > (...) > > Their phone is a Sony Ericsson U20i (Xperia X10 Mini Pro) running > Android 1.6. > > I understand the Fragments compatibility library supports Android 1.6, > and thatVerifyErrorexceptions typically occur on outdated or > unsupported systems, so would this error suggest the U20i isn't > entirely compatible? > > Regards, > Dave -- 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: Fragments duplicated on config change
As is typical, noticed the r2 release of the compatibility library right after I posted this! That has fixed the duplication issue, however I'm still wondering why each fragment instance inflated from setContentView gets calls to onStart(), onStop(), then onStart() again? Shouldn't there be only a single call to onStart()? -dave On May 22, 5:43 pm, Dave Johnston wrote: > I'm encountering a peculiar issue with the user of FragmentActivity. > > In my test app, my FragmentActivity's onCreate method calls > setContentView, which inflates a simple layout consisting of a single > Fragment. > > However, I'm finding that when the device is rotated, this process > causes additional Fragments to be created, such that after one > rotation there are two Fragment instances, and after two rotations > there are three Fragment instances being created. > > I'm also unclear why, when this Activity is first launched, the > Fragment instance created via setContentView() appears to be started, > stopped, and then started again. -- 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] Fragments duplicated on config change
I'm encountering a peculiar issue with the user of FragmentActivity. In my test app, my FragmentActivity's onCreate method calls setContentView, which inflates a simple layout consisting of a single Fragment. However, I'm finding that when the device is rotated, this process causes additional Fragments to be created, such that after one rotation there are two Fragment instances, and after two rotations there are three Fragment instances being created. I'm also unclear why, when this Activity is first launched, the Fragment instance created via setContentView() appears to be started, stopped, and then started again. Below is a logcat demonstrating the issue (hashCodes in brackets). Should fragments simply not be inflated via setContentView? *** App launched *** 05-22 17:39:13.044: VERBOSE/DupeFrag(10519): TestActivity(1080185976).onStart() 05-22 17:39:13.044: VERBOSE/DupeFrag(10519): TestFragment(1080196160).onStart() 05-22 17:39:13.044: VERBOSE/DupeFrag(10519): TestFragment(1080196160).onStop() 05-22 17:39:13.044: VERBOSE/DupeFrag(10519): TestFragment(1080196160).onStart() *** Device rotated (1) *** 05-22 17:39:17.779: VERBOSE/DupeFrag(10519): TestActivity(1080185976).onStop() 05-22 17:39:17.779: VERBOSE/DupeFrag(10519): TestFragment(1080196160).onStop() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestActivity(1080209384).onStart() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestFragment(1080211584).onStart() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestFragment(1080223880).onStart() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestFragment(1080211584).onStop() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestFragment(1080223880).onStop() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestFragment(1080211584).onStart() 05-22 17:39:17.799: VERBOSE/DupeFrag(10519): TestFragment(1080223880).onStart() *** Device rotated (2) *** 05-22 17:39:19.500: VERBOSE/DupeFrag(10519): TestActivity(1080209384).onStop() 05-22 17:39:19.500: VERBOSE/DupeFrag(10519): TestFragment(1080211584).onStop() 05-22 17:39:19.500: VERBOSE/DupeFrag(10519): TestFragment(1080223880).onStop() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestActivity(1080235792).onStart() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080238000).onStart() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080238336).onStart() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080252384).onStart() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080238000).onStop() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080238336).onStop() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080252384).onStop() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080238000).onStart() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080238336).onStart() 05-22 17:39:19.520: VERBOSE/DupeFrag(10519): TestFragment(1080252384).onStart() -- 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: v4 Fragments library VerifyError crash
On May 18, 11:56 am, Mark Murphy wrote: > On Wed, May 18, 2011 at 5:03 AM, Dave Johnston wrote: > > Unfortunately, all automated crash reports are anonymous so that's all > > I've got! > Hmmm... you might see if a third-party crash logger like ACRA has more > smarts here. Since the additional details fadden is seeking are not in > the exception, that information would have to be read out of LogCat, > which is a pain and requires an extra permission, IIRC. But, if you > can find a third-party solution that will grab all the VFY log > messages as well, you might try switching to that. Sorry, I should have said that I'm already using ACRA. I'll investigate a bit and see if I can squeeze it into providing more details in future. -dave -- 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: v4 Fragments library VerifyError crash
On May 17, 10:02 pm, fadden wrote: > On May 16, 11:44 pm, Dave Johnston wrote: > > java.lang.VerifyError: android.support.v4.app.FragmentManagerImpl > > at android.support.v4.app.FragmentActivity.(SourceFile:87) > > (...) > > The exception message is a bit lacking. There's more detail in the > logcat output. Unfortunately, all automated crash reports are anonymous so that's all I've got! -dave -- 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: v4 Fragments library VerifyError crash
Aye I couldn't see anything odd either, glad I was on the right track! I'm trying to contact the user involved in the hoping of extracting more information and determine the root cause. Hopefully there's at least a simple workaround. -dave On May 17, 11:31 am, Mark Murphy wrote: > Eyeballing the source code, everything in the initializers for > FragmentManagerImpl seems kosher. My best guess is that it is > referring to some method that exists on real 1.6 and does not exist on > the X10 Mini Pro. Unfortunately, those VerifyError reports are not > terribly specific. > > > > > > > > > > On Tue, May 17, 2011 at 2:44 AM, Dave Johnston wrote: > > A user of mine is encountering a crash every time they start my > > application: > > > java.lang.VerifyError: android.support.v4.app.FragmentManagerImpl > > at android.support.v4.app.FragmentActivity.(SourceFile:87) > > (...) > > > Their phone is a Sony Ericsson U20i (Xperia X10 Mini Pro) running > > Android 1.6. > > > I understand the Fragments compatibility library supports Android 1.6, > > and that VerifyError exceptions typically occur on outdated or > > unsupported systems, so would this error suggest the U20i isn't > > entirely compatible? > > > Regards, > > Dave > > > -- > > 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/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 3.4 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] v4 Fragments library VerifyError crash
A user of mine is encountering a crash every time they start my application: java.lang.VerifyError: android.support.v4.app.FragmentManagerImpl at android.support.v4.app.FragmentActivity.(SourceFile:87) (...) Their phone is a Sony Ericsson U20i (Xperia X10 Mini Pro) running Android 1.6. I understand the Fragments compatibility library supports Android 1.6, and that VerifyError exceptions typically occur on outdated or unsupported systems, so would this error suggest the U20i isn't entirely compatible? Regards, Dave -- 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: Using setArguments() after inflation
Cheers Mark and Dianne. Sounds like setArguments is analogous to XML attributes, whereas I had been using them similarly to Intent data, which now seems so very wrong... -dave On Apr 27, 2:56 pm, Dianne Hackborn wrote: > You use arguments when you are creating it in code, and XML attributes when > you are creating from XML. If you want to modify the fragment state after > it is made... well just add methods to your fragment to set the state. -- 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] Using setArguments() after inflation
What is the correct way to pass arguments to a Fragment after inflation (for example, after calling setContentView)? Attempting to call setArguments() after setContentView() results in "java.lang.IllegalStateException: Fragment already active". Is it simply preferable to instantiate and add Fragments via code, rather than use fragment inflation from an XML layout? -dave -- 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: DialogFragment vs showDialog()
Cheers Dianne, exactly what I wanted to hear! On Apr 25, 5:52 pm, Dianne Hackborn wrote: > Consider showDialog() / managed dialogs to be deprecated. > On Apr 25, 2011 12:30 PM, "Dave Johnston" wrote: > > > > > > > > > Honeycomb introduced the DialogFragment class for producing dialogs. > > Pre-Honeycomb, applications were encouraged to use managed dialogs > > handled by their owning Activity via showDialog, dismissDialog etc. > > > Looking forward, should DialogFragments be preferred over Activity > > managed dialogs, or should they simply be treated as an alternative? > > > -dave > > > -- > > 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] DialogFragment vs showDialog()
Honeycomb introduced the DialogFragment class for producing dialogs. Pre-Honeycomb, applications were encouraged to use managed dialogs handled by their owning Activity via showDialog, dismissDialog etc. Looking forward, should DialogFragments be preferred over Activity managed dialogs, or should they simply be treated as an alternative? -dave -- 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] getting gps status events
Thanks guys Dave On Thu, Apr 21, 2011 at 4:10 PM, Igor Prilepov wrote: > You can request status update without location updates but the GPS status > will be changed only if some other application did it. > Therefore listening for the status updates without location notifications > makes sense only for some kind of a background service when you want to save > location whenever somebody else gets it. > BTW: Android introduced "PASSIVE_PROVIDER" in API 8 which should be used to > achieve such behavior (i.e. get location updates when someone enables GPS). > > -- > 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] getting gps status events
Do you have to request location updates before gps status events will be sent? I added a listener for gps status events, but it never gets called. Dave -- 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: Using v4 Fragments with v11 ActionBar tabs
On Apr 19, 4:18 pm, Mark Murphy wrote: > What seems to be working for me is to simply ignore the passed-in > FragmentTransaction and use your own. See the FeedsTabActivity in this > project: > > https://github.com/commonsguy/cw-advandroid/tree/master/Honeycomb/Fee... Ace, cheers Mark! Looks like exactly what I need to do. -dave -- 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: Using v4 Fragments with v11 ActionBar tabs
On Apr 19, 4:19 pm, Chris Stewart wrote: > As far as I know, you can't use the ActionBar pre-Honeycomb anyway. So you > wouldn't have a scenario in which you'd be able to use the ActionBar unless > you're targeting Honeycomb. I'm targeting Honeycomb but retaining backwards compatibility with older devices. Essentially giving tablets something other than a dashboard 'home' activity, which isn't very tablet friendly. -- 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] Using v4 Fragments with v11 ActionBar tabs
I'm having trouble implementing ActionBar tabs whilst also using backward-compatible Fragments (with the compatibility package). The main issue being that ActionBar.TabListener expects android.app.Fragment, and my Fragment classes inherit from android.support.v4.app.Fragment. Therefore I can't use my Fragments with the ActionBar on 3.0-and-later devices. Anyone have any ideas how I can solve or work around this? (besides just not using tabs) -dave -- 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] Implementing SOAP request in Android
Hello, I was wondering on how to implement SOAP call in Android without using KSOAP2. Apperantly the webservice I need to call requires custom XML SOAP request that KSOAP2 is not able to make. I would appreciate if any one can suggest any link or details related to it. Thanks Akshay -- 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: Update app inside system space (/system/app/) via Market Place
We are seeing the same problem.Is there a way for OEM's to preload 3rd party applications and have the Android Market Application list these applications in "My Apps" and automatically notify the user when there are updates to those apps? Does the Market Application have special handling for Google apps such as gmail, youtube, and maps - or is there something that other market applications can do to take advantage of android market notifications without having to first manually check for and update the application from the market first On Mar 8, 1:02 pm, "Wolfgang R." wrote: > Hi Guys, > > I just go a question for the google dev-folks. > We want to bundle our app with the phone and it needssystem > permissions - > So its placed inside /system/app - and it needs to be updatetable via > themarketfor further releases. > > So till then no problem, placed the app as asystem-app with > themarketcetrificate, > also updating via themarketworks. > > But the user is not notified about the update like it would happen if > the app was installed via themarketplace. > Same we recoginized withupdatesfor preinstalledsystemapps like > youtube and google maps, > where the update can be installed via the marketplace but the user is > not triggered even the the button shows install not update. > > If the user did download the app with his account once, then even > after resetting the device to factory default, the update is > recognized, which leads us to the oppinion that the app needs to be in > the database of the user account. > > Anybody made same / different experiences? Someone know a solution of > that kind of problem? > > Thanks a lot in advance, > Wolfgang -- 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] Important: XmlPullParserException while accessing SOAP webservice
I am trying to implement the webservice in Android 2.2 using ksoap2 library I had one sample webservice implemented but when I started implementing the webservice for a specific API I was getting this error which was quite common when I checked online but no specific answers so I have posted it on this group to see anyone has come across same behavior Hope that helps . Let me know if you need further info. Akshay On Sat, Apr 2, 2011 at 1:44 AM, TreKing wrote: > On Thu, Mar 31, 2011 at 10:02 PM, Akshay Dave wrote: > >> I am trying to access webservice using KSOAP 2 ... I am having problem >> with accessing webservice...Below are my parameters > > > What does this have to do with the Android SDK? > > > - > 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 -- 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] Important: XmlPullParserException while accessing SOAP webservice
Hello, I am trying to access webservice using KSOAP 2 ... I am having problem with accessing webservice...Below are my parameters private static final String SOAP_ACTION = " http://schemas.kickapps.com/services/soap/signInRegisterUser";; private static final String METHOD_NAME= "signInRegisterUser"; private static final String NAMESPACE = " http://schemas.kickapps.com/services/soap/";; private static final String URL = " http://affiliate.kickapps.com/soap/KaSoapSvc";; SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME); Request.addProperty("affiliateUserName","x"); Request.addProperty("affiliateEmail","x...@x.com"); Request.addProperty("affiliateSiteName","xx"); Request.addProperty("userName","avdTest"); Request.addProperty("email","xx...@xxx.com"); Request.addProperty("firstName","Aks"); Request.addProperty("LastName","Test"); Request.addProperty("LastName","Test"); Request.addProperty("adminTags","1234565"); Request.addProperty("gender","M"); Request.addProperty("birthday","1960-01-01"); Request.addProperty("password","testapps10"); Request.addProperty("key","68fbdfd1"); Request.addProperty("aboutMe","Hey"); Request.addProperty("postalCode","12345"); Request.addProperty("genRestApiToken","T"); //soapEnvelope.dotNet = true; //soapEnvelope.bodyOut = Request; soapEnvelope.setOutputSoapObject(Request); //@SuppressWarnings("deprecation") HttpTransportSE transport = new HttpTransportSE(URL); //AndroidHttpTransport aht= new AndroidHttpTransport(URL); try{ transport.call(SOAP_ACTION, soapEnvelope); SoapPrimitive resultSOAP = (SoapPrimitive)((SoapObject)soapEnvelope.bodyIn).getProperty(0); Toast.makeText(ULocalInput.this,"Hi",Toast.LENGTH_LONG).show(); //SoapPrimitive resultString = (SoapPrimitive)soapEnvelope.getResponse(); tv.setText("Status:" + resultSOAP.toString()); } catch (IOException e) { e.printStackTrace(); System.out.println("SOAP Error : " + e.getMessage()); System.out.println("SOAP Response : " + transport.responseDump); tv.setText("Status1:" + e.getMessage()); } catch (XmlPullParserException e) { e.printStackTrace(); System.out.println("SOAP Error : " + e.getMessage()); System.out.println("SOAP Response : " + transport.responseDump); tv.setText("Status2:" + e.getMessage()); } I don't know wht's going wrong here but I am getting error as expected:END_TAG{http://schemas.xmlsoap.org /soap/envelope/}Body(position:END_TAG{http://schemas.xmlsoap.org/soap/envelope/}soap:Fault>@1:354 in java.io.InputStreamReader@43e52820) I would appreciate if anyone can suggest me what am I doing wrong.. Many Thanks Akshay -- 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] Important: XmlPullParserException while accessing SOAP webservice in Android
Hello, I am trying to access webservice using KSOAP 2 ... I am having problem with accessing webservice...Below are my parameters private static final String SOAP_ACTION = " http://schemas.kickapps.com/services/soap/signInRegisterUser";; private static final String METHOD_NAME= "signInRegisterUser"; private static final String NAMESPACE = " http://schemas.kickapps.com/services/soap/";; private static final String URL = " http://affiliate.kickapps.com/soap/KaSoapSvc";; SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); SoapObject Request = new SoapObject(NAMESPACE,METHOD_NAME); Request.addProperty("affiliateUserName","x"); Request.addProperty("affiliateEmail","x...@x.com"); Request.addProperty("affiliateSiteName","xx"); Request.addProperty("userName","avdTest"); Request.addProperty("email","xx...@xxx.com"); Request.addProperty("firstName","Aks"); Request.addProperty("LastName","Test"); Request.addProperty("LastName","Test"); Request.addProperty("adminTags","1234565"); Request.addProperty("gender","M"); Request.addProperty("birthday","1960-01-01"); Request.addProperty("password","testapps10"); Request.addProperty("key","68fbdfd1"); Request.addProperty("aboutMe","Hey"); Request.addProperty("postalCode","12345"); Request.addProperty("genRestApiToken","T"); //soapEnvelope.dotNet = true; //soapEnvelope.bodyOut = Request; soapEnvelope.setOutputSoapObject(Request); //@SuppressWarnings("deprecation") HttpTransportSE transport = new HttpTransportSE(URL); //AndroidHttpTransport aht= new AndroidHttpTransport(URL); try{ transport.call(SOAP_ACTION, soapEnvelope); SoapPrimitive resultSOAP = (SoapPrimitive)((SoapObject)soapEnvelope.bodyIn).getProperty(0); Toast.makeText(ULocalInput.this,"Hi",Toast.LENGTH_LONG).show(); //SoapPrimitive resultString = (SoapPrimitive)soapEnvelope.getResponse(); tv.setText("Status:" + resultSOAP.toString()); } catch (IOException e) { e.printStackTrace(); System.out.println("SOAP Error : " + e.getMessage()); System.out.println("SOAP Response : " + transport.responseDump); tv.setText("Status1:" + e.getMessage()); } catch (XmlPullParserException e) { e.printStackTrace(); System.out.println("SOAP Error : " + e.getMessage()); System.out.println("SOAP Response : " + transport.responseDump); tv.setText("Status2:" + e.getMessage()); } I don't know wht's going wrong here but I am getting error as expected:END_TAG{http://schemas.xmlsoap.org /soap/envelope/}Body(position:END_TAG{http://schemas.xmlsoap.org/soap/envelope/}soap:Fault>@1:354 in java.io.InputStreamReader@43e52820) I would appreciate if anyone can suggest me what am I doing wrong.. Many Thanks Akshay -- 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] More DropDown Menu Image
I'm using a light theme but my action bar actually has a custom dark background so the 'more' menu button clashes (the button on the far right) http://developer.android.com/images/ui/actionbar-item-withtext.png How can I override the theme of just the action bar or am I able to replace that image? - dave -- 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: ADT 10 lost "clipping" toggle in the visual layout editor?
Same here, the "clipping" function is essential for showing any hidden portion of the scrollView, but now everything is hidden behind the clipped scrollView and it impossible to edit the widgets in the layout editor in graphical layout tab. Any alternative for this? beside using the xml editor. Thanks, David. On Mar 9, 1:41 pm, Eric Rizzo wrote: > In earlier versions of the ADT visualeditor, there was an option to > toggle "clipping" of the contents of thelayout; it was essential for > working with ScrollView layouts that had lots of child views, as it > let you see and manipuate ALL children instead of just what is visible > at the top of the ScrollView. > That option seems to have disappeared in ADT 10.0. Where has it gone? > How does one work with ScrollView and nested children in ADT 10? > > Thanks, > Eric -- 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] Need help with tabbed layout
I'm new to Android development so please bear with me. I have created an app in WebOS and I'm keen to try and re-create for the Android platform. I have tried to follow the tutorial for creating a tabbed view and to some extent I have succeeded. However, the problem that I am having is that when I switch from tab to tab any text or graphics is overwritting the tab elements and not displaying below the tabs themselves. I'm sure I've done something stupid that is easy to fix. Here are the files that I have. I have my main class which extends TabActivity. The code is as follows: *package com.dtwconsulting.golfcaddie; import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.widget.TabHost; public class GolfCaddie extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(* *savedInstanceState); setContentView(R.layout.**splashmain); * *Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab * *// Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, MainActivity.class); * *// Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("main").**setIndicator("Main", res.getDrawable(R.drawable.ic_**tab_main)) .setContent(intent); tabHost.addTab(spec); * *// Do the same for the other tabs intent = new Intent().setClass(this, PlayersActivity.class); spec = tabHost.newTabSpec("players").**setIndicator("Players", res.getDrawable(R.drawable.ic_**tab_players)) .setContent(intent); tabHost.addTab(spec); * *intent = new Intent().setClass(this, CoursesActivity.class); spec = tabHost.newTabSpec("courses").**setIndicator("Courses", res.getDrawable(R.drawable.ic_**tab_courses)) .setContent(intent); tabHost.addTab(spec); * *tabHost.setCurrentTab(0); * *} * *public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_**menu, menu); return true; } }* My R.layout.splashmain XML code is as follows: * http://schemas.android.com/apk/res/android"; android:id="@android:id/**tabhost" android:layout_width="fill_**parent" android:layout_height="fill_**parent"> * In addition to the above I have a class file for each tab and a layout file for each tab too. To give an example of the main class and XML layout file: *package com.dtwconsulting.golfcaddie; import android.app.Activity;* * import android.os.Bundle; public class MainActivity extends Activity {* * public void onCreate(Bundle savedInstanceState) { super.onCreate(**savedInstanceState); * *setContentView(R.layout.main); } } * * http://schemas.android.com/apk/res/ android" android:layout_width="wrap_**content" android:layout_height="fill_**parent" android:fitsSystemWindows="**true" android:background="@drawable/**golfcaddie"> * So, when this main tab is displayed the background image (golfcaddie.png) completely displays on the entire screen over the top of the tabs. I've tried playing around with things but all to no avail. I either get the background overlaying the tabs, or I get nothing at all. I suspect that I am just not grasping these layouts and how they interact. Any help/direction on this would be much appreciated, and perhaps I am not even doing this the best way. I ended up Googling about doing a tabbed view and was lead a little away from the Google docs. -- 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] Tabbed View
I'm new to Android development so please bear with me. I have created an app in WebOS and I'm keen to try and re-create for the Android platform. I have tried to follow the tutorial for creating a tabbed view and to some extent I have succeeded. However, the problem that I am having is that when I switch from tab to tab any text or graphics is overwritting the tab elements and not displaying below the tabs themselves. I'm sure I've done something stupid that is easy to fix. Here are the files that I have. I have my main class which extends TabActivity. The code is as follows: package com.dtwconsulting.golfcaddie; import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.widget.TabHost; public class GolfCaddie extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.splashmain); Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, MainActivity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("main").setIndicator("Main", res.getDrawable(R.drawable.ic_tab_main)) .setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new Intent().setClass(this, PlayersActivity.class); spec = tabHost.newTabSpec("players").setIndicator("Players", res.getDrawable(R.drawable.ic_tab_players)) .setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this, CoursesActivity.class); spec = tabHost.newTabSpec("courses").setIndicator("Courses", res.getDrawable(R.drawable.ic_tab_courses)) .setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_menu, menu); return true; } } My R.layout.splashmain XML code is as follows: http://schemas.android.com/apk/res/android"; android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> In addition to the above I have a class file for each tab and a layout file for each tab too. To give an example of the main class and XML layout file: package com.dtwconsulting.golfcaddie; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } http://schemas.android.com/apk/res/ android" android:layout_width="wrap_content" android:layout_height="fill_parent" android:fitsSystemWindows="true" android:background="@drawable/golfcaddie"> So, when this main tab is displayed the background image (golfcaddie.png) completely displays on the entire screen over the top of the tabs. I've tried playing around with things but all to no avail. I either get the background overlaying the tabs, or I get nothing at all. I suspect that I am just not grasping these layouts and how they interact. Any help/direction on this would be much appreciated, and perhaps I am not even doing this the best way. I ended up Googling about doing a tabbed view and was lead a little away from the Google docs. -- 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: 3.0 Preview SDK won't install
Hi Darren, I had the same issue when I tried to download it with SDK/AVD Manager. Did you solve it ? dave On Jan 29, 2:54 pm, Darren Hinderer wrote: > When I try to install the Honeycomb preview using the SDK & AVD > Manager, I get this error: > > File not > found:https://dl-ssl.google.com/android/repository/android-3.0_pre_r01-linu... > > Anyone have a work around? > > Thanks, > -- > Darren -- 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: Handling touch events for dragging content when changing the orientation of the screen
Thanks for the response! No, my code is not rotating the drag direction. I'm primary rotating the canvas the map is drawn on. I'm not sure *how* to rotate the axes used by the touch event. Any pointers on how to do this would be greatly appreciated! Thanks again, Dave On Jan 26, 8:51 am, "JAlexoid (Aleksandr Panzin)" wrote: > You have to rotate the drag direction vector as well as canvas. > Even without looking at your code, the actual drawing code probably > doesn't translate the dragging direction in accordance with the > direction of the device. > > On 26 янв, 08:13,DaveBryson wrote: > > > > > I have a map application using an in-house map engine on Android. I'm > > working on a rotating Map view that rotates the map based on the > > phone's orientation using the Sensor Service. All works fine with the > > exception of dragging the map when the phone is pointing other than > > North. For example, if the phone is facing West, dragging the Map up > > still moves the Map to the South versus East as would be expected. I > > assume translating the canvas is one possible solution but I'm > > honestly not sure the correct way to do this to swap the axes without > > disrupting the coordinate system needed by the map tiles. > > > Here is the code I'm using to rotate the Canvas: > > > public void dispatchDraw(Canvas canvas) > > { > > canvas.save(Canvas.MATRIX_SAVE_FLAG); > > // mHeading is the orientation from the Sensor > > canvas.rotate(-mHeading, origin[X],origin[Y]); > > > mCanvas.delegate = canvas; > > super.dispatchDraw(mCanvas); > > canvas.restore(); > > > } > > > What is the best approach to make dragging the map consistent > > regardless of the phones orientation? The sensormanager has a > > "remapcoordinates()" method but it's not clear to me exactly how to > > use it. I've searched the web and posted to StackOverflow to try and > > figure this out...no luck so far. Any pointers would be greatly > > 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] Handling touch events for dragging content when changing the orientation of the screen
I have a map application using an in-house map engine on Android. I'm working on a rotating Map view that rotates the map based on the phone's orientation using the Sensor Service. All works fine with the exception of dragging the map when the phone is pointing other than North. For example, if the phone is facing West, dragging the Map up still moves the Map to the South versus East as would be expected. I assume translating the canvas is one possible solution but I'm honestly not sure the correct way to do this to swap the axes without disrupting the coordinate system needed by the map tiles. Here is the code I'm using to rotate the Canvas: public void dispatchDraw(Canvas canvas) { canvas.save(Canvas.MATRIX_SAVE_FLAG); // mHeading is the orientation from the Sensor canvas.rotate(-mHeading, origin[X],origin[Y]); mCanvas.delegate = canvas; super.dispatchDraw(mCanvas); canvas.restore(); } What is the best approach to make dragging the map consistent regardless of the phones orientation? The sensormanager has a "remapcoordinates()" method but it's not clear to me exactly how to use it. I've searched the web and posted to StackOverflow to try and figure this out...no luck so far. Any pointers would be greatly 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] Question of using ksoap for android to call webservices
I am trying to develop an android application using our webservice. Here is the code: private String SOAP_ACTION= "http://.../TestFunction";; private String METHOD_NAME = "TestFunction"; private String NAMESPACE = "http://.../";; private String URL = "http://.../webservice.php";; SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); envelope.setOutputSoapObject(request); HttpTransport androidHttpTransport = new HttpTransport(URL); androidHttpTransport.call(SOAP_ACTION, envelope); The testfunction is a function without any parameters or return values. It is tested correctly using other applications. As long as calling to the last line of code, the emulator exited. I tried Eclipse, Ksoap2 in both Windows and Ubuntu. Can anyone help? Many thanks! Some small questions: 1) do i need to use "php?wsdl" in URL? 2) do i need to use explict IP address in URL? 3) should I use androidhttptransport? Is it in the ksoap for android? i downloaded but the JAR generates a compile error. 4) Is there any specific requirement for the webservices? -- 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] Automatically fetch another app from market
Is it complicated to add this "market intent". I had the app made with a wysiwyg editor so I haven't developed the code myself. I'd like to add the code to fetch my other app from the market - if they have to physically accept the installation then I'll have to live with that. Any guidance on the code I should use or advice on where I could find out is greatly appreciated cheers Optom04 On Tue, Dec 28, 2010 at 5:09 PM, prateek suhane wrote: > can only redirect to market for given application by calling market > intent... > > app can't be install without clicking on install button... > > > > > On Tue, Dec 28, 2010 at 12:26 PM, optom04 wrote: > >> Hi Guys, >> >> Is there a way for a user to click a link in my app to take them to the >> market and automatically install another one of my apps? >> >> I don't want them to have to do anything once the link has been clicked if >> possible - rather I would like the app automatically downloaded to their >> handset. >> >> Any help would be really appreciated >> cheers >> Optom04 >> >> -- >> 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 > -- 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: guitar tuner
Yes, I realize there is an one on the market. In fact, I have that currently installed. But that's not my intention. My main objective is to understand the FFT and frequency analysis so that I can write something else. the guitar tuner is just a simple first step in my understanding. Bret, thanks for the advise. I do NOT have any experience with FFT. I take it it's an issue dealing with edge harmonics? In fact, pinpointing certain harmonics within the frequency is exactly what I need. On Nov 6, 4:13 pm, Klunk wrote: > I realize you may be doing this because you want to but are you aware > there is an app that does guitar tuning already on the market? > > On Oct 18, 2:30 am, Dave wrote: > > > > > > > > > I am looking for some help. I'm new to android, and java > > developement. I've got a pretty good handle on the basics, but I'm > > having an issue figuring out some more advanced operations. I'm > > working a guitar tuner, which is a stepping stone to a chromatic piano > > tuner. There is no public API forfrequencyanalysis, so I'm thinking > > I need to write into code a Fast Fourier Transform, and I'll assume I > > need to import a different package for this. Once I display the > >frequencyof any given note, I need it to reference it's offset to a > > pre-measured Mhz. > > There is alot to write, I'm aware, but my first step is to try to > > figure out HOW to get thefrequency, and display it in the UI. any > > help would be wonderful. > > Thanks. > > > Dave -- 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] guitar tuner
I am looking for some help. I'm new to android, and java developement. I've got a pretty good handle on the basics, but I'm having an issue figuring out some more advanced operations. I'm working a guitar tuner, which is a stepping stone to a chromatic piano tuner. There is no public API for frequency analysis, so I'm thinking I need to write into code a Fast Fourier Transform, and I'll assume I need to import a different package for this. Once I display the frequency of any given note, I need it to reference it's offset to a pre-measured Mhz. There is alot to write, I'm aware, but my first step is to try to figure out HOW to get the frequency, and display it in the UI. any help would be wonderful. Thanks. Dave -- 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] ioctl shell command in system bin
Has anyone had any success in using the ioctl that is included in system/bin ? I would like to query some device drivers and any example would be appreciated. $ ioctl -h ioctl -h ioctl [-l ] [-a ] [-rdh] -lLength of io buffer -a Size of each argument (1-8) -rOpen device in read only mode -dDirect argument (no iobuffer) -hPrint 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
[android-developers] Touchscreen Events
I am working on an application to provide automated tested of Android devices. On the HTC Incredible following the update from 2.1 to 2.2. I have noticed a change in the events of the touchscreen. When you monitor the events during a touch you no longer see the normal MT type events This is the result of touching the menu (not a key, part of the LCD) 0003 002b 00210003 0003 002a 813d03ff 0003 002b 00270003 0003 002a 813d03ff 0003 002b 001f0003 0003 002a 813d03ff 0003 002b 00170002 0003 002a 813d03ff 0003 002b 0003 002a 8000 Does anyone have an idea where to locate the definition of the 0x2b and 0x2a events? I can almost determine the X/Y's but need a little help to know what the other bits are telling me. the touchscreen driver: "atmel-touchscreen" While most events are defined in linux/input.h I have not been able to find any defines of 0x2a or 0x2b. -- 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] AlertDialog with customized ListView
Hi, I am playing with the AlterDialog with a customized ListView in it. After the ListView is added into the AlterDialog, there is a centered gradient separator line below the title of the alter dialog, it is just above the ListView. Is there any way to get rid of it or change its color ? I do not want to show it. Thanks a lot. dave -- 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] suspend layout method in Android
Hello, I am trying to take control of the repainting of the view components. I know in windows mobile sdk, there is a method of suspending layout, and after the components are placed well, I can call resume layout then to pain the whole screen in one shot. Are there similar API in android SDK, or other ways to do it ? Thank you very much. Dave -- 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] Is there any way to resizing the icon in option menu item ?
Hello everyone, I would like to resize the icon for the option menu item. Is there any way to do it ? Thanks a lot. dave -- 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] vertical scrollbar comes cross other items in the layout
Hi, In my flipper panel, there are many row view in it to display the text data. Between the rows, I have a gradient shape as separator. My problem is the vertical scrollbar at the right hand side of the panel comes cross with the gradient separator. I tried both vertical scrollbar types of SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY for the flipper panel, but the vertical scrollbar always come cross the separator. I even tried to add an extra empty text field to the right of the gradient separator, and set the right padding, but it did not help. Does anybody know how to solve this issue ? Thanks a lot. dave -- 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 check if vertical scroll bar is shown ?
Got it. Actually the api call of getVerticalScrollbarWidth() would be telling if there is vertical scrollbar or not: if the returned value is 0: no vertical scrollbar; otherwise, there is vertical scrollbar, the returned value is its width. Cheers. On Aug 20, 4:14 pm, dave wrote: > Hi all, > > I want to check if the vertical scrollbar is shown or not. I read the > document and could not figure it out. > > Is there anyway to do it ? > > Thank you very much. > > Dave -- 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 check if vertical scroll bar is shown ?
Hi all, I want to check if the vertical scrollbar is shown or not. I read the document and could not figure it out. Is there anyway to do it ? Thank you very much. Dave -- 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: page up and page down of TextView inside of ScrollView
Issue is solved. First: get the view from the flipperPanel, Then: get the scrollerView For page down button event: scrollView.pageScroll(ScrollView.FOCUS_DOWN) scrollView.computeScroll(); Similar for page up button event. dave On Aug 17, 7:18 pm, dave wrote: > Hi, > > I have a ScrollView, inside of it there is a TextView, and there are > two buttons for PageUp and PageDown in the other part of the layout. > When I click on PageDown, I want to see the text in the TextView to > scroll down one page. > How could I do it ? > > Thanks. > > dave -- 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: Simple question on saving to a file on sd card (android-beginners isn't working)
Hi, Is there not a easy function that I can use to open a File Browser window? So the steps would be: 1. Open a file browser window to select location/file to save? 2. Inside use java code to save the file. Is it not that easy? On Tue, Aug 17, 2010 at 7:32 PM, Dave Germiquet wrote: > Sorry, > > android-beginners is no longer working so I have to post this here: > > Here's is the case scenerio that I would like to do, but I've been googling > with no luck. > > > There's text info that the user saved on the drive > 1. Iwant to open up a dialog, for the user with a listing of the file > structure > 2. the user can then choose where to save the file > 3. then i want to save the file there > > Can anyone offer me simple code for step 1,2,3 that I can use? > > Thanks in advance. > > > > Dave Germiquet > > -- Dave Germiquet -- 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] Simple question on saving to a file on sd card (android-beginners isn't working)
Sorry, android-beginners is no longer working so I have to post this here: Here's is the case scenerio that I would like to do, but I've been googling with no luck. There's text info that the user saved on the drive 1. Iwant to open up a dialog, for the user with a listing of the file structure 2. the user can then choose where to save the file 3. then i want to save the file there Can anyone offer me simple code for step 1,2,3 that I can use? Thanks in advance. Dave Germiquet -- 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 Android Game Engine?
Hi guys, I'm just starting into Android game development, and I'm looking into using an open-source game engine as the foundation of some of my ideas. Does anyone have any favorites? So far, AndEngine looks the most promising...I've also looked at Rokon. Any other notable engines I should be looking at. 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] page up and page down of TextView inside of ScrollView
Hi, I have a ScrollView, inside of it there is a TextView, and there are two buttons for PageUp and PageDown in the other part of the layout. When I click on PageDown, I want to see the text in the TextView to scroll down one page. How could I do it ? Thanks. dave -- 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] getApplication().openOrCreateDatabase causes method undefined error
ok so heres what i got in there try { SQLiteDatabase db4 = getApplication().openOrCreateDatabase("psalmsdb",0,null); db4.execSQL("CREATE TABLE IF NOT EXISTS psalms " + "(_id INTEGER PRIMARY KEY, ps INTEGER, body TEXT, istitle TEXT)"); ContentValues data = new ContentValues(3); data.put("ps", f1); data.put("body", f2); data.put("istitle", f3); db4.insert("psalms","",data); data.clear(); } catch (FileNotFoundException e){ Log.e("FatalError", "TestDbContent:createDb:Db file not found!");} i = i +1+1; //to skip '$' } //end of 'while i<30' loop and for whatever reason im getting the following error in eclipse The method createDatabase(String, int, int, null) is undefined for the type Application i dont get it -- 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: adding audio to a game - triggerClip for SFX
triggerClip() was designed to play synchronized sound effects for musical games like JetBoy. If you just want to play random sound effects, I would use SoundPool instead. On Jul 30, 5:53 am, kk wrote: > Hi all, > > I'm using JetPlayer in order to add some audio to a game I'm > developing. > Using the examples in JetBoy I have managed to create a .jet file > using JetCreator and play an audio track. > So far so good. However, I'm having some trouble playing sound effects > for my game. > > I have a set of very small .mid files, each containing a shooting > sound for a different weapon. > However, when I try to add the .mid file in JetCreator I get > "The segment starting and ending times are illogical" > I'm guessing this is because the clip is too short and starting/ending > M/B/T are both 1/1/0 ? > > The idea was to add these SFXs and then use triggerClip to play them. > My question is, background music aside (I can make that work) what's > the best way to add SFX in a game > so that you can trigger them at any point programmaticaly? (i.e. have > something like playShootingSFX1(), > playShootingSFX2(), etc. that will go and play the SFX immediately). > > thx in advance, > k. -- 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: RTSP Example
That sounds like a problem with Hero. The compositor is supposed to scale the video to fit the surface view. On Jul 18, 6:41 am, Anthoni wrote: > Hi Dave, > > Thanks, found that it partially works, but for some reason I think the > videos are scaled wrong. On my hero I can only see half (width wise) > the video. Noticed this on a few others I've tried as well, so not > sure if it's a problem with the Hero or what :( > > Regards > Anthoni > > On Jul 15, 9:59 pm, Dave Sparks wrote: > > > > > Try m.youtube.com, this works on other Android devices. I don't have a > > Hero to test with. > > > On Jul 14, 12:18 pm, Anthoni wrote: > > > > Hello, > > > > I am trying to find a URL that conforms to the proper RTSP protocol > > > that Android will understand. I've various ones and added them into > > > the API demo from Google but every single time I get the error ERROR/ > > > PlayerDriver(37): Command PLAYER_INIT completed with an error or info > > > PVMFFailure > > > > I am trying this on an actual device (after reading the emulator > > > doesn't play videos at all). So I plugged in my HTC Hero, yet still > > > the same. > > > Can Android actually play RTSP streams or is it just some ridiculous > > > myth ? > > > > What I am looking for is a live RTSP stream that I can view to > > > validate that it does actually play. It doesn't have to be long, just > > > a few seconds worth with audio and video would be great. > > > It's proving impossible. > > > > Regards > > > Anthoni -- 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 AJAX requests work on Android 2.0/2.1 vs. Android 2.2
I'm testing out a web page on the Android 2.0 and 2.2 emulators, and some of the jQuery.ajax() requests that the app makes have slightly different behaviors regarding HTTP Authentication Headers. The server I'm making requests to requires basic authentication, and the ajax requests in 2.2 send the proper auth header. In 2.0, I am debugging with Fiddler, and it seems that the requests do not include the auth header, and the server rejects the request with a 401.2 error. I don't think it matters, but the server is running IIS 7. One interesting thing I noticed while debugging the web requests is that Android 2.2 makes two requests for each resource, whether or not it's an XHR. One does not contain the Auth header, and the second one does. In 2.0, it seems to make 2 requests for everything but XHR's: Here is the 2.2 header for the first XHR: GET http://192.168.1.111/sonar/mobileweb/sonar/views/week/init.ejs HTTP/1.1 Host: 192.168.1.111 Accept-Encoding: gzip Referer: http://192.168.1.111/sonar/mobileweb/sonar/sonar.html Accept-Language: en-US User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/ FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/ 533.1 Accept: text/plain, */* X-Requested-With: XMLHttpRequest Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7 The 2.2 header for the second XHR: GET http://192.168.1.111/sonar/mobileweb/sonar/views/week/init.ejs HTTP/1.1 Host: 192.168.1.111 Accept-Encoding: gzip Referer: http://192.168.1.111/sonar/mobileweb/sonar/sonar.html Accept-Language: en-US User-Agent: Mozilla/5.0 (Linux; U; Android 2.2; en-us; sdk Build/ FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/ 533.1 Authorization: Basic cGFyaXZlZGFcZGF2aWQubW9ycmlzOjIzbkx2ZWxsbGw= Accept: text/plain, */* X-Requested-With: XMLHttpRequest Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7 And the 2.0 header: GET http://192.168.1.111/app/views/week/init.ejs HTTP/1.1 Host: 192.168.1.111 Accept-Encoding: gzip Referer: http://192.168.1.111/app/app.html Accept-Language: en-US User-Agent: Mozilla/5.0 (Linux; U; Android 2.0; en-us; sdk Build/ ECLAIR) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17 Accept: text/plain, */* X-Requested-With: XMLHttpRequest Accept-Charset: utf-8, iso-8859-1, utf-16, *;q=0.7 Notice that 2.0 (and 2.1) only makes the first request, recieves the 401 challenge, and then does not make the second request with the proper auth header. Has anyone experienced this behavior before? It is basically causing my app to not work at all in version 2.0. Version 2.1 seems to act the same as 2.0. Let me know if you have any ideas, thanks for your help, Dave -- 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