[android-developers] How to get source code out of a .apk file
Hi Guys, Is there a way to get source code out of a .apk file in android? --~--~-~--~~~---~--~~ 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 find out if device is in sleep mode?
I am sure it is buried in the SDK somewhere... but I couldn't find it. This is relevant to a service running in the background: How can I find out if the device is in sleep mode? --~--~-~--~~~---~--~~ 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: EMMA Code coverage and JUnit
Felipe, Atlast i am half way through in getting the coverage file. But..I dont see any required output in that file. I created a sdcard. Then i run my Instrumentation with the following command, # am instrument -e coverage true -w com.app.exam.tests/ android.test.InstrumentationTestRunner First I got error, Is EMMA jar included. So, i added the amma.jar in the build path. Again I ran the same command. Then, I found a coverage file , coverage.ec while navigating thro file explorer of ddms. I pulled it to the desktop and imported the session to Coverage field in eclipse. Its unfortunate that I dont see any code coverage but i could see only the number of instructions.Even though my test cases has run and the results has displayed, I am getting 0.0% code coverage.. Can u please try this and share ur experience.. Deeps On May 21, 9:25 pm, Felipe Ramos felipe.wo...@gmail.com wrote: Hi deeps, I'm stuck on the point where I need to run the instrumented tests on the emulator. I could not find a way yet to make the emulator believe that theemma.jar is already installed on it. Also, I don't know if there is a way of enablingEMMAinstrumentation using the SDK. I have not tried that yet. I'm using theandroidfull source, compiling it from scratch. I think I'm close, at least to run it on the emulator, but on this past week I was too busy and could not investigate more about this issue. I'm planning to put everything I know on a blog or something like that, at least to help the other developers that are trying to makeEMMAwork onAndroid, since I could not find relevant references on this matter from the Google guys. I'll send later a step by step of what I made up to now... I'm currently at my job, so I don't have much time to write right now. BR Felipe On May 21, 10:00 am, Deeps l.prade...@gmail.com wrote: Felipe Ramos, Did u end up somewhere..? I am not able to go ahead with this.. deeps- 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] drawable out of memory (urgent)
Hi all, I'm trying to load 4Mb of png in a parcelable arraylist. When more than 1mb is loaded in my list I take an outofmemory exception. Is there a size limit for an arraylist, for. Drawable loaded in memory, or another. Thanks a lot for your answers. --~--~-~--~~~---~--~~ 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] Embedding custom text renderign
Hi All, I have a text rendering engine that uses bitmap/ TTF fonts and can render the unicode strings(Including Indian Languages). I want to integrate my rendering engine(Rasterizer) so that the android UI components uses my rendering engine instead of default for drawing text. How can i achieve this? Please help. Regards Amit Mishra --~--~-~--~~~---~--~~ 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: finding content providers
i think u shd read this first... Querying a Content Provider You need three pieces of information to query a content provider: The URI that identifies the provider The names of the data fields you want to receive The data types for those fields this is frm http://developer.android.com/guide/topics/providers/content-providers.html On Tue, May 26, 2009 at 11:02 AM, Jason Proctor ja...@particularplace.comwrote: well, i thought the question was fairly clear :-) i don't want a list of the content, i want a list of the *providers*. wat kinda content??? media or contacts or wat??? On Tue, May 26, 2009 at 10:46 AM, Jason Proctor mailto:ja...@particularplace.comja...@particularplace.com wrote: can i programmatically get a list of content providers extant on the system? tx -- jason.software.particle -- Regards, Sujay http://www.brainyquote.com/quotes/authors/w/walt_disney.htmlWalt Disney - I love Mickey Mouse more than any woman I have ever known. -- jason.software.particle -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water 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] Re: Find whether any audio is currently playing
Thanks a lot for the answers. I like the idea of a singleton class the best. Thanks again. On 23-May-09, at 12:58 PM, Doug wrote: Well, seems like you have a couple of issues. 1) Re-instantiation of your activity that contains the player... if you're going to put the mediaplayer in an activity and want to re- launch that activity why not use the 'singleTop' or 'singleTask' flags in your manifest - (each has a specific use) - they'll let the OS re- use an existing Activity rather than creating a new one. 2) Assuming you've done that you can (a lot more safely) maintain a reference to the Activity as suggested earlier, although I'd probably tend towards keeping a reference to the player object, maybe even wrapping it up as a Singleton to prevent accidental multiple use. At that point you can just call methods on the player (like 'isPlaying ()') without having to worry about where it is. Just a thought... Doug On May 22, 9:57 pm, iDeveloper ideveloper...@gmail.com wrote: Thanks. And how do I stop the audio from playing if isMusicActive() returns true? Do I have to use the MediaPlayer instance? But the instance won't be in memory any longer as the activity has been exited once and a new instance of the activity created in order to come back. Thanks again. On 22-May-09, at 9:45 PM, Rob Franz wrote: You can detect whether audio is playing by getting a reference to AudioManager and calling isMusicActive()... -Rob On Fri, May 22, 2009 at 11:04 AM, Marco Nelissen marc...@android.com wrote: On Thu, May 21, 2009 at 9:41 PM, iDeveloper ideveloper...@gmail.com wrote: Hi I am using a MediaPlayer instance in order to stream audio files from an Internet location. The audio player is in a separate activity. The user can select from a list of audio files and come to this activity which plays the audio. Now the user might go back to the previous activity (with the list) and select another audio file. In this case, I want to stop any other audio that is playing and start playing the new audio which was selected. Is there any way I can know whether an audio file is playing without having to hold on to the MediaPlayer object? No, and you *should* hold on to the MediaPlayer object, because if you don't, it can be garbage collected at any time, at which point playback would stop. --~--~-~--~~~---~--~~ 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: Embedding custom text renderign
Not in the SDK -- you'd need to do all of your own drawing for TextView (which is basically the thing that draws text wherever there is a widget) wherever you use it. On Mon, May 25, 2009 at 11:39 PM, amit mishra amitmishr...@gmail.comwrote: Hi All, I have a text rendering engine that uses bitmap/ TTF fonts and can render the unicode strings(Including Indian Languages). I want to integrate my rendering engine(Rasterizer) so that the android UI components uses my rendering engine instead of default for drawing text. How can i achieve this? Please help. Regards Amit Mishra -- Dianne Hackborn Android framework engineer hack...@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] finding content providers
sigh. if you don't understand the question, please leave it for someone else to answer. thanks. i think u shd read this first... Querying a Content Provider You need three pieces of information to query a content provider: The URI that identifies the provider The names of the data fields you want to receive The data types for those fields this is frm http://developer.android.com/guide/topics/providers/content-providers.htmlhttp://developer.android.com/guide/topics/providers/content-providers.html On Tue, May 26, 2009 at 11:02 AM, Jason Proctor mailto:ja...@particularplace.comja...@particularplace.com wrote: well, i thought the question was fairly clear :-) i don't want a list of the content, i want a list of the *providers*. wat kinda content??? media or contacts or wat??? On Tue, May 26, 2009 at 10:46 AM, Jason Proctor mailto:mailto:ja...@particularplace.comja...@particularplace.commailto:ja...@particularplace.comja...@particularplace.com wrote: can i programmatically get a list of content providers extant on the system? tx -- jason.software.particle -- Regards, Sujay http://www.brainyquote.com/quotes/authors/w/walt_disney.htmlhttp://www.brainyquote.com/quotes/authors/w/walt_disney.htmlWalt Disney - I love Mickey Mouse more than any woman I have ever known. -- jason.software.particle -- Regards, Sujay http://www.brainyquote.com/quotes/authors/m/mitch_hedberg.htmlMitch Hedberg - My fake plants died because I did not pretend to water them. -- jason.software.particle --~--~-~--~~~---~--~~ 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 realize cascading delete in sqlite?
Hi guys, Can cascading delete be realized in sqlite? If can, how to realize it? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: finding content providers
This might be what you want: http://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders(java.lang.String,%20int,%20int) (Just noticed the stupid typo in the doc -- patching == matching. :p) On Mon, May 25, 2009 at 11:50 PM, Jason Proctor ja...@particularplace.comwrote: sigh. if you don't understand the question, please leave it for someone else to answer. thanks. i think u shd read this first... Querying a Content Provider You need three pieces of information to query a content provider: The URI that identifies the provider The names of the data fields you want to receive The data types for those fields this is frm http://developer.android.com/guide/topics/providers/content-providers.html http://developer.android.com/guide/topics/providers/content-providers.html On Tue, May 26, 2009 at 11:02 AM, Jason Proctor mailto:ja...@particularplace.comja...@particularplace.com wrote: well, i thought the question was fairly clear :-) i don't want a list of the content, i want a list of the *providers*. wat kinda content??? media or contacts or wat??? On Tue, May 26, 2009 at 10:46 AM, Jason Proctor mailto:mailto:ja...@particularplace.comja...@particularplace.com mailto:ja...@particularplace.comja...@particularplace.com wrote: can i programmatically get a list of content providers extant on the system? tx -- jason.software.particle -- Regards, Sujay http://www.brainyquote.com/quotes/authors/w/walt_disney.html http://www.brainyquote.com/quotes/authors/w/walt_disney.htmlWalt Disney - I love Mickey Mouse more than any woman I have ever known. -- jason.software.particle -- Regards, Sujay http://www.brainyquote.com/quotes/authors/m/mitch_hedberg.htmlMitch Hedberg - My fake plants died because I did not pretend to water them. -- jason.software.particle -- Dianne Hackborn Android framework engineer hack...@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] Re: How to realize cascading delete in sqlite?
AFAIK although you can set foreign key constraints in SQLite, they don't actually work. This is not an android issue, but an unimplemented feature of SQLite. On May 26, 8:07 am, quill quill...@163.com wrote: Hi guys, Can cascading delete be realized in sqlite? If can, how to realize it? 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] Can't intercept the OnTouch event of PopupWindow
Hi all, I want to intercept the OnTouch event in a PopupWindow, but it failes everytime. Here is the code snip: public class Demo extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Prepare the popup window final TextView popupText = new TextView(this); popupText.setText(Poping up...); popupText.setBackgroundColor(Color.BLUE); popupText.setFocusableInTouchMode(true); final PopupWindow popupWindow = new PopupWindow(this); popupWindow.setContentView(popupText); popupWindow.setWidth(100); popupWindow.setHeight(100); popupWindow.setBackgroundDrawable(null); popupWindow.setOutsideTouchable(true); popupWindow.setTouchInterceptor(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { Log.d(Demo, popupWindow::onTouch view: + v + , event: + event); return false; } }); // Prepare the activity view final LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); layout.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { Log.d(Demo, layout::onTouch view: + v + , event: + event); return false; } }); final TextView backgroundView = new TextView(this); backgroundView.setWidth(240); backgroundView.setHeight(300); backgroundView.setBackgroundColor(Color.RED); layout.addView(backgroundView); final Button button = new Button(this); button.setWidth(240); button.setHeight(20); button.setOnClickListener(new OnClickListener() { public void onClick(View v) { popupWindow.showAsDropDown(backgroundView); } }); layout.addView(button); setContentView(layout); } When the activity started, I can click the button to show the popup window correctly. But after that, nothing happens when I touch the popup window's view. But if I touch any where outside the popup window, the log Log.d(Demo, layout::onTouch view: + v + , event: + event); will work. It looks like when I touch the view of the popup window, the touch event has been consumed somewhere? Do you have any ideas on this? Thanks for your consideration. Regards, Johnny -- we all have our crosses to bear --~--~-~--~~~---~--~~ 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: Embedding custom text renderign
Hi Dianne Thanks a lot for the quick reply. You mean to say that I have to extend the TextView class and override the OnDraw method. right? Doing this, i'll loose the actual look and feel of android widgets, which i don't want. As I know, Android can recognize the TTF fonts. I have supplied the TTF font for Hindi but currently its is printing empty boxes for Hindi characters. I there a way i can provide the TTF font indices to android so that it can understand the Indian language characters and render it using my fonts. Thanks in advance. Regards Amit On Tue, May 26, 2009 at 12:18 PM, Dianne Hackborn hack...@android.comwrote: Not in the SDK -- you'd need to do all of your own drawing for TextView (which is basically the thing that draws text wherever there is a widget) wherever you use it. On Mon, May 25, 2009 at 11:39 PM, amit mishra amitmishr...@gmail.comwrote: Hi All, I have a text rendering engine that uses bitmap/ TTF fonts and can render the unicode strings(Including Indian Languages). I want to integrate my rendering engine(Rasterizer) so that the android UI components uses my rendering engine instead of default for drawing text. How can i achieve this? Please help. Regards Amit Mishra -- Dianne Hackborn Android framework engineer hack...@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] finding content providers
that's it -- thanks! This might be what you want: http://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders(java.lang.String,%20int,%20int)http://developer.android.com/reference/android/content/pm/PackageManager.html#queryContentProviders(java.lang.String,%20int,%20int) (Just noticed the stupid typo in the doc -- patching == matching. :p) -- jason.software.particle --~--~-~--~~~---~--~~ 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] calloc probelm in Dalvik
Hi all, I am learning Dalvik by debugging the code. I found some calloc invocations in allocateAuxStructures() function return NULL. I cound't trace into the calloc function, so I don't know if memory really runs out or due to other reasons. The following is my building environment: TARGET_PRODUCT=sim TARGET_BUILD_VARIANT=eng TARGET_SIMULATOR=true TARGET_BUILD_TYPE=release TARGET_ARCH=x86 HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release BUILD_ID= TARGET_DEVBUILD=false TARGET_DALVIK_COMPILER=gcc Does anyone have clue in this? Many thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Can't intercept the OnTouch event of PopupWindow
Found the problem. After looking at the source code of PopupWindow, I found the TouchInteceptor will only be called if the background drawable is not null. Here is the snip: private void preparePopup(WindowManager.LayoutParams p) { if (mBackground != null) { //... PopupViewContainer popupViewContainer = new PopupViewContainer(mContext); // ... mPopupView = popupViewContainer; } else { mPopupView = mContentView; } // ... } And the mTouchInterceptor.onTouch will only be called inside the PopupViewContainer. So in my code, after I set the background drawable to whatever, (I used new BitmapDrawable()), the touch event will be intercepted here. However, I still don't understand why this method only works when there is a background drawable, here is what's said in doc: public void setTouchInterceptor (View.OnTouchListener l) Set a callback for all touch events being dispatched to the popup window. Regards, Johnny On Tue, May 26, 2009 at 3:21 PM, Johnny Lee johnnylee...@gmail.com wrote: Hi all, I want to intercept the OnTouch event in a PopupWindow, but it failes everytime. Here is the code snip: public class Demo extends Activity { �...@override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Prepare the popup window final TextView popupText = new TextView(this); popupText.setText(Poping up...); popupText.setBackgroundColor(Color.BLUE); popupText.setFocusableInTouchMode(true); final PopupWindow popupWindow = new PopupWindow(this); popupWindow.setContentView(popupText); popupWindow.setWidth(100); popupWindow.setHeight(100); popupWindow.setBackgroundDrawable(null); popupWindow.setOutsideTouchable(true); popupWindow.setTouchInterceptor(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { Log.d(Demo, popupWindow::onTouch view: + v + , event: + event); return false; } }); // Prepare the activity view final LinearLayout layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); layout.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { Log.d(Demo, layout::onTouch view: + v + , event: + event); return false; } }); final TextView backgroundView = new TextView(this); backgroundView.setWidth(240); backgroundView.setHeight(300); backgroundView.setBackgroundColor(Color.RED); layout.addView(backgroundView); final Button button = new Button(this); button.setWidth(240); button.setHeight(20); button.setOnClickListener(new OnClickListener() { public void onClick(View v) { popupWindow.showAsDropDown(backgroundView); } }); layout.addView(button); setContentView(layout); } When the activity started, I can click the button to show the popup window correctly. But after that, nothing happens when I touch the popup window's view. But if I touch any where outside the popup window, the log Log.d(Demo, layout::onTouch view: + v + , event: + event); will work. It looks like when I touch the view of the popup window, the touch event has been consumed somewhere? Do you have any ideas on this? Thanks for your consideration. Regards, Johnny -- we all have our crosses to bear -- we all have our crosses to bear --~--~-~--~~~---~--~~ 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] Gathering Usage Data - Any ideas welcome!
Hi all, I'm currently working on a demo project and I'm about to try it out with some users. I'd like to automatically record the way they use the application, their navigation route, times spent in each section and duration using the application in general etc. I was wondering if there are any solutions for this already available and if not how would you go about achieving such a goal? My initial thought is that I could augment all of my UI click listeners with a call to a custom logger class which could write the time and the element, opening the file for writing in onStart, onResume and closing it in onStop for the activity. This doesn't need to be bullet proof, I'm just gathering data to improve the UI. That being said, I'm sure developing a unified solution would help a lot of people learn more about how their users interact with their apps and I'm happy to do the leg work I was just hoping for some advice regarding the approach to use. I found this in the google internal code; UsageStatsServicehttp://www.google.co.in/codesearch/p?hl=en#uX1GffpyOZk/services/java/com/android/server/am/UsageStatsService.javaq=android%20package:git://android.git.kernel.org%20UsageStatsl=17 Which is slightly different to what I need but made me think that perhaps a background service would be the best option, it could presumably then be turned on and off and therefore not be used in the deployed version. This would remove the issue of overhead. I'm just thinking out loud, feel free to do the same :) Gav --~--~-~--~~~---~--~~ 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 let Android create my activity within the process which the launcher activity lies in?
Sorry, there are three separate applications. One is my Photo Editor application. The other two applications are the launcher applications, they emit android.intent.action.EDIT intent to launch my Photo Editor application. The Photo Editor application contains my photo editor activity which uses a singleton class. And that singleton class instance is used by the two instance of my photo editor activity due to other two applications both emit android.intent.action.EDIT intent. What do you mean use the Application context to synchronize access to the singleton? How should I use it? Thanks! On May 26, 12:26 pm, Matt Williams m...@makeable.co.uk wrote: I was a bit confused by your question. Are they 2 applications, or 2 activities within the same application? If they are activities within the same application, could you use the Application context to synchronize access to the singleton? On May 26, 5:06 am, Oceanedge newsforhar...@gmail.com wrote: I'm developing a photo editor application. It will launched by android.intent.action.EDIT intent. I made two application to emit that intent. I found that two instance of my photo editor activity is created within the same process which is named as my activity. But there is a singleton class used in my photo editor activity and that two activities use the same singleton class instance which break my application logic. I wonder if there is any way to let Android create my activity within the process which the launcher activity lies in? So that the two instance of my photo editor activity can be separated into two different process. And so they can reference to different instance of that singleton class. Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to let Android create my activity within the process which the launcher activity lies in?
Thanks, but I think singleton is a general pattern used generally. Why should we stop using it in Android? :( On May 26, 12:12 pm, Romain Guy romain...@google.com wrote: Hi, You cannot do this, if only for security reasons. Running arbitrary code in the Home process would be very bad :) Instead of creating two processes (which is really heavy and requires a lot more memory), why don't you stop using a singleton? On Mon, May 25, 2009 at 9:06 PM, Oceanedge newsforhar...@gmail.com wrote: I'm developing a photo editor application. It will launched by android.intent.action.EDIT intent. I made two application to emit that intent. I found that two instance of my photo editor activity is created within the same process which is named as my activity. But there is a singleton class used in my photo editor activity and that two activities use the same singleton class instance which break my application logic. I wonder if there is any way to let Android create my activity within the process which the launcher activity lies in? So that the two instance of my photo editor activity can be separated into two different process. And so they can reference to different instance of that singleton class. Thanks! -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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] image not appearing in the sd card
Hi all, Sorry if this is a re-post. I tried to find the solution here but failed. I made a small app which downloads an image(jpg) and saves it on the sd card. It works fine. I could pull the image down in to my computer and could see it. But i couldnt see it in the emulator. (not appearing in the gallery).. Why is that? private void testDownload(String urlStr) { URL url = null; try { url = new URL(urlStr); URLConnection conn = null; conn = url.openConnection(); conn.connect(); InputStream is = null; is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); Bitmap bm = BitmapFactory.decodeStream(bis); File f = new File(/sdcard/1.jpg); FileOutputStream fos = null; fos = new FileOutputStream(f); bm.compress(Bitmap.CompressFormat.JPEG, 100, fos); bis.close(); is.close(); } catch (IOException e) { Log.e(TAG, error6: + e.toString()); } } 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: How to let Android create my activity within the process which the launcher activity lies in?
The singleton is a perfectly valid pattern with Android, but if you need to use two instances of your singleton, then the problem is that you are using a singleton in the first place. On Tue, May 26, 2009 at 12:58 AM, Oceanedge newsforhar...@gmail.com wrote: Thanks, but I think singleton is a general pattern used generally. Why should we stop using it in Android? :( On May 26, 12:12 pm, Romain Guy romain...@google.com wrote: Hi, You cannot do this, if only for security reasons. Running arbitrary code in the Home process would be very bad :) Instead of creating two processes (which is really heavy and requires a lot more memory), why don't you stop using a singleton? On Mon, May 25, 2009 at 9:06 PM, Oceanedge newsforhar...@gmail.com wrote: I'm developing a photo editor application. It will launched by android.intent.action.EDIT intent. I made two application to emit that intent. I found that two instance of my photo editor activity is created within the same process which is named as my activity. But there is a singleton class used in my photo editor activity and that two activities use the same singleton class instance which break my application logic. I wonder if there is any way to let Android create my activity within the process which the launcher activity lies in? So that the two instance of my photo editor activity can be separated into two different process. And so they can reference to different instance of that singleton class. Thanks! -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. 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] Sending sms via intents launches only the compose window
hi, I am trying to send an sms by using android native messaging application as follows Uri smsToUri = Uri.parse(smsto://5556); Intent i = new Intent(Intent.ACTION_SENDTO, smsToUri); i.putExtra(sms_body, This must get sent); startActivity(i); All it does is open a compose window with To and Body filled in.What do I need to do so that the SMS is sent automatically? Where can I find references to valid putExtras that I MUST do to send an SMS? I couldn't find any useful info on Android developer guide - perhaps I didn't notice them. Kindly help. -vignesh --~--~-~--~~~---~--~~ 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: Intent to handle files opened in browser ending .droid.txt
Hi, Here's what i ended up using hopefully it will help you. This intent only matches on the file name, not on the mimetype. Let me know how you got on. intent-filter action android:name=android.intent.action.VIEW/action category android:name=android.intent.category.DEFAULT/ category category android:name=android.intent.category.BROWSABLE/ category data android:scheme=http android:host=* android:pathPattern=.*\\.droid.txt / /intent-filter Alec On May 22, 1:51 am, CaptainFanatic benny.caldw...@gmail.com wrote: I am having trouble with this too. I have tried using a html file with a new mime type for my application: ... head meta http-equiv=Content-Type content=application/myapp /head ... I have tried using .html and .myapp file extensions. My intent filters are something like this: intent-filter action android:name=android.intent.action.VIEW / category android:name=android.intent.category.DEFAULT / data android:mimeType=application/myapp android:scheme=http / /intent-filter But my application is not started. I have found a few different suggestions for this problem but none have worked so far. Has anyone gotten this to work? --~--~-~--~~~---~--~~ 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: Map view not displaying tiles in 1.5 but it's fine in 1.1
The built-in map application (and browser) work fine, and as I said before, firewall is fine - at least as much as I can see. I have exactly the same code running on a different machine (Vista) and it works just fine! On May 26, 2:11 am, Mark Murphy mmur...@commonsware.com wrote: Lex wrote: I just went through the MapView Tutorial and I can't get themap displayed whatsoever. I had SDK1.5installed from the beginning. Internet permission isfine, Firewall isfine. I deleted the debug.keystore file on my (XP) machine, rebuilt the project under Google API/Target 3, generated a new key, but still nomap. I really feel like I have exhausted all known solutiouns I have found for this issue so far. Using Eclipse Ganymed and JDK 1.6.13 Does the built-in Maps application work? Ifnot, the problem is with your firewall or something else tied to networking. If it does, then the problem is probably with your API key, or perhaps the INTERNET permission. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 0.95 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] Re: How to get the KeguardScreenCallback object in my own Activity
I have looked into the source code,and found that the class of KeyguardScreenCallback is a interface. And the inferface only be implemented in LockPatternKeyguardView.there has a instance of LockPatternKeyguardView and only gived the default access popedom,so I have no way to get the object that can let me to call the goToUnlockScreen. Anyone can tell me how to remove the lock,Insteading of using KeyguardManager? Beacause the KeyguardManager itself has a bug,when used in my operation! --~--~-~--~~~---~--~~ 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: Hide the virtual keyboard
Hi, I'm trying to close the soft keyboard once a search button is clicked with: // close soft keyboard InputMethodManager inputManager = (InputMethodManager) ShowSearchQuery.this.getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(editSearchQuery.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY); where editSearchQuery is the EditText view for the search input. But the soft keyboard is not closing? Am I using the correct methods/ views? --~--~-~--~~~---~--~~ 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: Hide the virtual keyboard
Ah it worked with HIDE_NOT_ALWAYS ! On May 26, 9:53 am, AusR austinjr...@gmail.com wrote: Hi, I'm trying to close the soft keyboard once a search button is clicked with: // close soft keyboard InputMethodManager inputManager = (InputMethodManager) ShowSearchQuery.this.getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(editSearchQuery.getWindowToken(), InputMethodManager.HIDE_IMPLICIT_ONLY); where editSearchQuery is the EditText view for the search input. But the soft keyboard is not closing? Am I using the correct methods/ views? --~--~-~--~~~---~--~~ 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] OpenGL - glLineWidthx, glLineWidth bug
Can anyone confirm that the OpenGL methods glLineWidthx, glLineWidth do not work. That is, setting these to anything about 1 has no effect when running on the phone. They appear to work on the emulator okay but not the phone. Al. --~--~-~--~~~---~--~~ 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] Building android core for custom hardware
Hi, I will be soon working on porting Android OS to some custom hardware. Has any one in the group done this before? If yes, what are typical guidelines, roadblocks to watch out for? Thanks in advance. Best Regards, Sushrut http://androidcompetencycenter.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: Animated Sprites For Games
Hi Robert, Thanks for the quick reply. I understand the way it is done in other java games. But given an AnimationDrawable class to show animated drawables, I wanted to know how to use that class to render frames on a canvas. If that is possible, then it will reduce the number of lines of code. So can u please tell me how to render the animation drawable on a canvas? I am looking forward to a quick reply. On May 26, 1:11 am, Robert Green rbgrn@gmail.com wrote: It's usually a little more complicated than that because you need to have it handled by your loop and then there is variable timing, etc so I wrote this to get people started: http://www.rbgrn.net/content/253-main-loop-suitable-stable-animations It has some code that you may want to use. Just load up all of your frames into an array of bitmaps and then have your draw code draw the appropriate bitmap into the correct spot, which is as easy as canvas.draw(bitmap, x, y, paint). If you need to scale or rotate it, you may want to use a matrix to draw and have it position (translate) scale and rotate. I just helped someone else doing the same thing. It's not that hard after you've implemented it once. There is some good discussion in the top comments on this post as well -http://www.rbgrn.net/content/54-getting-started-android-game-development Good luck! On May 25, 1:08 pm, Alekh alek...@gmail.com wrote: How do I add animatedspritesto a custom view? I have used AnimationDrawable object to execute the animation. The animation works if I add the xml resource to the background of my custom view. But I want to know how to draw the animationdrawable directly on a canvas. Please help me with examples.. --~--~-~--~~~---~--~~ 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] Differentia bussiness contacts and personnel contacts
Hi , Can anyone tell me how to differentiate Business Contacts and Personnel Contacts ? I am able to access contacts(using Content_URI) but , not able to get all details of a contact. I want to join the cursors to get one record per person / contact.Please help me joining the cursors. Thanks and Regards Kamal --~--~-~--~~~---~--~~ 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: Building android core for custom hardware
Sushrut Bidwai wrote: Hi, I will be soon working on porting Android OS to some custom hardware. Has any one in the group done this before? If yes, what are typical guidelines, roadblocks to watch out for? Guideline #1: Ask questions about Android porting on a list that pertains to Android porting: http://source.android.com/discuss -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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 find out if device is in sleep mode?
JP wrote: I am sure it is buried in the SDK somewhere... but I couldn't find it. This is relevant to a service running in the background: How can I find out if the device is in sleep mode? If your code is in position to ask the question, you're not in sleep mode... ;-) -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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 get source code out of a .apk file
narendrasingh.bi...@gmail.com wrote: Hi Guys, Is there a way to get source code out of a .apk file in android? No. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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] Put WebView and EditText together
While I put the WebView and EditText in the same page, I encounter a problem. The EditText will hold the focus and I can't input word into WebView, so that I can't do login or search in the WebView. If I take off EditText, the WebView can be edit again and I can do login and search. Do anyone know how to handle this situation?? Thank you --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: calloc probelm in Dalvik
It looks like you're building the simulator build. In this case, your host C library will be used, so whatever calloc() returns really depends on it. Do you know what sizes the program is trying to allocate? I assume you can add a simple trace in case of failure. Hope this helps On Tue, May 26, 2009 at 9:34 AM, profect profect.andr...@gmail.com wrote: Hi all, I am learning Dalvik by debugging the code. I found some calloc invocations in allocateAuxStructures() function return NULL. I cound't trace into the calloc function, so I don't know if memory really runs out or due to other reasons. The following is my building environment: TARGET_PRODUCT=sim TARGET_BUILD_VARIANT=eng TARGET_SIMULATOR=true TARGET_BUILD_TYPE=release TARGET_ARCH=x86 HOST_ARCH=x86 HOST_OS=linux HOST_BUILD_TYPE=release BUILD_ID= TARGET_DEVBUILD=false TARGET_DALVIK_COMPILER=gcc Does anyone have clue in this? Many 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] Android Rasterizer Class
Hi All, I would like to understand the use of Rasterizer class provided in Android. Any code example will be a great help. Is it possible to extend the Rasterizer, and tell it to use custom rendering logic for text than the default one? Regards Amit --~--~-~--~~~---~--~~ 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: image not appearing in the sd card
make sure that the emulator is loaded with the sdcard emulator -sdcard name of the card On Tue, May 26, 2009 at 1:31 PM, Sukitha Udugamasooriya suk...@gmail.comwrote: Hi all, Sorry if this is a re-post. I tried to find the solution here but failed. I made a small app which downloads an image(jpg) and saves it on the sd card. It works fine. I could pull the image down in to my computer and could see it. But i couldnt see it in the emulator. (not appearing in the gallery).. Why is that? private void testDownload(String urlStr) { URL url = null; try { url = new URL(urlStr); URLConnection conn = null; conn = url.openConnection(); conn.connect(); InputStream is = null; is = conn.getInputStream(); BufferedInputStream bis = new BufferedInputStream(is); Bitmap bm = BitmapFactory.decodeStream(bis); File f = new File(/sdcard/1.jpg); FileOutputStream fos = null; fos = new FileOutputStream(f); bm.compress(Bitmap.CompressFormat.JPEG, 100, fos); bis.close(); is.close(); } catch (IOException e) { Log.e(TAG, error6: + e.toString()); } } 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: image not appearing in the sd card
Yes. It s loaded. I pushed few images from my computer to the emulator using the command line. I could watch those from the gallery. In the previous case It downloads images (they are not visible in the gallery but I could pull them from the command line). --~--~-~--~~~---~--~~ 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] Issue with VideoView for different resolution streams
Hi, We are playing MP4 files on ARM-based target with VGA display (640 x 480). Playback is done for following resolutions using the sample applications Music+Camera: 1. stream res.: 640 x 480 Observation: Plays as 640 x 480 2. stream res.: 400 x 240 Observation: Plays as 640 x 384 3. stream res: 320 x 240 Observation: Plays as 320 x 240 I understand that for #1 and #2, aspect ratio is being maintained for playback and. But, resizing is being done in onMeasure in VideoView.java file). But for #3, stream aspect ratio is already matching display aspect ratio. And resizing is not done (to 640 x 480). Exactly why is this resizing not happening ? Regards, Vrukesh --~--~-~--~~~---~--~~ 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] disabling scrolbar in ListView
Hi all, anybody can tell me how to disable or remove the scrollbar property of a ListView. I created a ListView like 1) ListView listview = new listView(context); and i add an adapter in to the list 2) listview .setAdapter(listAdapter); //listAdapter is an adapter here the list adapter size greater than one then scrollbar automatically come,but i want to display the contents with out scrollbar . Anybody can help me to fix this problem --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Can't change MediaPlayer data source
So what you say is that's it's impossible to have a FileDescriptor pointing to my raw sound ... But when you call MediaPlayer.create() it does kinda localize the sound in the APK. I'm sure there must be a way to load a sound located in the APK :) On 26 mai, 02:28, Marco Nelissen marc...@android.com wrote: On Mon, May 25, 2009 at 4:01 PM, Moons moone...@gmail.com wrote: Hello Marco. Altough I understood what you said, I am not very good with FileDescriptors. So you mean that I can't have a File descriptor for a raw resource in my APK? Correct. An APK file is essentially a ZIP file, and your raw resources exist only within the zip file, not as separate files. Therefore, when you get a file descriptor for a resource, what you're really getting is a file desciptor for the apk, along with the position within the apk, i.e. offset and length. This is why openRawResourceFd() returns an AssetFileDescriptor, not a FileDescriptor. --~--~-~--~~~---~--~~ 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: ant and eclipse builds don't play nice
from my experience, eclipse never used the build.xml for it's internal builds - how did you do that ? you can omit the android_rules file if you paste the needed targets into your build file (or if you had them working in an older version) then afaik just a few additions are needed (see below) quoted from our developer list !-- 1.5 Changes START -- !-- Custom Android task to deal with the project target, and import the proper rules. This requires ant 1.6.0 or above. -- path id=android.antlibs pathelement path=${sdk-location}/tools/lib/anttasks.jar / pathelement path=${sdk-location}/tools/lib/sdklib.jar / pathelement path=${sdk-location}/tools/lib/ androidprefs.jar / pathelement path=${sdk-location}/tools/lib/apkbuilder.jar / pathelement path=${sdk-location}/tools/lib/jarutils.jar / /path !-- 1.5 Changes END -- !-- 1.5 Changes START -- taskdef name=setup classname=com.android.ant.SetupTask classpathref=android.antlibs/ setup import=false / taskdef name=aaptexec classname=com.android.ant.AaptExecLoopTask classpathref=android.antlibs/ taskdef name=apkbuilder classname=com.android.ant.ApkBuilderTask classpathref=android.antlibs/ !-- 1.5 Changes END -- add one line to build.properties #new prop needed for 1.5 sdk-location=\\your\\android-sdk--1.5_r1\\path hope this helps cheers, zero openintents.org On May 26, 3:06 am, Craig supkic...@gmail.com wrote: Hi, I use ant to do release builds, and eclipse to do all my debug builds. With the new 1.5 sdk, my build.xml overides the resource-src target in order to perform some additional tasks, and it then depends on android_rules.resource-src to get the proper toolchain behaviour: e.g. ... setup / target name=resource-src depends=my-own-target, android_rules.resource-src / ... This works well for ant, but eclipse doesn't seem to know where android_rules comes from (not surprising since it is dynamically imported via code), and thus says there is an error in the file. This in turn stops the entire android project from building. So I need to either somehow get eclipse to parse the build.xml properly, or better still, get eclipse to ignore the build.xml altogether since build.xml takes no part in the eclipse build. Any ideas? thanks, Craig --~--~-~--~~~---~--~~ 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 get ID from created Drawable?
Hi, I created a new Drawable with: Drawable dx = resources.getDrawable(R.drawable.mydaysminipic_ov); dx.setColorFilter(0xff00ff00, Mode.SRC_ATOP); and for: updateViews.setImageViewResource(predefinedDraw, -- ID from dx); I need the ID from it... but how to get? Or any other Idea how to assign my Drawable dx to the above predefinedDraw? Thanks Chris --~--~-~--~~~---~--~~ 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: Widget bug, is there a work around?
Bump, anyone? On May 22, 9:28 pm, zl25drexel zl25dre...@gmail.com wrote: Dear google guys, the widget framework (or the Home app) has a pretty bad bug: - install ApiDemo - long press screen/widget/ApiDemo - *CHANGE ORIENTATION* - then without changing orientation back, click ok to create the widget the widget will not show up, did some debugging it looks like the widget is added to the widget service but it's just not shown on the Home screen, so if a widget has a config activity and the user happens to change orientation during widget config time (very common if widget has text boxes), the widget will become a garbage that just take up resources until user uninstall the widget app. even worse, if the widget does heavy background service to update, it will be wasting time updating a widget that is not visible Does anyone know a work around? --~--~-~--~~~---~--~~ 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] Progress bar update help
Hi, I m implementing a small app which downloads files (avg 1MB files- takes 5 seconds to download). -- I want to show the progress using a ProgressBar. --The user can pause the download if he desires. How can I show the progress? (How can I know the amount that has downloaded at a given moment?) Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to get ID from created Drawable?
or maybe you know how to transform a Drawable into a Bitmap so I could use: updateViews.setImageViewBitmap(viewId, bitmap) --~--~-~--~~~---~--~~ 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] blocking click and focus on layout and on all children
Hi I was wondering if its possible to block the onclick events on a layout and all the children inside the layout. for example, I have a LinearLayout and inside that I have buttons and an editText. At a certain point I don't want the user to click on the buttons or edit the text. Is there a way to block that? Do I have to do it for each view? or I can do it for a Layout? What is the best way to do this? Thanks Daniel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-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: blocking click and focus on layout and on all children
setclickable(false) shd help u i guess... On Tue, May 26, 2009 at 5:54 PM, daniel.benedykt daniel.bened...@gmail.comwrote: Hi I was wondering if its possible to block the onclick events on a layout and all the children inside the layout. for example, I have a LinearLayout and inside that I have buttons and an editText. At a certain point I don't want the user to click on the buttons or edit the text. Is there a way to block that? Do I have to do it for each view? or I can do it for a Layout? What is the best way to do this? Thanks Daniel -- Regards, Sujay Bette Davis http://www.brainyquote.com/quotes/authors/b/bette_davis.html - Brought up to respect the conventions, love had to end in marriage. I'm afraid it did. --~--~-~--~~~---~--~~ 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: Progress bar update help
You can ask a URLConnection for the content length and then read from the content stream in chunks. You can display your progress by setting the max to the content length and then incrementing the progress by your read chunk size. On May 26, 1:21 pm, Sukitha Udugamasooriya suk...@gmail.com wrote: Hi, I m implementing a small app which downloads files (avg 1MB files- takes 5 seconds to download). -- I want to show the progress using a ProgressBar. --The user can pause the download if he desires. How can I show the progress? (How can I know the amount that has downloaded at a given moment?) Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to find out if device is in sleep mode?
Well nomenclature... Here's the scenario: I've got an app that implements the relevant data processing and backend server connectivity through a Service that I keep running on a reduced (sleep) activity level when the user puts the device to sleep (using end button) or when the screen timeout hits. I can follow this status change, because it triggers calls to overloaded onStop() and onPause() methods of the app's subclassed Activity. This way, I control active/reduced (sleep) activity levels of that Service. Everything's cool and dandy in this scenario. Enter an AppWidget that's using this Service in a similar fashion, with functionality implemented in a subclass of AppWidgetProvider. This changes the game - I have found no way to determine when to set the Service to the reduced (sleep) activity level from that point. The app's Activity has long paused, and I keep the Service at active level, as the widget needs updates from the Service similar to what the Activity needs when in front. With the AppWidget on the home screen, I want, and should (re: battery life), drop the Service's activity level when the device enters sleep mode. The most elegant way to handle this would be to detect whether the device sleeps (or, on second thought, better actually, whether the display is dark) right inside the Service. This way, as a side product, I can also drop following the device status in the overloaded onStop(), onPause(), onStart() and onResume() methods. On May 26, 3:06 am, Mark Murphy mmur...@commonsware.com wrote: JP wrote: I am sure it is buried in the SDK somewhere... but I couldn't find it. This is relevant to a service running in the background: How can I find out if the device is in sleep mode? If your code is in position to ask the question, you're not in sleep mode... ;-) -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Warescription: Three Android Books, Plus Updates, $35/Year --~--~-~--~~~---~--~~ 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] detecting idle, off hook and ringing
As Bnet above, i'm trying to write a program whichs detects the different states of the phone and mke a different noise in each case. There is a problem that i really don't understand! Please someone can take a look at it and try to explain to ma what's wrong ? public class testsonqdappel extends Activity { private TelephonyManager telephone; private MediaPlayer audio; public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); telephone = (TelephonyManager)getSystemService (Context.TELEPHONY_SERVICE); } private PhoneStateListener psl = new PhoneStateListener() { @Override public void onCallStateChanged (int state, String incomingNumber) { state = telephone.getCallState(); if(state == android.telephony.TelephonyManager.CALL_STATE_IDLE) { audio = MediaPlayer.create(getBaseContext(), R.raw.bonjour); audio.start(); } if (state == android.telephony.TelephonyManager.CALL_STATE_RINGING) { audio = MediaPlayer.create(getBaseContext(), R.raw.batterie); audio.start(); } if (state == android.telephony.TelephonyManager.CALL_STATE_OFFHOOK) { audio = MediaPlayer.create(getBaseContext(), R.raw.pleine); audio.start(); } } }; } Thanks a lot --~--~-~--~~~---~--~~ 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] Create Bitmap from BitmapDrawable?
Hi, how can i convert a BitmapDrawable into a Bitmap (hopefully it keeps the Alphachannel from the BitmapDrawable) thanks Chris --~--~-~--~~~---~--~~ 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: detecting idle, off hook and ringing
As Bnet above, i'm trying to write a program whichs detects the different states of the phone and mke a different noise in each case. There is a problem that i really don't understand! Please someone can take a look at it and try to explain to ma what's wrong ? 1. You have created a PhoneStateListener and then have done nothing with it. Please look at TelephonyManager#listen() in the documentation. 2. You are not cleaning up the MediaPlayer objects you are creating, which might be bad. 3. You are not unregistering your PhoneStateListener when your activity closes (e.g., in onDestroy()). There may be other issues -- those three come to mind for me. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 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] Re: Widget bug, is there a work around?
I don't have a workaround, but I can confirm that the widget I'm developing exhibits the same problem; it seems to get added to the AppWidgetHost, continues to receive updates, but is never displayed to the user. Tom. 2009/5/26 AndroidApp zl25dre...@gmail.com Bump, anyone? On May 22, 9:28 pm, zl25drexel zl25dre...@gmail.com wrote: Dear google guys, the widget framework (or the Home app) has a pretty bad bug: - install ApiDemo - long press screen/widget/ApiDemo - *CHANGE ORIENTATION* - then without changing orientation back, click ok to create the widget the widget will not show up, did some debugging it looks like the widget is added to the widget service but it's just not shown on the Home screen, so if a widget has a config activity and the user happens to change orientation during widget config time (very common if widget has text boxes), the widget will become a garbage that just take up resources until user uninstall the widget app. even worse, if the widget does heavy background service to update, it will be wasting time updating a widget that is not visible Does anyone know a work around? --~--~-~--~~~---~--~~ 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 do i kill an android application
how do i kill an android application --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Create Bitmap from BitmapDrawable?
Doesn't BitmapDrawable.getBitmap() do what you need? Tom. 2009/5/26 guruk ilovesi...@gmail.com Hi, how can i convert a BitmapDrawable into a Bitmap (hopefully it keeps the Alphachannel from the BitmapDrawable) thanks Chris --~--~-~--~~~---~--~~ 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: A $400.00 learning experience...
Actually, you can activate the device without a SIM card. I documented what I did, perhaps it will be of value to you: http://www.opgenorth.net/getting-starting-with-my-adp1.aspx. On Sun, May 24, 2009 at 00:52, Kent Loobey k...@uoregon.edu wrote: Because I wanted to develop an android application that ran on a G1 device I bought an Android Dev 1 Phone. I thought that having the actual device in hand would help me get a better feel for the device as I worked on the application. I don't personally use a phone that much and don't have any need for a cel phone. So now I have the device but can't use it without opening an account with T- Mobile. It seems that Google requires the G1 have a SIM installed to activate the device. I am really disappointed in the lack of honesty in this matter. The G1 device isn't really unlocked and how open is it if you have to have an account with a specific provider. -- http://www.opgenorth.net --~--~-~--~~~---~--~~ 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] Surface flinger - overlay
Hi, I am implementing a custom MIO which makes use of Overlay interface in ISurface.cpp. In android_surface_output.cpp file we changed the initCheck function to call the createoverlay interface mSurface-createOverlay(displayWidth, displayHeight,videoFormat); but the function returns NULL. Here fuction createOverlay calls the onTransact function in ISurface.cpp and from there it goes to the overlay source object creation in Layerbuffer.cpp which calls the overlay object creation. My overlay object is created sucessfully..but the problem is after returning to the createOverlay in Isurface.cpp the next function is writetoParcel.Here writing is happening without any issue.But while reading using the function readfromParcel iam getting failure message in readobject function. Is there any problem with custom MIO implementation? 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: how do i kill an android application
On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? --~--~-~--~~~---~--~~ 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] problems importing existing project into eclipse
I used fileimportgeneralexisting projects into workspace I am trying to run the widget example from the dev blog but when I import the project I get an error Description ResourcePathLocationType Syntax error, annotations are only available if source level is 1.5 WordWidget.java SimpleWiktionary/src/com/example/android/ simplewiktionaryline 44 Java Problem I select propertiesandroid and make sure the project build target is 1.5 but that doesnt fix anything I am also getting this error in my console [2009-05-26 09:02:27 - spore-android] Android requires .class compatibility set to 5.0. Please fix project properties. this is also happening with a widget I was working on and needed to re- import. I sure hope someone can help me!!! thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Can't change MediaPlayer data source
On Tue, May 26, 2009 at 4:40 AM, Moons moone...@gmail.com wrote: So what you say is that's it's impossible to have a FileDescriptor pointing to my raw sound ... Well, yes and no. Read again what I said. But when you call MediaPlayer.create() it does kinda localize the sound in the APK. I'm sure there must be a way to load a sound located in the APK :) Of course there is. You've even used one of those methods already: MediaPlayer.create(int resourceID). To do that with a filedescriptor instead of a resource ID, you'd use: MediaPlayer.setDataSource(FileDescriptor file_descriptor_of_apk_file, long offset_within_apk_file, long length_of_data_within_apk_file). All three arguments can be obtained from the AssetFileDescriptor object that you get from openRawResourceFd() --~--~-~--~~~---~--~~ 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 do i kill an android application
Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.com wrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water 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] Clone a JSONArray
What's the most efficient way to clone a JSONArray? --~--~-~--~~~---~--~~ 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: A $400.00 learning experience...
I like the trick:-) On May 26, 9:08 am, Tom Opgenorth opgeno...@gmail.com wrote: Actually, you can activate the device without a SIM card. I documented what I did, perhaps it will be of value to you:http://www.opgenorth.net/getting-starting-with-my-adp1.aspx. On Sun, May 24, 2009 at 00:52, Kent Loobey k...@uoregon.edu wrote: Because I wanted to develop an android application that ran on a G1 device I bought an Android Dev 1 Phone. I thought that having the actual device in hand would help me get a better feel for the device as I worked on the application. I don't personally use a phone that much and don't have any need for a cel phone. So now I have the device but can't use it without opening an account with T- Mobile. It seems that Google requires the G1 have a SIM installed to activate the device. I am really disappointed in the lack of honesty in this matter. The G1 device isn't really unlocked and how open is it if you have to have an account with a specific provider. --http://www.opgenorth.net --~--~-~--~~~---~--~~ 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 do i kill an android application
In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.comwrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water 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] Re: Clone a JSONArray
Stringcopy? On Tue, May 26, 2009 at 4:19 PM, AusR austinjr...@gmail.com wrote: What's the most efficient way to clone a JSONArray? --~--~-~--~~~---~--~~ 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: Create Bitmap from BitmapDrawable?
:) Hi Tom, indeed, look good, but it looks it does not include my manipulations I did on the Drawable Bitmap BitmapOrg = BitmapFactory.decodeResource (resources,R.drawable.mydaysminipic_td);//its a green icon on a transparent background BitmapDrawable bmd = new BitmapDrawable(BitmapOrg); // to BitmapDrawable bmd.setColorFilter(0x00ff,Mode.SRC_ATOP); //manipulating the Bitmapdrawable to make all nontransparent pixels Blue //when i just test the Drawable its fine !! updateViews.setImageViewBitmap(draws2[i + 10], bmd.getBitmap()); But bmd.getBitmap() just give me original (maybe underlying Bitmap).. but how to get the DrawAble I created? many Thanks... Greets Chris --~--~-~--~~~---~--~~ 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] Video Recording help
Hi all, I am having some trouble getting video to record. Every time I call prepare(), I get a IOException with an error message prepare failed. Any help would be great. thanks, Hamy public class Test extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MediaRecorder recorder = new MediaRecorder(); try { recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setVideoSize(176, 144); // QCIF recorder.setVideoFrameRate(10); recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); FileOutputStream fs = openFileOutput(test, Context.MODE_PRIVATE); recorder.setOutputFile(fs.getFD()); recorder.prepare(); recorder.start(); for (int i = 0; i 1; i++) ; recorder.stop(); recorder.reset(); // You can reuse the object by going back to // setAudioSource() step recorder.release(); // Now the object cannot be reused } catch (Exception e) { Log.v(asd, Bad stuff happened); } } } --~--~-~--~~~---~--~~ 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] bindService() from multiple activities
Hi all, I have a quick query about bindService(). My main activity first starts and binds to the service. Other activities are then launched from the main activity. The child activities all bind to the same service, but it seems my service's onBind() is only called once. The application runs fine, but I thought the correct behaviour is that onBind gets called everytime an activity calls bindService()? --~--~-~--~~~---~--~~ 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] finishing subactivity after some perticular time
Hi all, I had opened an image file store in the sdcard using startActivity (intent) API. By doing this, image has opened and will remain open til manually coming back to parent activity by pressing back button. but I want it to be opened only for some perticular time after that it should exit and came back to parent acity. So how to set timer for subactivity?? Please help. Thanks, Asif --~--~-~--~~~---~--~~ 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 do i kill an android application
hmm so wats the no of apps that are shown??? i get varyin no based on the currently runnin apps... not basd on recently used apps... On Tue, May 26, 2009 at 8:48 PM, Urs Grob grob@gmail.com wrote: Longpress in home only shows the last accessed apps, not the currently running apps. -- Urs On Tue, May 26, 2009 at 5:13 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: i tried that out... ddms says that the process died... but when i long press the home button to see the running apps, i see mine as well... then y does ddms say that the process was killed??? Is it a bug that a dead process still gets displayed along with other running apps??? can any one temme y this is happening??? On Tue, May 26, 2009 at 8:35 PM, Mariano Kamp mariano.k...@gmail.com wrote: I never saw a need for that and don't know what would happen. Try it out. My guess would be, that you can kill the processes launched by your user id. On Tue, May 26, 2009 at 4:41 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? On Tue, May 26, 2009 at 7:51 PM, Mariano Kamp mariano.k...@gmail.com wrote: In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.com wrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberg - My fake plants died because I did not pretend to water them. -- Regards, Sujay Frank Lloyd Wright - TV is chewing gum for the eyes. -- Regards, Sujay Mitch Hedberg - My fake plants died because I did not pretend to water them. -- Regards, Sujay Bette Davis http://www.brainyquote.com/quotes/authors/b/bette_davis.html - Brought up to respect the conventions, love had to end in marriage. I'm afraid it did. --~--~-~--~~~---~--~~ 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: Porting 1.0 to 1.5, getSystemService(SENSOR_SERVICE)
How and when this issue will be solved. It seems that we are stuck and can not use Sensor API under emulator, I am sure it will be working fine under the real phone. Well! If anyone of you know the workaround for this problem please share it with me also. On Thu, Apr 30, 2009 at 6:30 PM, JP joachim.pfeif...@gmail.com wrote: Thanks snctl - I see something different (stuck call), but I suppose it goes back to the same root cause. I guess I'll wait and see how it comes out on the device (I am running with the crowd: G1/carrier OTA's and stay on the regular-user experience side of the fence). As far as the Zilog Z80 note goes... that seems to be a joke for the guys that live on the islands that likened to compare Android to the Sinclair ZX80 on these lists (:-). Oh yeah thegoodoledays. On Apr 29, 9:56 pm, snctln catlin.s...@gmail.com wrote: not sure if there is a work around but I believe this is a known issue according to the latest sdk release noteshttp:// developer.android.com/sdk/RELEASENOTES.html (copy and pasted below for convenience) Known Issues Sensor problems in Emulator * If your application uses the Sensor API and you are running it in the emulator on the Android 1.5 system image, you may experience problems. Your application may generate ANR messages or crash when using the sensors. The problem is being investigated. Other * We regret to inform developers that Android 1.5 will not include support for the Zilog Z80 processor architecture. I have a few apps that make use of the Sensor API and they are all working great on my ADP1 with the 1.5 image installed, so it looks to be just an emulator issues ---snctlnwww.snctln.com On Apr 29, 11:33 pm, JP joachim.pfeif...@gmail.com wrote: One more find in the 1.5 emulator. A call to getSystemService(SENSOR_SERVICE) just hangs. Works just fine in 1.0 and goes through both on a device (G1 with latest OTA update from T-Mobile) and the 1.0 emulator. Accelerator is a yes AVD option by default, so that should go through? Can anybody confirm this issue... is there a known workaround/ solution? --~--~-~--~~~---~--~~ 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 do i kill an android application
Yes, you can use System.exit(0) in your own app. I applied this myself for some time when I could not track down a bug in my app that ate memory by creating new threads without killing old ones upon app restart, and System.exit(0) then provided a temporary workaround to start fresh until I later found out that my problems indeed came from those threads piling up - visible in DDMS once you look for them, but I thought at the time that I was having memory problems due to my bitmaps or array variables still floating around after restart. On May 26, 4:16 pm, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... --~--~-~--~~~---~--~~ 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 onChildClickListener!!
Hi androids and people! I want to use ExpandedList in my app, and I need for catching clicks on child buttons. I'm trying use the code, written below, but it does nothing! Please, help me to slove this problem! this.list = (ExpandableListView) this.findViewById(android.R.id.list); this.list.setAdapter(listAdapter); this.list.setOnChildClickListener(new OnChildClickListener() { public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) { Toast.makeText(ContactList.this,adress, Toast.LENGTH_SHORT).show(); return false; } }); --~--~-~--~~~---~--~~ 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: detecting idle, off hook and ringing
I add : @Override public void onResume() { super.onResume(); telephone.listen (psl, android.telephony.PhoneStateListener.LISTEN_SERVICE_STATE); } @Override public void onDestroy() { telephone.listen (psl, android.telephony.PhoneStateListener.LISTEN_NONE); } but still ... i tried everything and compared parts of my program with solutions i found on this group and i don't understand why this doesn't work !!! Try LISTEN_CALL_STATE. LISTEN_SERVICE_STATE is whether or not you have a cell signal. LISTEN_CALL_STATE is whether or not there is a call going on. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 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] Re: how do i kill an android application
AFAIK, Process.killProcess(Process.myPid()) is equivalent to System.exit(0) in Android, but I stand corrected. On May 26, 4:41 pm, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? --~--~-~--~~~---~--~~ 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 show big images with full resolution
Hello, Robert, But I haven't found how to do that. I can create an empty BitmapDrawable(), then setBounds(Rect bounds), but How can I load the image after that, inside this bounds? Anyway, I think that setting Bounds do not limit what fragment from the original image will be load in memory, only what will be draw. 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] onKeyDown doesn't capture event
Hi, I have a proble with onKeyDown: my activity consists in a simple textView (as header) and a ListView below it, I need to go back to the previous screen when the user presses the back button. Thus, I implemented the onKeyDown method. Everything works fine if the list contains some elements, but when the list is empty the onKeyDown method is never called... Anyoene knows why? Thanks in advance Danilo --~--~-~--~~~---~--~~ 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] ImageMatrix has no effect when ImageView is in matrix scaling mode
I have an extension to ImageView that I would like to draw by manually altering the ImageMatrix. When I set the View's scaling type to matrix however, changing the matrix has no effect on the image. If I put it into a different mode, say center, changing the matrix does change the display, but in some the matrix gets reset to the proper value for center rather than what I want it to be, so I can't really use a different mode as a workaround. Here's the code that changes the matrix (the view implements OnGestureListener public boolean onDown(MotionEvent e) { Log.v(TAG, onDown); Matrix m = getImageMatrix(); Log.v(TAG, Initial matrix: + m.toString()); m.postScale(2.0f, 2.0f); setImageMatrix(m); Log.v(TAG, New matrix: + getImageMatrix().toString()); invalidate(); return true; } Here is what the log shows V/Gesture-Enabled Image View( 3110): onDown V/Gesture-Enabled Image View( 3110): Initial matrix: Matrix{[1.0, 0.0, 0.0][0.0, 1.0, 0.0][0.0, 0.0, 1.0]} V/Gesture-Enabled Image View( 3110): New matrix: Matrix{[2.0, 0.0, 0.0] [0.0, 2.0, 0.0][0.0, 0.0, 1.0]} V/Gesture-Enabled Image View( 3110): onSingleTapUp The display remains unchanged, though. How can I get the image to change with the matrix? --~--~-~--~~~---~--~~ 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: onKeyDown doesn't capture event
I have a proble with onKeyDown: my activity consists in a simple textView (as header) and a ListView below it, I need to go back to the previous screen when the user presses the back button. That should happen automatically, without implementing onKeyDown(). Thus, I implemented the onKeyDown method. Where? On the activity? On a subclass of one of the widgets? Everything works fine if the list contains some elements, but when the list is empty the onKeyDown method is never called... I would just get rid of it and allow Android to handle the back button, since Android's default behavior seems to be what you want. -- Mark Murphy (a Commons Guy) http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 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] Re: Widget bug, is there a work around?
How does this address the OP's issue? The invisible widget will still continue to receive updates and consume resources. Tom. 2009/5/26 AndroidApp zl25dre...@gmail.com This is what I am doing, it doesnt fix the problem but it mitigates it: Dont bother having a configure activity, remove that from the widget xml config file. This always add the widget to the screen without configuring it. Then onUpdate in your widget, start a service to perform update, in your service before you push out update, first check whether the widget you are updating has been initialized, if it has not been initialized, start the configure activity on the service On May 26, 9:49 am, Tom Gibara m...@tomgibara.com wrote: I don't have a workaround, but I can confirm that the widget I'm developing exhibits the same problem; it seems to get added to the AppWidgetHost, continues to receive updates, but is never displayed to the user. Tom. 2009/5/26 AndroidApp zl25dre...@gmail.com Bump, anyone? On May 22, 9:28 pm, zl25drexel zl25dre...@gmail.com wrote: Dear google guys, the widget framework (or the Home app) has a pretty bad bug: - install ApiDemo - long press screen/widget/ApiDemo - *CHANGE ORIENTATION* - then without changing orientation back, click ok to create the widget the widget will not show up, did some debugging it looks like the widget is added to the widget service but it's just not shown on the Home screen, so if a widget has a config activity and the user happens to change orientation during widget config time (very common if widget has text boxes), the widget will become a garbage that just take up resources until user uninstall the widget app. even worse, if the widget does heavy background service to update, it will be wasting time updating a widget that is not visible Does anyone know a work around? --~--~-~--~~~---~--~~ 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: Create Bitmap from BitmapDrawable?
The ColorFilter you apply to a BitmapDrawable isn't applied directly to the Bitmap, it's applied to the Paint used to render the Bitmap. To get an equivalent Bitmap: * Create a new Bitmap of the same width, height and Config * Create a Canvas over the new Bitmap * Call BitmapDrawable.draw(Canvas) The new Bitmap should now contain what you want. Tom 2009/5/26 guruk ilovesi...@gmail.com :) Hi Tom, indeed, look good, but it looks it does not include my manipulations I did on the Drawable Bitmap BitmapOrg = BitmapFactory.decodeResource (resources,R.drawable.mydaysminipic_td);//its a green icon on a transparent background BitmapDrawable bmd = new BitmapDrawable(BitmapOrg); // to BitmapDrawable bmd.setColorFilter(0x00ff,Mode.SRC_ATOP); //manipulating the Bitmapdrawable to make all nontransparent pixels Blue //when i just test the Drawable its fine !! updateViews.setImageViewBitmap(draws2[i + 10], bmd.getBitmap()); But bmd.getBitmap() just give me original (maybe underlying Bitmap).. but how to get the DrawAble I created? many Thanks... Greets Chris --~--~-~--~~~---~--~~ 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 do i kill an android application
i tried that out... ddms says that the process died... but when i long press the home button to see the running apps, i see mine as well... then y does ddms say that the process was killed??? Is it a bug that a dead process still gets displayed along with other running apps??? can any one temme y this is happening??? On Tue, May 26, 2009 at 8:35 PM, Mariano Kamp mariano.k...@gmail.comwrote: I never saw a need for that and don't know what would happen. Try it out. My guess would be, that you can kill the processes launched by your user id. On Tue, May 26, 2009 at 4:41 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? On Tue, May 26, 2009 at 7:51 PM, Mariano Kamp mariano.k...@gmail.comwrote: In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.comwrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water them. -- Regards, Sujay Frank Lloyd Wrighthttp://www.brainyquote.com/quotes/authors/f/frank_lloyd_wright.html - TV is chewing gum for the eyes. -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water 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] Re: how do i kill an android application
thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? On Tue, May 26, 2009 at 7:51 PM, Mariano Kamp mariano.k...@gmail.comwrote: In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.comwrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water them. -- Regards, Sujay Frank Lloyd Wrighthttp://www.brainyquote.com/quotes/authors/f/frank_lloyd_wright.html - TV is chewing gum for the eyes. --~--~-~--~~~---~--~~ 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: ScrollView Dynamically Adding Text to TextView...
Does anyone have an idea of what I may be doing wrong? --~--~-~--~~~---~--~~ 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 do i kill an android application
Longpress in home only shows the last accessed apps, not the currently running apps. -- Urs On Tue, May 26, 2009 at 5:13 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: i tried that out... ddms says that the process died... but when i long press the home button to see the running apps, i see mine as well... then y does ddms say that the process was killed??? Is it a bug that a dead process still gets displayed along with other running apps??? can any one temme y this is happening??? On Tue, May 26, 2009 at 8:35 PM, Mariano Kamp mariano.k...@gmail.com wrote: I never saw a need for that and don't know what would happen. Try it out. My guess would be, that you can kill the processes launched by your user id. On Tue, May 26, 2009 at 4:41 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? On Tue, May 26, 2009 at 7:51 PM, Mariano Kamp mariano.k...@gmail.com wrote: In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.com wrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberg - My fake plants died because I did not pretend to water them. -- Regards, Sujay Frank Lloyd Wright - TV is chewing gum for the eyes. -- Regards, Sujay Mitch Hedberg - My fake plants died because I did not pretend to water 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] Triangle strip problems
Hello, I'm having trouble with something that should be straightforward and was hoping someone who has been down this road could help. I'm simply drawing a 32 by 32 (float) vertex (3d but flat for testing) square surface by drawing it as 31 linked triangle strips. I'm linking them by four degenerate triangles at the end of each strip as follows: repeat last vertex of this row, first vertex of next row, repeat first vertex of next row, second vertex of next row. My examination of the numbers I'm feeding OpenGL don't reveal anything amiss. What happens is that some triangles don't draw; I am assuming they are invalid for some reason I can't see. This happens at any resolution 8 x 8 or larger, with a different pattern for each size. Apparently something is interfering with the drawing of certain triangles. I MIGHT have missed something poring over these numbers, but I don't think so. Does anyone have a clue? Could it be caused by using floats instead of fixed point? --~--~-~--~~~---~--~~ 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 do i kill an android application
I never saw a need for that and don't know what would happen. Try it out. My guess would be, that you can kill the processes launched by your user id. On Tue, May 26, 2009 at 4:41 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? On Tue, May 26, 2009 at 7:51 PM, Mariano Kamp mariano.k...@gmail.comwrote: In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.comwrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberghttp://www.brainyquote.com/quotes/authors/m/mitch_hedberg.html - My fake plants died because I did not pretend to water them. -- Regards, Sujay Frank Lloyd Wrighthttp://www.brainyquote.com/quotes/authors/f/frank_lloyd_wright.html - TV is chewing gum for the eyes. --~--~-~--~~~---~--~~ 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 do i kill an android application
You see the tasks of the most recent activities. If you select one and the attached app and process is still running it will be brought in the foreground, if not it will be started first and then brought into the foreground. That's what I meant with Don't worry about it. Android OS manages that. On Tue, May 26, 2009 at 5:35 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: hmm so wats the no of apps that are shown??? i get varyin no based on the currently runnin apps... not basd on recently used apps... On Tue, May 26, 2009 at 8:48 PM, Urs Grob grob@gmail.com wrote: Longpress in home only shows the last accessed apps, not the currently running apps. -- Urs On Tue, May 26, 2009 at 5:13 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: i tried that out... ddms says that the process died... but when i long press the home button to see the running apps, i see mine as well... then y does ddms say that the process was killed??? Is it a bug that a dead process still gets displayed along with other running apps??? can any one temme y this is happening??? On Tue, May 26, 2009 at 8:35 PM, Mariano Kamp mariano.k...@gmail.com wrote: I never saw a need for that and don't know what would happen. Try it out. My guess would be, that you can kill the processes launched by your user id. On Tue, May 26, 2009 at 4:41 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: thanks but if thats the case, why does the sdk provide Process.killProcess(Process.myPid())??? wat does android actually do when i call this method as above??? On Tue, May 26, 2009 at 7:51 PM, Mariano Kamp mariano.k...@gmail.com wrote: In short: Don't worry. A bit longer: Android manages the apps' states. The user keeps on doing things, launching tasks, firing intents etc. and when Android OS doesn't have enough memory left it kills of apps that are in memory, but don't seem that important anymore, e.g. because the UI is not visible anymore as the user navigated back to the home screen or to another app/activity. If you app is needed again Android OS will resurrect you app/activity. Just implement the proper call backs (onCreate/onResume/onPause etc.) and your good to go. On Tue, May 26, 2009 at 4:16 PM, Sujay Krishna Suresh sujay.coold...@gmail.com wrote: Say i wanna do something like java's System.exit(0)... jus to make sure that my application is not running anymore... I wanna kill my own app... not other apps... this should be possible... On Tue, May 26, 2009 at 7:38 PM, Marco Nelissen marc...@android.com wrote: On Tue, May 26, 2009 at 6:56 AM, Saurav Mukherjee to.saurav.mukher...@gmail.com wrote: how do i kill an android application Why would you want to do that? -- Regards, Sujay Mitch Hedberg - My fake plants died because I did not pretend to water them. -- Regards, Sujay Frank Lloyd Wright - TV is chewing gum for the eyes. -- Regards, Sujay Mitch Hedberg - My fake plants died because I did not pretend to water them. -- Regards, Sujay Bette Davis http://www.brainyquote.com/quotes/authors/b/bette_davis.html - Brought up to respect the conventions, love had to end in marriage. I'm afraid it did. --~--~-~--~~~---~--~~ 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: Widget bug, is there a work around?
This is what I am doing, it doesnt fix the problem but it mitigates it: Dont bother having a configure activity, remove that from the widget xml config file. This always add the widget to the screen without configuring it. Then onUpdate in your widget, start a service to perform update, in your service before you push out update, first check whether the widget you are updating has been initialized, if it has not been initialized, start the configure activity on the service On May 26, 9:49 am, Tom Gibara m...@tomgibara.com wrote: I don't have a workaround, but I can confirm that the widget I'm developing exhibits the same problem; it seems to get added to the AppWidgetHost, continues to receive updates, but is never displayed to the user. Tom. 2009/5/26 AndroidApp zl25dre...@gmail.com Bump, anyone? On May 22, 9:28 pm, zl25drexel zl25dre...@gmail.com wrote: Dear google guys, the widget framework (or the Home app) has a pretty bad bug: - install ApiDemo - long press screen/widget/ApiDemo - *CHANGE ORIENTATION* - then without changing orientation back, click ok to create the widget the widget will not show up, did some debugging it looks like the widget is added to the widget service but it's just not shown on the Home screen, so if a widget has a config activity and the user happens to change orientation during widget config time (very common if widget has text boxes), the widget will become a garbage that just take up resources until user uninstall the widget app. even worse, if the widget does heavy background service to update, it will be wasting time updating a widget that is not visible Does anyone know a work around? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: problems importing existing project into eclipse
Has nobody else come across this problem? no ideas? On May 26, 9:15 am, schwiz sch...@gmail.com wrote: I used fileimportgeneralexisting projects into workspace I am trying to run the widget example from the dev blog but when I import the project I get an error Description Resource Path Location Type Syntax error, annotations are only available if source level is 1.5 WordWidget.java SimpleWiktionary/src/com/example/android/ simplewiktionary line 44 Java Problem I select propertiesandroid and make sure the project build target is 1.5 but that doesnt fix anything I am also getting this error in my console [2009-05-26 09:02:27 - spore-android] Android requires .class compatibility set to 5.0. Please fix project properties. this is also happening with a widget I was working on and needed to re- import. I sure hope someone can help me!!! thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Progress bar update help
Would your suggestion actually work? I'm not convinced it's that simple. You still wouldn't see the progress bar appear on the screen, much less update smoothly on demand, because you would be constantly tying up the UI thread. I think you need to create the progress bar on the main UI thread, set up its max, init its val to 0, then make a separate thread that reads the file and occasionally sets the progress bar's progress to a new val (you can do that from a nonUI thread apparently, works for me). On May 26, 5:48 am, MrChaz mrchazmob...@googlemail.com wrote: You can ask a URLConnection for the content length and then read from the content stream in chunks. You can display your progress by setting the max to the content length and then incrementing the progress by your read chunk size. On May 26, 1:21 pm, Sukitha Udugamasooriya suk...@gmail.com wrote: Hi, I m implementing a small app which downloads files (avg 1MB files- takes 5 seconds to download). -- I want to show the progress using a ProgressBar. --The user can pause the download if he desires. How can I show the progress? (How can I know the amount that has downloaded at a given moment?) Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: detecting idle, off hook and ringing
I add : @Override public void onResume() { super.onResume(); telephone.listen (psl, android.telephony.PhoneStateListener.LISTEN_SERVICE_STATE); } @Override public void onDestroy() { telephone.listen (psl, android.telephony.PhoneStateListener.LISTEN_NONE); } but still ... i tried everything and compared parts of my program with solutions i found on this group and i don't understand why this doesn't work !!! On May 26, 3:41 pm, Mark Murphy mmur...@commonsware.com wrote: As Bnet above, i'm trying to write a program whichs detects the different states of the phone and mke a different noise in each case. There is a problem that i really don't understand! Please someone can take a look at it and try to explain to ma what's wrong ? 1. You have created a PhoneStateListener and then have done nothing with it. Please look at TelephonyManager#listen() in the documentation. 2. You are not cleaning up the MediaPlayer objects you are creating, which might be bad. 3. You are not unregistering your PhoneStateListener when your activity closes (e.g., in onDestroy()). There may be other issues -- those three come to mind for me. -- Mark Murphy (a Commons Guy)http://commonsware.com _The Busy Coder's Guide to Android Development_ Version 2.0 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] Re: How to realize cascading delete in sqlite?
I've never used cascading deletes myself, but I have used triggers, and they work. On Tue, May 26, 2009 at 12:07 AM, quill quill...@163.com wrote: Hi guys, Can cascading delete be realized in sqlite? If can, how to realize it? 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] Drawable cannot draw into Canvas
I want to load an icon from resource and draw over it. But I cannot get it into a canvas. Can anyone please help me with the code below. If I uncomment c.drawColor(), I get blue color as expected. So the problem is on icon.draw(). Drawable icon = getResources().getDrawable(R.drawable.icon2); Bitmap bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth(), icon.getIntrinsicHeight(), Bitmap.Config.ARGB_); Canvas c = new Canvas(bitmap); icon.draw(c); //c.drawColor(Color.BLUE); ImageView iv = (ImageView)findViewById(R.id.icon); iv.setImageBitmap(bitmap); Thanks, Jay --~--~-~--~~~---~--~~ 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: Create Bitmap from BitmapDrawable?
Hi Tom, thanks for your help do you mean something like that: (till now i did not worked) Bitmap ob = BitmapFactory.decodeResource (resources,R.drawable.mydaysminipic_td); Bitmap obm = Bitmap.createScaledBitmap(ob, 18, 18,false); Canvas canvas = new Canvas(obm); BitmapDrawable bmd = new BitmapDrawable(canvas); bmd.setColorFilter(0xff00,Mode.SRC_ATOP); bmd.draw(canvas); Bitmap newbit; newbit=bmd.getBitmap(); Really I came crazy with that. Finaly I just need the Solution for: I have a Drawable and I like that all set pixels in it get another Color and finaly to update my widget ... for that I have to options: updateViews.setImageViewBitmap(draws2[i + 10], newbit); //thats what I try now with above code or i make it simple: (but i miss a link) -- Drawable dx = resources.getDrawable(R.drawable.mydaysminipic_ov); dx.setColorFilter(0xff00ff00, Mode.SRC_ATOP); updateViews.setImageViewResource(draws2[i + 10], R.drawable.mydaysminipic_pe); -- but that does not work, because WHAT is the ID (int) of my created dx?? Any Ideas to solve that. would be really great Thanks Chris --~--~-~--~~~---~--~~ 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: Vertical and Horizontal scroller for EditText
Guys, Can someone help me as to how I can add a scroll bar (horizontal and vertical) to an edit text? Please help me out, I need to do it through java code and not through xml Regards, R.Karthik On May 25, 9:35 pm, karthikr karthik.scintill...@gmail.com wrote: Hi Guys, Can someone heklp me as to how I can add a horizontal and vertical scrollbar for an EditText? I need it to be done through java code and not through xml. Regards, R.Karthik --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: problems importing existing project into eclipse
Did you try right clicking on the project in the Project Explorer and selecting Android Tools/Fix Project Properties? On May 26, 9:43 am, schwiz sch...@gmail.com wrote: Has nobody else come across this problem? no ideas? On May 26, 9:15 am, schwiz sch...@gmail.com wrote: I used fileimportgeneralexisting projects into workspace I am trying to run the widget example from the dev blog but when I import the project I get an error Description Resource Path Location Type Syntax error, annotations are only available if source level is 1.5 WordWidget.java SimpleWiktionary/src/com/example/android/ simplewiktionary line 44 Java Problem I select propertiesandroid and make sure the project build target is 1.5 but that doesnt fix anything I am also getting this error in my console [2009-05-26 09:02:27 - spore-android] Android requires .class compatibility set to 5.0. Please fix project properties. this is also happening with a widget I was working on and needed to re- import. I sure hope someone can help me!!! thanks.- 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 -~--~~~~--~~--~--~---