Re: [android-developers] Re: Problem optimizing views for having a fast scroll
...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem optimizing views for having a fast scroll
On 3 July 2012 13:40, Mark Murphy mmur...@commonsware.com wrote: On Tue, Jul 3, 2012 at 8:37 AM, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: See Mark's comment. If you can get away with one View. If however each of those times is clickable, then just set max number of TextViews in each list element, as simply removing unused ones by calling setVisibility(INVISIBLE) on each one. Or, conceivably, use a URLSpan for the clickable ones. Indeed! - much better choice and View hierarchy becomes much smaller, which is what performance needs. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.7 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem optimizing views for having a fast scroll
Groups Android Developers group. To post to this group, send email to android-developers@** googlegroups.com android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Need help - hidden GPS monitoring app
Mihai, It is possible to achieve what you need to a degree. What I mean is: if I knew that the phone I am carrying is a snooping device, I would switch the thing off. No app will be able to connect to the mothership when the whole platform is down. Completely agree with Kristopher: what you are asking for cannot be done in the user application layer, but closer to the metal, i.e. in the system. Your phones would have to have custom build OS with the functionality you desire. But here are available car tracking devices on the market and they seem like much better solution to your problem. On 29 June 2012 16:13, Mihai Popescu mihai.m.pope...@gmail.com wrote: Hi, Your answer does not sattisfy me :) Perhaps I din't provide enough information. 1. I can program, I can learn, but I first need to know if what I want is possible 2. I am a toal Android n00b, so I need number 1 answered first 3. the application is intended to be used for employee tracking throughout the country (not making personal trips with the company's cars and wasting fuel, or doing illegal activities) 4. My application will not have a GUI and it will just send some unique hardware code (maybe motherboard SN or phone card SIM number/serial number) and its GPS coordinates to some hardcoded server once every 10 minutes. Maybe it will also update the interval in which it sends GPS updates according to some information acquired from the server once every 5 minutes, in order to control server load and mobile operator costs. After some research, I realised that maybe it will not really be an application, but a service. Still, I need to know the following: - Is it possible to hide the app/service from the average user? I have no idea yet how Android works, so I assume that hiding it from the application manager should be enough. - wether if it will be an application or a service, If I can't hide it completely from the user, can I password protect it from being manually shutdown? - how can I make it start automatically on phone power-on? Can I make sure the user doesn't manually change its auto-startup settings? - how can I make my app keep the preconfigured GPRS/3G connection alive but in standby ? (Or open it if turned off and send its GPS coordinates?) Thank you! On Friday, June 29, 2012 11:24:46 AM UTC+3, Terry wrote: I don't think it can be done! Terry kl. 12:03:08 UTC+2 onsdag 27. juni 2012 skrev Mihai Popescu følgende: Hello, I am rather new to Android, and I need some information and opinions. I intend to develop an application which would run on some Android phone, seeminglessly in the background, and send periodic messages to a server, regarding its current position (GPS coordinates). The most important aspect here would be that: - the application is intented to be preinstalled on a bunch of phones, before they will be used by a specific group of people. - the user must not be able to stop/kill the application without some kind of password - the user must not be able tu turn off his GPRS/3G internet connection. I am aware that there are some security restrictions for developing such an app, but still my question is wether or not it would be possible to do it. I assume that if not, the next best thing would be to customize the Android OS with these changes, and deploy it on the set of phones :D -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Question about this group itself
http://superuser.com/questions/84951/thunderbird-3-via-gmail-imap-to-google-groups-sent-items-do-not-show-up On 28 June 2012 16:16, Raghav Sood raghavs...@gmail.com wrote: This is the default behavior for all of the Google Groups. Your own messages will not be sent to your inbox, unless you receive a reply, in which case a thread will be created. You can add messages to your thread without having received a reply by going to sent mail and replying to it. Thanks On Thu, Jun 28, 2012 at 8:38 PM, Francisco M. Marzoa Alonso fmmar...@gmail.com wrote: Hi, Well, my problem is that I do not see my own posts on this group through my Thunderbird mail client since I subscribed to it. I know they reaches the group because I receive the answers, and also they are visible through web G. groups interface. But they seem not to reach my Inbox. I do not know if it is a problem of Thunderbird, the GMail account I use to subscribe to the group, or some configuration related to the group subscription itself. I do not discard no option, although if I send a message to myself with that gmail account, it reaches my Inbox with no problems, so I think that the group subscription setting is the most plausible cause. If someone has a clue on how to solve this... Thanks a lot 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 -- Raghav Sood Please do not email private questions to me as I do not have time to answer them. Instead, post them to public forums where others and I can answer and benefit from them. http://www.appaholics.in/ - Founder http://www.apress.com/9781430239451 - Author +91 81 303 77248 -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Is Java 7 ok to use now?
On 22 June 2012 15:17, Chrystian Vieyra chrys.vie...@gmail.com wrote: I have been using Java 7 for the past few months and so far I have not had any issues. Do you mean that you have not had any issues as long as compiler compliance is set to 1.6 or 1.5 ? On Thursday, June 21, 2012 12:54:14 PM UTC-5, Spooky wrote: Last I heard, Java 7 and the SDK weren't getting along with each other very well (if at all). Is this still the case? Or is Java 7 ok now? Thanks, --jim -- THE SCORE: ME: 2 CANCER: 0 73 DE N5IAL (/4) | Tux (E Cat): DS B+Wd Y 6 Y L+++ W+ C++/C++ I+++ spooky1...@gmail.com | T++ A E H+ S V- F++ Q+++ P/P+ B++ PA+ PL SC--- Running Mac OS X Lion | ICBM / Hurricane: | Tiggerbelle: DS W+S+Bts % 1.5 X L W C+++/C+ 30.44406N 86.59909W | I+++ T A E++ H S++ V+++ Q+++ P B++ PA++ PL+ SC Android Apps Listing at http://www.jstrack.org/barcodes.html -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] sound play
Use Twilio: http://www.twilio.com/ -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] sound play
On 20 June 2012 15:47, Aashish jawla aashishja...@gmail.com wrote: i think it is not sutable for my application i wanna control the sound stream of the user means i wanaa play some pre-recorded audio in active call so that caller hear it is it possible Daniel or not??? It is not possible through Android SDK. In Android you can control the state of the call, but not the call itself. With something like Twilio (Aculab, http://cloud.aculab.com), you could play whatever audio file you want to the wire, on which the call is taking place. In other words you would have access to that audiostream. On Wed, Jun 20, 2012 at 7:57 PM, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: Use Twilio: http://www.twilio.com/ -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- - Thanks Regards Er.Aashish Kumar Jawla (09555865084/09910783591) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Java 1.7
It probably won't be supported soon for multitude of reasons. Simply set compiler compliance to 1.6 in Eclipse and live without funky Java 7 features. I know, it is not, what you asked for, but features of Java 7 are a bit more than the nice way of representing numerals. Have a look here: http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html ... that's quite a lot to port to Dalvik (even when only looking at HotSpot and language changes). Bear in mind that many new things in Java7 are possible specifically because the platforms that Java7 addresses have different (much more relaxed) constraints compared even to 4 core 1GB RAM mobile device. For example InvokeDynamic allows JVM to run trully dynamic languages, which are high productivity and all that, but cost in terms of processing and memory. Technicalities aside, remember that Google and Oracle only finished one big lawsuit. I don't think big G would like to have another one on their hands just yet. Daniel On 13 June 2012 15:06, bob b...@coolfone.comze.com wrote: I'm trying to use this notation in my code: int x = 5_000_000; So, I need Java 1.7. However, I get this error: [2012-06-13 09:01:43 - wall] Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools Fix Project Properties. Any thoughts on this? Will 1.7 probably be supported soon? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: instance count violation
On 7 June 2012 15:06, Kostya Vasilyev kmans...@gmail.com wrote: I remember seeing this in one of my apps in certain cases. My conclusion was that this might be a bug in strict mode code, and disabled it. Activity orientation changes are processed within a single message loop heartbeat, so it's entirely possible that the lifecycles of both activity instances overlap. +1 Setting launchMode to 'singleInstance' can solve this 'issue', as it will force each (re)created activity to launch in a separate task. However the wider issue to consider is that StrictMode.ThreadPolicy.Builder.detectAll() detects *potential* problems. The fact that once GCed the activity dissapears, means that it will get eventually cleared and is not a leak. Daniel 2012/6/7 marcin kolonko makolo...@gmail.com ok, i did some memory digging with ddms and memory analizer. and there' s weird behavior: when i run the garbage collector while in portrait mode (still the same case us in first post) and come back to portrait mode, nothing bad happens. the app behaves as it should. when i don't run the garbage collector, the app crashes with the instance count violation error. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Create an object class but error
oh dear, i suggest learning java first. D. On Thursday, 24 May 2012, HK Tsang hktsan...@gmail.com wrote: I've passed the code when I add player = new MyPlayer() in onCreate. but next step, I change it to array: MyPlayer[] players; . . . . onCreate players = new MyPlayer[4]; then it also NPE. why it pass when I use single player but use array do not pass? == full code in main activity package hktsang56.android.mjhelper; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class name_input extends Activity { final static int NUM_PLAYER = 4; private MyPlayer[] players; MyPlayer player; MarkSetting markSetting; private EditText[] namesET; Button bt[]; private TextView tv; int[] names = new int[]{ R.id.et_p1, R.id.et_p2, R.id.et_p3, R.id.et_p4 }; int[] btIds = new int[]{ R.id.but_sendName, R.id.but_clearName }; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.player_input); players = new MyPlayer[NUM_PLAYER]; namesET = new EditText[NUM_PLAYER]; bt = new Button[btIds.length]; player = new MyPlayer(); tv = (TextView) findViewById(R.id.tv_monitor); tv.setText(onCreate); initButIds(); } private void initButIds(){ for (int i=0; ibtIds.length; i++){ bt[i] = (Button) findViewById(btIds[i]); bt[i].setOnClickListener(myClickListener); tv.setText(initButIds); } } private View.OnClickListener myClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub tv.setText(onClick); but_click(v.getId()); } }; public void but_click(int btId){ switch (btId){ case R.id.but_sendName: tv.setText(but_click); setName(); break; case R.id.but_clearName: clearName(); break; } } private void setName() { // TODO Auto-generated method stub String name=Null; for (int i=0; iNUM_PLAYER; i++){ namesET[i] = (EditText) findViewById(names[i]); } for (int i=0; iNUM_PLAYER; i++){ name = namesET[i].getText().toString().trim(); players[i].setPlayerName(name); // remark: player.setPlayerName(name); can be run. } tv.setText(players[2].getPlayerName()); } private void clearName() { // TODO Auto-generated method stub for (int i=0; iNUM_PLAYER; i++){ namesET[i].setText(); } } } On Wed, May 23, 2012 at 6:29 PM, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: Jason name == null would not cause NPE, as it is simple assignment to a member variable in MyPlayer class. If there was anything else within setName() that caused NPE, we could see it on the top of the stacktrace. The cause is that *player* reference in *player_input.setName()* is null. The way player object is being constructed is wrong: (player = new Player;) This code should not compile, so it begs the question, how did the OP manage to run it. There are many other issues with this code from the first look, like naming conventions, and auto generated comments dotting it, just to name the few. Daniel On 23 May 2012 10:56, Jason Teagle teagle.ja...@gmail.com wrote: I've create an object class but it cannot work. any mistake of my code? private void setName() { // TODO Auto-generated method stub getNameText(); for (int i=0; iNUM_PLAYER; i++){ player.setPlayerName(name); // name is a String get from EditText by some code before } } when I run the programme, it have the following error code: 05-23 09:24:35.115: E/AndroidRuntime(438): java.lang.NullPointerException 05-23 09:24:35.115: E/AndroidRuntime(438): at hktsang56.android.mjhelper .name_input.setName(name_input.java:81) Which of the lines in your source code is line 81? Is it the line that says getNameText()? We need to see that method's definition, if that is the case, since I can't see any other problem (if 'name' were coming out null, then the error would be in setPlayerName() rather than in setName() - in fact it probably wouldn't generate an error in such a case). Show us the code for getNameText(). You are possibly trying to access a control that you have not filled out correctly. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Create an object class but error
HK, I am sorry you feel this way - and don't worry, you have not disturbed me. I think that you would be much better off, learning Java first, outside of Android or any other platform. Simply start some tutorial, going through nuances of Java. Problems you are having are very easy to fix, once you know some basics. The further you go down the Android + Java route as a complete newbie, the more frustrated you will become trying to understand cryptic errors (some resulting from misuse of Java, some from the platform). Daniel On 24 May 2012 07:59, HK Tsang hktsan...@gmail.com wrote: Yes you are right. Acturally I'm learning both together right now. I just can learn it by my-self and find some exsample to study on web. No one can teach me arround me. Therefore I just can ask something that I don't understand in here. I know that my knowledge is too a little. But I hope someone can solve me the problems that I can't understand. If you feel my question is too stupid. I'm sorry for disturbing you. On Thu, May 24, 2012 at 2:07 PM, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: oh dear, i suggest learning java first. D. On Thursday, 24 May 2012, HK Tsang hktsan...@gmail.com wrote: I've passed the code when I add player = new MyPlayer() in onCreate. but next step, I change it to array: MyPlayer[] players; . . . . onCreate players = new MyPlayer[4]; then it also NPE. why it pass when I use single player but use array do not pass? == full code in main activity package hktsang56.android.mjhelper; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class name_input extends Activity { final static int NUM_PLAYER = 4; private MyPlayer[] players; MyPlayer player; MarkSetting markSetting; private EditText[] namesET; Button bt[]; private TextView tv; int[] names = new int[]{ R.id.et_p1, R.id.et_p2, R.id.et_p3, R.id.et_p4 }; int[] btIds = new int[]{ R.id.but_sendName, R.id.but_clearName }; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.player_input); players = new MyPlayer[NUM_PLAYER]; namesET = new EditText[NUM_PLAYER]; bt = new Button[btIds.length]; player = new MyPlayer(); tv = (TextView) findViewById(R.id.tv_monitor); tv.setText(onCreate); initButIds(); } private void initButIds(){ for (int i=0; ibtIds.length; i++){ bt[i] = (Button) findViewById(btIds[i]); bt[i].setOnClickListener(myClickListener); tv.setText(initButIds); } } private View.OnClickListener myClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub tv.setText(onClick); but_click(v.getId()); } }; public void but_click(int btId){ switch (btId){ case R.id.but_sendName: tv.setText(but_click); setName(); break; case R.id.but_clearName: clearName(); break; } } private void setName() { // TODO Auto-generated method stub String name=Null; for (int i=0; iNUM_PLAYER; i++){ namesET[i] = (EditText) findViewById(names[i]); } for (int i=0; iNUM_PLAYER; i++){ name = namesET[i].getText().toString().trim(); players[i].setPlayerName(name); // remark: player.setPlayerName(name); can be run. } tv.setText(players[2].getPlayerName()); } private void clearName() { // TODO Auto-generated method stub for (int i=0; iNUM_PLAYER; i++){ namesET[i].setText(); } } } On Wed, May 23, 2012 at 6:29 PM, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: Jason name == null would not cause NPE, as it is simple assignment to a member variable in MyPlayer class. If there was anything else within setName() that caused NPE, we could see it on the top of the stacktrace. The cause is that *player* reference in *player_input.setName()* is null. The way player object is being constructed is wrong: (player = new Player;) This code should not compile, so it begs the question, how did the OP manage to run it. There are many other issues with this code from the first look, like naming conventions, and auto generated comments dotting it, just to name the few. Daniel On 23 May 2012 10:56, Jason Teagle teagle.ja...@gmail.com wrote: I've create an object class but it cannot work. any mistake of my code? private void setName() { // TODO Auto-generated method stub getNameText(); for (int i=0
Re: [android-developers] Create an object class but error
Jason name == null would not cause NPE, as it is simple assignment to a member variable in MyPlayer class. If there was anything else within setName() that caused NPE, we could see it on the top of the stacktrace. The cause is that *player* reference in *player_input.setName()* is null. The way player object is being constructed is wrong: (player = new Player;) This code should not compile, so it begs the question, how did the OP manage to run it. There are many other issues with this code from the first look, like naming conventions, and auto generated comments dotting it, just to name the few. Daniel On 23 May 2012 10:56, Jason Teagle teagle.ja...@gmail.com wrote: I've create an object class but it cannot work. any mistake of my code? private void setName() { // TODO Auto-generated method stub getNameText(); for (int i=0; iNUM_PLAYER; i++){ player.setPlayerName(name); // name is a String get from EditText by some code before } } when I run the programme, it have the following error code: 05-23 09:24:35.115: E/AndroidRuntime(438): java.lang.NullPointerException 05-23 09:24:35.115: E/AndroidRuntime(438): at hktsang56.android.mjhelper .name_input.setName(name_input.java:81) Which of the lines in your source code is line 81? Is it the line that says getNameText()? We need to see that method's definition, if that is the case, since I can't see any other problem (if 'name' were coming out null, then the error would be in setPlayerName() rather than in setName() - in fact it probably wouldn't generate an error in such a case). Show us the code for getNameText(). You are possibly trying to access a control that you have not filled out correctly. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] It is possible to add IOS Style rear Shadows into Android ImageViews?
http://stackoverflow.com/questions/3693234/custom-imageview-with-drop-shadow On 22 May 2012 10:12, saex elpablos...@gmail.com wrote: Hi I'm trying to add these kind of IOS shadows in the back of a imageview on Android: [image: enter image description here] I mean the rear shadow in the back of each square. Imagine that each square is an Android IMAGEVIEW, how can i add this shadow in Android? 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Error in Base IceCream Sandwitch Android code.
Shruthi, 1. This is wrong forum. 2. It is questionable, whether your expected behaviour is the correct one. If it were correct, it would present a backdoor to secured phone. Security that can be subverted is not a security. On 17 May 2012 10:24, Shruthi Varma shruthi.tlis...@gmail.com wrote: Hi All, There is a bug in Base IceCream Sandwitch Android code because I encountered a problem in Google Nexus phone having Android 4.0 (Ice Cream Sandwich). [Steps] 1. Set up a Gmail account in an Android device. 2. Set up a Security lock, may be a Pin/ pattern Screen Lock in Setting - Security and lock the phone (by pressing power button). 3. Phone screen is locked with PIN/ Pattern. Enter wrong PIN/ Pattern 5 times and phone displays Forgot PIN?. 4. Press Forgot PIN, enter correct gmail account and password, then press Sign in, phone is checking i.e a ProgressDialog box appears displaying checking on the screen. 5. Give a call to this device from any other device during this time when the deice is checking the Gmail credentials. We can see the incoming call Screen in the background of the ProgressDialog as seen in the screenshot attached. Hence the user cannot answer the call till it finishes checking and dismiss the dialog box. Hence, we cannot answer the incoming call during checking gmail account when user forgot PIN code. The code to this dialog box is in android base ICS - (frameworks/base/policy/src/com/android/internal/policy/impl/AccountUnlockScreen.java). You can access this code here. (Please a take a look at getProgressDialog() method in here. The progressDialog is hidden after getting the results or in cleanUp() method.) Please help me fixing this issue. Thanks and Regards, Shruthi. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Banned For title Of App(hungry Hippo's)
http://en.wikipedia.org/wiki/Hungry_Hungry_Hippos On 16 May 2012 15:27, Harri Smått har...@gmail.com wrote: On May 16, 2012, at 5:14 PM, Troy Walker wrote: Also, if i create another dev account, complete change the name of the app, and dont link it to my other banned account, do you guys think i will be fine? Based on your story, if it was for title only, I find it very weird if you weren't able to receive an answer from Google Play team asking why your account was suspended. If there was a trademark infringement , Google Play support pages state that In appropriate circumstances, Google will terminate repeat trademark infringers. So ummm.. If I were you I waited a few days and contacted Play support again if there wasn't any answer. -- H -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Banned For title Of App(hungry Hippo's)
Give it a try... Obviously I don't know, what in your game breached copyrights of the original. If it is just the title, then you should be OK (unless Google marks not only account but also you with a black mark). However if your game is about well Hungry Hippos and characters resemble the original or the story resembles the narrative of the game, I think it will be only matter of time, before the copyright holder will contact Google again. On 16 May 2012 15:49, Troy Walker twalkerj...@gmail.com wrote: I am aware of this, and i believe its the reason i was banned. I am wondering if i create a new account and rename my game COMPLETELY and change my developer name will i be fine, and not linking it to my banned account. What do you guys think? Also its been about 2 months since ive been banned and still no reply from google. On Wednesday, May 16, 2012 10:31:53 AM UTC-4, Daniel Drozdzewski wrote: http://en.wikipedia.org/wiki/Hungry_Hungry_Hippos On 16 May 2012 15:27, Harri Smått har...@gmail.com wrote: On May 16, 2012, at 5:14 PM, Troy Walker wrote: Also, if i create another dev account, complete change the name of the app, and dont link it to my other banned account, do you guys think i will be fine? Based on your story, if it was for title only, I find it very weird if you weren't able to receive an answer from Google Play team asking why your account was suspended. If there was a trademark infringement , Google Play support pages state that In appropriate circumstances, Google will terminate repeat trademark infringers. So ummm.. If I were you I waited a few days and contacted Play support again if there wasn't any answer. -- H -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Don't mix Eclipse and Ant
Jacob, Don't use tools that modify the project pulling rugs from underneath Eclipse's feet. As an IDE it has specific stages to package and build each project and it needs to hook into those, so that it understands, what has happened and what is to happen. You can either use a tool chain that is Eclipse free (disjoint source editor + ant to build) or make use of Eclipse's ability to build using Ant: http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-93_project_builder.htm http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-80_ant.htm Daniel On 11 May 2012 09:58, Jacob Abrams satur9n...@gmail.com wrote: Sorry for this rant, but I have a number of complaints with the Android build system I'd like to air. Firstly thank you Android build system engineers for adding incremental building to the build system, this is a hard problem and your work here is appreciated. Now on to the major issue I just spent the evening debugging: When you combine eclipse with the command line Ant build you may get runtime errors in your APK! If you are using eclipse and it can't build one of your library projects because the java source has compilation errors Eclipse will go ahead and make class files anyway! The methods in these class files will be filled with junk like: throw new Error(Unresolved compilation problem: \n); If you then go ahead and build the same project with Ant in the commandline, the new incremental checks in the Android Ant build script will see that it is already been compiled, skip that step and use these class files in the generated APK. Resulting in runtime errors. Jacob Abrams -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Parcelable encountered IOException writing serializable object - Object serializable with array of another serializable
, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Google lost vs Oracle.
You mean that Oracle won on the front that does not matter at all and carries no weight. http://www.groklaw.net/article.php?story=20120507122749740 Daniel On 8 May 2012 13:52, sblantipodi perini.dav...@dpsoftware.org wrote: As title. I think that we need to start learning C# to develop on Android. Do you think that android will continue using java in the future? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Singletons in Android .... Final solution?
On 4 May 2012 01:24, 0xcafef...@gmail.com 0xcafef...@gmail.com wrote: public class TheClass extends Guigui { ... /*#! Singleton */ static { if (m_instance == null) { try { m_instance = new TheClass(); } catch (Throwable e) { throw new RuntimeException(e.getMessage()); } } } ... } What if the constructor could throw a genuine exception (say file not found) or you wanted to supply some non-static arguments to it? -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Singletons in Android .... Final solution?
On 4 May 2012 14:45, Adriano B. Godinho adri...@godinho.eng.br wrote: You can instantiate your singleton instance in a static method: class C{ private static C mInstance = null; public static C getInstance() throws YourException { if (mInstance == null ) { mInstance = new C(); //it throws YourException } return mInstance; } } ...which changes the original code from eager initialisation to lazy initialisation (not a bad thing per se and optimisation is some circumstances), but it remains not thread safe. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Problem with Location.getTime API
API docs say that Location.time() returns UTC time of a *fix*, so it's not even a current time ... ...but it doesn't matter, since you create GregorianCallendar in UTC time zone anyway, so what exactly did you expect? Try using TimeZone.getDefault() instead. On 3 May 2012 11:57, Bunty syed itsmeatfo...@gmail.com wrote: Hi, I changed the time date of the device.. Then i launched an app which reads time date using location.getTime Api as follows--- long time =loc.getTime(); GregorianCalendar gcal = new GregorianCalendar(TimeZone.getTimeZone(UTC)); gcal.setTimeInMillis(time); Log.i(Ashiq, day==+gcal.get(GregorianCalendar.DAY_OF_MONTH)); Log.i(, month==+gcal.get(GregorianCalendar.MONTH)); Log.i(, yearc==+gcal.get(GregorianCalendar.YEAR)); Log.i(, hrs==+gcal.get(GregorianCalendar.HOUR)); Log.i(, minsc==+gcal.get(GregorianCalendar.MINUTE)); But above API returns me time date as per the device time.. Actually it should return the correct time(sataellite or cell tower based) independent of the device time date. Thanks Regards, Ashiq Sayyad -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Singletons in Android .... Final solution?
On 3 May 2012 15:50, blake blake.me...@gmail.com wrote: I'd say that the guy at devahead observed some behavior and lept to some weird conclusions. ClassLoaders are just what they sound like. There can be two different instances of a class object (right: not instances of the class, instances of the class object) in two different class loaders. The states of those two instance are unrelated and can be quite different. Blake, Good point! I would like to point out aditional peculiarity: Class loaders are organised in parent - children hierarchies (trees) with the boot classloader at the root. It is an important contract placed upon ClassLoader and one that is possible to break. Breaking this contract makes it possible to have two objects created from the same class file (i.e. implementing the same Class) but each class loaded by a different classloader. Now if at least one of these classloaders did not delegate the loading to its parent, it is posible to have object1.class != obejct2.class evalueate to TRUE. You are also mentioning singleton across different executions. There is also a case of singleton across serialize - deserialize cycle. When the singleton happens to implement Serializeable, then it is possible to have more than 1 of them within the same JVM, but there are tricks... http://stackoverflow.com/questions/70689/efficient-way-to-implement-singleton-pattern-in-java Marry that with Android app/thread/activity lifecycles, and it is easy to come to wrong conclusions based on not exhaustive observations. Daniel The whole concept of a singleton requires definition. The singleton on your computer is clearly not the same as the one on mine. A singleton in the instance of a single application you ran 10 months ago is probably not the same as the one in the instance you are running right now. It's true, the singletons created using class members in classes loaded by different class loaders are different. Blake Meike Marakana The second edition of Programming Android is now on line! http://shop.oreilly.com/product/0636920023005.do -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Dalvikvm crashes with LinearAlloc exceeded capacity when running unit tests on emulator 1.6
Lorie, It is likely that this LinearAlloc capacity differs per Android version. Your test project clearly exceeds it for Androids prior to 2.1 and from 2.1 onwards it must be within new, bigger boundaries. As for it breaking after adding more tests, it is possible, that the total weight of various elements of your object graph exceeds the total amount allowed by LinearAlloc. Have a look here: http://www.gitorious.org/android-on-freerunner/platform_dalvik/blobs/master/vm/LinearAlloc.c First paragraph in the overview states that this file is responsible for memory management tied to a classloader. It is possible that the library which you are using is not cleaning up after itself or is unnecessarily promiscuous with the depth of object hierarchies or with the sheer number of objects. If you have chance to try alternative library, please do. If not, maybe splitting your unit tests between different classes could help. HTH, Daniel On 2 May 2012 14:04, Lorie Pisicchio lorie.pisicc...@gmail.com wrote: I have read this post, but it didn't give me a clue. Mark Renouf suggests to use libraries that are less complex, but my test project started to fail when adding some new unit tests (not making the library more complex..) Moreover, the dalvikvm limitation that is mentioned is for version 2.3, but my tests run fine, starting with 2.1... Anyway, thanx for your help! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Dalvikvm crashes with LinearAlloc exceeded capacity when running unit tests on emulator 1.6
Lorie, You should have mentioned that you are trying to run EMMA test coverage tool. EMMA in on-line mode uses custom class loader, so who knows, what could go wrong there, especially that mentioned LinearAlloc binds its storage to class loader. So one option would be to try using EMMA in off-line mode, where .class files (and .jar files) get instrumented for test coverage during the build process. However it is true to say that instrumentation of classes will bloat them, so your errors may remain... Daniel On 2 May 2012 14:44, Lorie Pisicchio lorie.pisicc...@gmail.com wrote: Thanx Daniel, I have double checked, and I was wrong in my previous post : my test project started to fail after adding some tests, right, but also after adding emma dependency to calculate tests coverage. So I think this is the source of the problem. I will try to split tests into more classes and see if it works. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] public variables
http://c2.com/cgi/wiki?GlobalVariablesAreBad On 30 April 2012 15:33, baturanija1 jadrankobodiroga1...@gmail.com wrote: hey people, i am trying to make mute button on my app,that could sound-off\on sounds in app-such as ,sound of click,could of some prezentation.. is there any option that i can declare public variable- such as int,and to be seen in other class in my other activity.When i open new item,i what to information of that variable can be seen in othet itents...Any ides,,,i tried to google but did not manage...Thanks for share :) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Total Available memory for Memory Management logic.
Dallas, Very good pointer to developer resources - thanks a lot! Serves me well for not scanning through these for some time now. Daniel On 26 April 2012 17:47, Dallas Gutauckis dall...@gmail.com wrote: The Android developer site also explains why SoftReference and WeakReference are no longer a good solution. It also goes into detail on how to developer a good solution: http://developer.android.com/training/displaying-bitmaps/cache-bitmap.html In the past, a popular memory cache implementation was a SoftReference or WeakReference bitmap cache, however this is not recommended. Starting from Android 2.3 (API Level 9) the garbage collector is more aggressive with collecting soft/weak references which makes them fairly ineffective. On Thu, Apr 26, 2012 at 11:49 AM, bruce palant...@gmail.com wrote: I found that the soft references works when you are dealing with smaller allocations but if you deal with images, it gc()'s the reference took quick for it to be useful. There used to be some control around what thresholds are used but that isn't a good way to do it anyway. My solution was to go ahead and implement an LRU cache with hashmap and software references as Daniel mentions. Then I have a subset of that which are have hard references to a minimal number. That way, I don't get immediately gc'd and for systems that work better I get the benefit. If an OutOfMemoryError occurs, I can flush the cache, perform a couple of gc() calls, and continue. After doing some performance analysis of the rest of the code, minimizing memory churn, making sure bitmaps are manually recycled, reduced these errors greatly. I would suggest using TraceView and MemoryAnalyzer to make sure you really are releasing properly and just to see how the app is performing in general. You might spot some problems. On 3.0+ devices you can add to your AndroidManifest, in the application / area: 'android:largeHeap=true'. This gives lots of room for large pics (256M I believe). I wouldn't use it if you use mostly small allocations because there is a performance hit with the large heap. Cheers, Bruce On Apr 26, 4:01 am, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: The thing is that Android OS will allocate the memory according to the needs of a process (up to maximum memory allowed). So, if were able to establish the amount of free memory that your app has available, the OS might increase this allowance as soon as you allocate next bitmap, therefore the whole method makes little sense. Instead build a HashMap that uses soft references to build a primitive cache with random eviction policy. The bitmaps will get removed as the process is running low on memory. There are few good articles about the usage of soft and weak references to implement primitive caches in Java. This gives you a solution that will adapt to whatever memory allowance is there (different per OS version) with all the memory management duties shifted to the platform. Here is one such article:http://www.javaspecialists.eu/archive/Issue015.html Daniel On 25 April 2012 16:57, Anieeh animesh.andr...@gmail.com wrote: Hi all I am having problem with releasing memory problem, i have a Hashmap in which i am adding Bitmap object, and the no. of bitmaps are quite large. for this reason i am getting OutOfMemoryError. So for this i have decided to release Bitmap whic is least used from Collection, on memory crunch or system getting low heap memory. For getting current memory available i used ActivityManager.MemoryInfo.availMem but it gives total RAM size memory, not Available Heap memory. And i found that this memory is not getting updated on releasing Bitmap from collection. Then i have used these three method Debug.getNativeHeapAllocatedSize() Debug.getNativeHeapFreeSize() Debug.getNativeHeapSize() but found the NativeHeapSize goes on increasing upto some certain say 16MB changing after that an outOfMemoryError occur. In this also i found that the NativeHeapAllocatedSize and getNativeHeapSize not decreasing on releasing Bitmap from collection. So please help me for solving the problem if anyone facing the same problem and fixed earlier it. My problem is i want to calculate Max Available application memory allocated and currently available memory, for such that if currently available memory goes beyond the Threshold memory i will release some Bitmap from the collection and GC will reclaim the memory and free it without generating error. Thanks in advance Anieeh -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more
Re: [android-developers] Total Available memory for Memory Management logic.
The thing is that Android OS will allocate the memory according to the needs of a process (up to maximum memory allowed). So, if were able to establish the amount of free memory that your app has available, the OS might increase this allowance as soon as you allocate next bitmap, therefore the whole method makes little sense. Instead build a HashMap that uses soft references to build a primitive cache with random eviction policy. The bitmaps will get removed as the process is running low on memory. There are few good articles about the usage of soft and weak references to implement primitive caches in Java. This gives you a solution that will adapt to whatever memory allowance is there (different per OS version) with all the memory management duties shifted to the platform. Here is one such article: http://www.javaspecialists.eu/archive/Issue015.html Daniel On 25 April 2012 16:57, Anieeh animesh.andr...@gmail.com wrote: Hi all I am having problem with releasing memory problem, i have a Hashmap in which i am adding Bitmap object, and the no. of bitmaps are quite large. for this reason i am getting OutOfMemoryError. So for this i have decided to release Bitmap whic is least used from Collection, on memory crunch or system getting low heap memory. For getting current memory available i used ActivityManager.MemoryInfo.availMem but it gives total RAM size memory, not Available Heap memory. And i found that this memory is not getting updated on releasing Bitmap from collection. Then i have used these three method Debug.getNativeHeapAllocatedSize() Debug.getNativeHeapFreeSize() Debug.getNativeHeapSize() but found the NativeHeapSize goes on increasing upto some certain say 16MB changing after that an outOfMemoryError occur. In this also i found that the NativeHeapAllocatedSize and getNativeHeapSize not decreasing on releasing Bitmap from collection. So please help me for solving the problem if anyone facing the same problem and fixed earlier it. My problem is i want to calculate Max Available application memory allocated and currently available memory, for such that if currently available memory goes beyond the Threshold memory i will release some Bitmap from the collection and GC will reclaim the memory and free it without generating error. Thanks in advance Anieeh -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: File IO Erros
) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:159) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:101) 04-17 22:49:36.722: W/System.err(31530): at java.io.BufferedOutputStream.write(BufferedOutputStream.java:129) 04-17 22:49:36.722: W/System.err(31530): at org.kiran.ms.core.WebserverHandler.processHTTPGet(WebserverHandler.java:125) 04-17 22:49:36.722: W/System.err(31530): at org.kiran.ms.core.WebserverHandler.handle(WebserverHandler.java:86) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.Server.handle(Server.java:346) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) 04-17 22:49:36.722: W/System.err(31530): at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533) 04-17 22:49:36.722: W/System.err(31530): at java.lang.Thread.run(Thread.java:1019) These errors are popping up occasionally while Jetty is trying to serve a specific file but I don't think the error is file specific (i.e. the same errors pop up with different files at different times), and I'm thinking the errors have something to do with the OS not being able to read these files fast enough? The code I'm using to process execute a HTTP GET is (the relavent portion of the code): BufferedInputStream bis = null; OutputStream outStream = null; try { HttpClient client = new DefaultHttpClient(); HttpGet request = new HttpGet(); request.setURI(new URI(getURL)); HttpResponse response = client.execute(request); bis = new BufferedInputStream(response.getEntity().getContent()); outStream = new FileOutputStream(fullPath); bytesRead = bis.read(buf1, 0, bufLen); while (bytesRead != -1) { outStream.write(buf1, 0, bytesRead); bytesRead = bis.read(buf1, 0, bufLen); } } Thanks in advance, Kiran -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Watch out for fake audio sample rates in AudioRecord
That's quite shocking, especially that even the cheapest of ADC/DAC chips support the whole of (human)audio spectrum. Bad engineering. All you have to do is to have calibrating stage in your app and embed some audio samples on your website to assist that process. On 16 April 2012 15:03, RLScott fixthatpi...@yahoo.com wrote: If your application records audio at a specified sample rate, be aware that some OEMs are faking it! We have a piano tuning app that needs to detect frequencies up to about 4200 Hz. This requires sampling audio at least twice that frequency, or 8400. So we used one of the standard audio sample rates of 22050. Most devices we have tested work fine. But on the Acer Iconia tablet something strange happens. The calls to set up the AudioRecord at 22050 samples per second work without error, and the frequency spectrum shows that it is indeed returning 22050 samples for every second of audio. But then we started looking at the higher frequencies and found a frequency fold- back point of 3690 Hz, just as if the sample rate were really 7380 Hz. Our conclusion is that 7380 is the native audio record sample rate for the Acer Iconia, but other sample rates are simulated by up- sampling. That is, certain samples are repeated in order to make 7380 samples do the job of 22050 samples. This creates the fold-back phenomenon where any frequency above 3690 shows up as a frequency below 3690 by the same amount. Other than running tests on real sound I know of no way to programmatically verify that the requested sample rate is being honored for real and not simulated by up-sampling. (By contrast the original Motorola Droid has not such fold-back behavior and appears to return 22050 samples per second for real.) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: No validating SAX parser for android?
Then there is this package (since API level 8): http://developer.android.com/reference/javax/xml/validation/package-summary.html Shame that it is not SAX, as here you parse the whole lot and then validate. Daniel On 4 April 2012 16:06, Chuck Krutsinger chuck.krutsin...@gmail.com wrote: Here is the code for Android's SAXParserFactoryImpl.java: @Override public SAXParser newSAXParser() throws ParserConfigurationException { if (isValidating()) { throw new ParserConfigurationException( No validating SAXParser implementation available); } try { return new SAXParserImpl(features); } catch (Exception ex) { throw new ParserConfigurationException(ex.toString()); } } The Android DOM parser DocumentBuilderFactory has something very similar. Neither supports validation. You have to find a 3rd party parser of you want to validate. On Apr 4, 8:36 am, RedBullet scottedchap...@gmail.com wrote: That's sort of what I am doing now. Seems kind of unsatisfying ;-) Just wanted to know what my options were... It is confusing because the docs seem to imply that one can do validation... On Wednesday, April 4, 2012 9:39:07 AM UTC-4, Streets Of Boston wrote: What about not validating the incoming XML? Since i don't know what type of app you need the validating SAX parser for, but if your app just needs to read bits and pieces of incoming XML, you really don't need a validating XML. Just read the data and present it to the user. If the incoming data is not what you expect, i.e. after reading the XML you are still missing pieces of data and such, let your app handle this situation by itself. On Wednesday, April 4, 2012 9:10:37 AM UTC-4, RedBullet wrote: Any more ideas on this? I must be doing something obviously wrong, but perhaps there just isn't a validating SAX parser for Android? (though I would have expected someone on this list to say so)... On Monday, April 2, 2012 12:40:13 PM UTC-4, RedBullet wrote: I just tried that and got the same error. No validaing SAX parser implementaion available. On Monday, April 2, 2012 12:14:33 PM UTC-4, Daniel Drozdzewski wrote: ...so did you tell your parser the following: static final String GARMIN_SCHEMA_LANGUAGE = http://www.w3.org/2001/XMLSchema-instance;; static final String W3C_XML_SCHEMA = http://www.w3.org/2001/XMLSchema;; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(true); saxParser.setProperty(GARMIN_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); ?? On 2 April 2012 17:10, RedBullet wrote: Yea, I read that. My XML contains the following so I thought that would be sifficient: ?xml version=1.0 encoding=UTF-8? TrainingCenterDatabase xmlns=http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd; Isn't that how it is supposed to work?? On Monday, April 2, 2012 12:01:42 PM UTC-4, Daniel Drozdzewski wrote: Did you tell your parser which schema will it be validating against? Setting validation flag to true is not enough... Have a look here at a quick validating example using SAXParser: http://docs.oracle.com/javaee/1.4/tutorial/doc/JAXPSAX9.html Daniel On 2 April 2012 16:34, RedBullet wrote: I am parsing some XML with SAX, and I noticed that there was some XSD in the files I am parsing. So, I figured to would turn validation on the factory before I get the parse, but when I do I get an error saying there is no validating parser available. So... How does one validate XML on the Android?? -- -- Daniel Drozdzewski -- -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] physics box 2d andengine game
right away: I suggest learn something first, then spend decent amount of time grafting, before asking for any help, and when asking, please ask precise and specific questions, as it is an impossible task to give you *some help here* in developing *anything*. There must be a reason, why there aren't any books or courses titled: 'Developing $hit hot games/apps/*anything* for dummies' just like there are no books titled 'Teach yourself neurosurgery in a weekend'. On 3 April 2012 10:41, Ahmed Bakir bkr3...@gmail.com wrote: beginner in developing anything so can someone please give me some help here -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] No validating SAX parser for android?
Did you tell your parser which schema will it be validating against? Setting validation flag to true is not enough... Have a look here at a quick validating example using SAXParser: http://docs.oracle.com/javaee/1.4/tutorial/doc/JAXPSAX9.html Daniel On 2 April 2012 16:34, RedBullet scottedchap...@gmail.com wrote: I am parsing some XML with SAX, and I noticed that there was some XSD in the files I am parsing. So, I figured to would turn validation on the factory before I get the parse, but when I do I get an error saying there is no validating parser available. So... How does one validate XML on the 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] No validating SAX parser for android?
...so did you tell your parser the following: static final String GARMIN_SCHEMA_LANGUAGE = http://www.w3.org/2001/XMLSchema-instance;; static final String W3C_XML_SCHEMA = http://www.w3.org/2001/XMLSchema;; SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(true); saxParser.setProperty(GARMIN_SCHEMA_LANGUAGE, W3C_XML_SCHEMA); ?? On 2 April 2012 17:10, RedBullet scottedchap...@gmail.com wrote: Yea, I read that. My XML contains the following so I thought that would be sifficient: ?xml version=1.0 encoding=UTF-8? TrainingCenterDatabase xmlns=http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd; Isn't that how it is supposed to work?? On Monday, April 2, 2012 12:01:42 PM UTC-4, Daniel Drozdzewski wrote: Did you tell your parser which schema will it be validating against? Setting validation flag to true is not enough... Have a look here at a quick validating example using SAXParser: http://docs.oracle.com/javaee/1.4/tutorial/doc/JAXPSAX9.html Daniel On 2 April 2012 16:34, RedBullet wrote: I am parsing some XML with SAX, and I noticed that there was some XSD in the files I am parsing. So, I figured to would turn validation on the factory before I get the parse, but when I do I get an error saying there is no validating parser available. So... How does one validate XML on the Android?? -- -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Android Project development cost
Recommendation2: Consider offers other than $x/hr, as those give the vendor incentive to be late. Divide the project into handful of stages, and pay for each completed stage, where both sides agree on 'completeness criteria'. It will encourage the communication between both sides too, which is very important with software projects. Daniel On 21 March 2012 17:16, Bob Plantz rgpla...@gmail.com wrote: Recommendation: Take the bid just before the one that says $n/hr with the ending of MY choice. :-) On 3/21/2012 10:00 AM, Nadeem Hasan wrote: I will do it for $85/hr with no extra charge for any ending of your choice. Don't you love competition. -- -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] MediaRecorder - buffered encoding of video
Paul, Yes, you got it spot on (and well done for your ASCII art skills). Now as you can imagine, the video will be transmitted in chunks. The size of the all chunks will more-less depend on the size of the initial chunk. So in your timeline the delay on the receiver side is really 4 chunks not 4 seconds. What if your first chunk was 0.5s long? Then the delay is going to be 4 x 0.5s (not counting transmission delays). What if you could get away with chunks 0.25sec long? 1 to 2 sec delay is not bad I think. You will struggle to lower it any further, as you are talking about establishing of the connection (could be done before the transmission) , buffering and shifting that buffer to the receiver. Network latency is quite big in mobile data networks. Poor connection (and the data rate dropping down to GPRS rates) will affect this too. However this solution is adaptive and better bandwidth will make the double buffering perform the swaps quicker (which I think is a very nice feature). Now to achieve the first chunk to have 0.5s or 0.25s, have a look at MediaRecorder.setMaxDuration() and MediaRecorder.OnInfoListener. You will have to set it only for the first chunk... but possibly there is more logic that could be done around it to optimise the whole thing. Daniel On 19 March 2012 09:52, paul paulelsne...@googlemail.com wrote: Thanks for the answer. I also think I don't get your point :D I try to explain my understand of your point with a little graphic. Timeline: sec 0---1--2--3-4--5-6- Sender: StartRecord0(); StopRecord0();StartSend0();StartRecord1(); FinishSend0();StopRecord1();StartSend1();StartRecord2(); FinishSend1();StopRecord2();StartSend2();StartRecord3(); Receiver: StartReceive0(); FinishReceive0();StartPlay0();StartReceive1(); StopPlay0():FinishReceive1(); StartPlay1();StartReceive2(); In my opinion that's the way you mean. But as you see, the recorded video from second 0 to 2 will be played on the receiver side from second 4 to 6. Maybe it can be optimized to play the received video-stream directly after the StartReceive, but so the video is played from second 2 to 4. That means there is a delay of at least 2 seconds. Am I right? On Saturday, March 17, 2012 8:20:18 AM UTC+1, Daniel Drozdzewski wrote: On Friday, 16 March 2012, paul paulelsne...@googlemail.com wrote: Thank you for than answer, but that isn't a solution for the problem. Doing it that way, leads to a delay depending on the recording time to that file. Also there would be an interruption of the video stream. I don't think you got the idea... Recording would be happening to fileB while previously recorded fileA would be sent through the socket at the same time. The only interuption in the video stream would be due to stopping of the recording, passing the recorded file to the sender, reseting of the recorder and setting it up with the new file. All that should take under a second. HTH I want to use the captured and encoded video for videoconferencing, so any kind of delay is not acceptable. ..do you mean storing it in the buffer and creating a delay/jitter? It seem to me that the video encoder works in that way. I don't want a delay. Am Freitag, 16. März 2012 17:54:29 UTC+1 schrieb Daniel Drozdzewski: On 16 March 2012 15:22, paul paulelsne...@googlemail.com wrote: Then it would write out the data when the stop function is called. ..do you mean storing it in the buffer and creating a delay/jitter? You will have to look at double buffering using 2 files ... while one is being recorded to, the other will be sent through the socket. Once writing is finished, you stop the recorder, point it at new file and restart it, while taking just finished file and sending it. Sent files can be discarded or left for the sake of having a local copy. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received
Re: [android-developers] MediaRecorder - buffered encoding of video
On Friday, 16 March 2012, paul paulelsne...@googlemail.com wrote: Thank you for than answer, but that isn't a solution for the problem. Doing it that way, leads to a delay depending on the recording time to that file. Also there would be an interruption of the video stream. I don't think you got the idea... Recording would be happening to fileB while previously recorded fileA would be sent through the socket at the same time. The only interuption in the video stream would be due to stopping of the recording, passing the recorded file to the sender, reseting of the recorder and setting it up with the new file. All that should take under a second. HTH I want to use the captured and encoded video for videoconferencing, so any kind of delay is not acceptable. ..do you mean storing it in the buffer and creating a delay/jitter? It seem to me that the video encoder works in that way. I don't want a delay. Am Freitag, 16. März 2012 17:54:29 UTC+1 schrieb Daniel Drozdzewski: On 16 March 2012 15:22, paul paulelsne...@googlemail.com wrote: Then it would write out the data when the stop function is called. ..do you mean storing it in the buffer and creating a delay/jitter? You will have to look at double buffering using 2 files ... while one is being recorded to, the other will be sent through the socket. Once writing is finished, you stop the recorder, point it at new file and restart it, while taking just finished file and sending it. Sent files can be discarded or left for the sake of having a local copy. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: MediaRecorder - buffered encoding of video
Hypothetically, what would happen, if your bandwidth was to small to cope with the amount of data generated by the live video capture? On 16 March 2012 14:44, paul paulelsne...@googlemail.com wrote: *push* Has anybody an idea or at least the same problem? Or do you know a way how to access the hardware encoder directly with native code? Thanks. On Tuesday, March 13, 2012 9:46:37 PM UTC+1, paul wrote: Hi. I try to capture video from the camera, encoding it with the MediaRecorder and write the output to a LocalSocket. All works fine, but the encoder seems to write the data into an internal buffer. The data only gets written to the socket when the buffer is full or the encoding process is stopped. Depending on the set up data-rate, the delay between start recording an begin writing to the socket is up to 20sec. This delay is not acceptable, because I try to develop a live stream application. Does any body know a way to avoid this buffering? Is that issue known? Maybe it depends on my device? Atrix with Tegra2 = hardware encoder I hope to hear from you soon. Regards, Paul -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: MediaRecorder - buffered encoding of video
On 16 March 2012 15:22, paul paulelsne...@googlemail.com wrote: Then it would write out the data when the stop function is called. ..do you mean storing it in the buffer and creating a delay/jitter? You will have to look at double buffering using 2 files ... while one is being recorded to, the other will be sent through the socket. Once writing is finished, you stop the recorder, point it at new file and restart it, while taking just finished file and sending it. Sent files can be discarded or left for the sake of having a local copy. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Android network stack reset
http://stackoverflow.com/questions/3037303/wake-lock-does-not-seem-to-work On 23 February 2012 16:19, Bipin Shashi bi...@lokalty.com wrote: After a long period of inactivity within my app, all the get requests start failing with a connection timeout error. I notice this was happening when the phone is connected over the 3G network, and not when it is connected to wifi.. At present to get it to work, i toggle the airplane mode state twice and the network connections get reset.Is this the best way to go about doing this ? Please enlighten! void toggleAirplaneMode(){ //Toggling airplane mode to restart network Context context = getApplicationContext(); boolean isEnabled = Settings.System.getInt( context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, 0) == 1; // toggle airplane mode Settings.System.putInt( context.getContentResolver(), Settings.System.AIRPLANE_MODE_ON, isEnabled ? 0 : 1); // Post an intent to reload Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED); intent.putExtra(state, !isEnabled); context.sendBroadcast(intent); Log.d(Inetify, Toggling Airplane 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] whole file dose not load always
It is worth examining few things about your entity: - is it streaming? - is it chunked? - get it length.. All of those are method calls on HttpEntity. Also it is worth checking the headers of your request. If the requested file is big, it is most likely that it will get chunked by the web server. In such case, your client will need some extra logic to receive the whole chunked file. I *presume* that chunked response mean that getContentLength() returns the length of each chunk that is ready to be received. For more info, read some HTTP 1.1 spec: http://sharovatov.wordpress.com/2009/04/30/http-chunked-encoding/ Daniel On 15 February 2012 14:38, limelect limel...@gmail.com wrote: I have this part in a service (or Thread same problem ) to load a file greater then 40 char; almost 1/2 a mega char. Some times it load much less not consistent. How to debug it or make adjustment. Same program download jpg (with modifications) of 30k without a problem. StringBuilder downloadFile(String url) { final int IO_BUFFER_SIZE = 4 * 1024; // AndroidHttpClient is not allowed to be used from the main thread // final HttpClient client = (mode == Mode.NO_ASYNC_TASK) ? new DefaultHttpClient() : final HttpClient client = (mode == Mode.CORRECT) ? new DefaultHttpClient() : AndroidHttpClient.newInstance(Android); final HttpGet getRequest = new HttpGet(url); try { HttpResponse response = client.execute(getRequest); final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { Log.e(WindGraph, Error + statusCode + while retrieving file from + url); return null; } final HttpEntity entity = response.getEntity(); BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); if (entity != null) { InputStream inputStream = null; try { inputStream = bufHttpEntity.getContent(); This is where content fails some time 1 Log.d(WindGraph,Content size +Integer.toString( (int) bufHttpEntity.getContentLength())); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: whole file dose not load always
What does getContentLength() return for the failing requests? Other idea is to look into HTTP response and all of its headers and the body. Run your code from within the emulator and use Wireshark to peep into the HTTP requests and responses. On 15 February 2012 16:28, limelect limel...@gmail.com wrote: Well i added as daniel advice this pies of cod Log.d(WindGraph,Chunk ? + entity.isChunked()); BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); if (entity != null) { InputStream inputStream = null; try { // entity.getContentLength() // inputStream = entity.getContent(); inputStream = bufHttpEntity.getContent(); Log.d(WindGraph,Chunk 2 ? + bufHttpEntity.isChunked()); both show FALSE (no chunk) when the down load fails Any idea what to look for? On Feb 15, 6:02 pm, limelect limel...@gmail.com wrote: I changed to BufferedReader after i head problem as i read in the internet it will solve the problem but it did not On Feb 15, 5:56 pm, Kostya Vasilyev kmans...@gmail.com wrote: To add my $0.02 to everything Daniel wrote -- -- why use BufferedHttpEntity? http://developer.android.com/reference/org/apache/http/entity/Buffere... A wrapping entity that buffers it content if necessary. The buffered entity is always repeatable. If the wrapped entity is repeatable itself, calls are passed through. If the wrapped entity is not repeatable, the content is read into a buffer once and provided from there as often as required. I don't see anything in the posted snippet that would require a repeatable entity (i.e. rewinding the stream and reading the same data again). The underlying entity is most likely not repeatable, so all this does is forces unnecessary in-memory buffering. Perhaps there is a limit to this buffer? -- Kostya On 02/15/2012 07:37 PM, Daniel Drozdzewski wrote: It is worth examining few things about your entity: - is it streaming? - is it chunked? - get it length.. All of those are method calls on HttpEntity. Also it is worth checking the headers of your request. If the requested file is big, it is most likely that it will get chunked by the web server. In such case, your client will need some extra logic to receive the whole chunked file. I *presume* that chunked response mean that getContentLength() returns the length of each chunk that is ready to be received. For more info, read some HTTP 1.1 spec: http://sharovatov.wordpress.com/2009/04/30/http-chunked-encoding/ Daniel On 15 February 2012 14:38, limelectlimel...@gmail.com wrote: I have this part in a service (or Thread same problem ) to load a file greater then 40 char; almost 1/2 a mega char. Some times it load much less not consistent. How to debug it or make adjustment. Same program download jpg (with modifications) of 30k without a problem. StringBuilder downloadFile(String url) { final int IO_BUFFER_SIZE = 4 * 1024; // AndroidHttpClient is not allowed to be used from the main thread // final HttpClient client = (mode == Mode.NO_ASYNC_TASK) ? new DefaultHttpClient() : final HttpClient client = (mode == Mode.CORRECT) ? new DefaultHttpClient() : AndroidHttpClient.newInstance(Android); final HttpGet getRequest = new HttpGet(url); try { HttpResponse response = client.execute(getRequest); final int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { Log.e(WindGraph, Error + statusCode + while retrieving file from + url); return null; } final HttpEntity entity = response.getEntity(); BufferedHttpEntity bufHttpEntity = new BufferedHttpEntity(entity); if (entity != null) { InputStream inputStream = null; try { inputStream = bufHttpEntity.getContent(); This is where content fails some time 1 Log.d(WindGraph,Content size +Integer.toString( (int) bufHttpEntity.getContentLength())); -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email
Re: [android-developers] Eyes Free Shell Compilation
http://code.google.com/p/eyes-free/wiki/DeveloperFAQs On 14 February 2012 10:51, Harsh Vardhan harsh.020...@gmail.com wrote: Hi, I wanted to know if I can, somehow, compile the eyes free shell - read only. I am getting loads of unable to resolve errors and import cannot be resolved. Here is the link to the open source project: http://code.google.com/p/eyes-free/source/checkout P.S. This is my first mail to this community. -- Regards Harsh Vardhan -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Final year project app
How about a simple app, that is called FINAL YEAR PROJECT, where user can select various technologies through selecting internet forums about each technology (Android, JavaScript, Flash, .NET, ...). It is a matter of using Google APIs. You could expand it to Yahoo groups, Usenet, ... the sky is a limit. Once user selects technology, there is a button that pre-populates post that will be submitted to selected forum(s). Something along the lines body Hello, I am a university level student, and has to submit a project Under Final Year Project, and want to work on technology_placeholder. Please provide good idea... /body One submit button and that's it. On 13 February 2012 13:13, Sahi cyber.hawk...@gmail.com wrote: Hello, I am a university level student, and has to submit a project Under Final Year Project, and want to work on android. Can any one provide me a good App idea to work with, I has 5 Months time frame and knows the basics of Android App development. It is a honest request to all developers to provide a good idea. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Need help testing an app!
There is also Device Anywhere: http://www.keynotedeviceanywhere.com/index.aspx On 14 February 2012 13:20, Mark Phillips m...@phillipsmarketing.biz wrote: Try these guys - http://duarlander.ning.com/. I have never used them, but it looks like you can post a request for testers on their wall and may not have to pay. Mark On Tue, Feb 14, 2012 at 12:23 AM, Manmade manmadeinf...@gmail.com wrote: I wonder if anybody please could help me test an app that I made? I have made an Android app to a school here in sweden and one guy says that its not working. The guy has a Google Galaxy Nexus with OS 4.0.2, but it would be good to get tests from other phones too! I have tested it in the Eclipse Emulator with OS 2.2, 2.3 and the latest 4.0.3, I have also tested it on my Samsung Galaxy 9001 with OS 2.3.3 and on my girlfriends Samsung Galaxy 9000 with OS 2.2 and it is working as is should, no faults! The only thing that doesnt work is saving a localStorage value in 2.2, and therefor I have released it with OS 2.3.7. I think it is something wrong with his phone and not the app!? Off course I could be wrong, but its strange that it work for me and not for him! You find the app here: https://market.android.com/details?id=com.manmade.se or you will find the apk file here: http://www.manmade.se/iphone/sam/sam1.4.apk To test the shedule in the app, do this: 1. In the menu click Schema. 2. Click on the button at the top right corner Persnr 3. Write 19951003-5489 in the text field and click Spara. This saves the personal number to a localStorage, and only has to be done ones. An alert will show up saying Personnummer sparat, which is a confirmation that the number has been saved. 4. Return to the menu and start the Schema page again. 5. Click the link Mitt Schema. Now you should see a shedule! 1. Doesnt all phones that is running the Android OS work the same way? 2. Could you please also test the other pages in the app and see if you see anything strange? 3. Could you please write down the phone you are testing it on and also what version of OS it is. If you get an error saying: Application Error The connection to the server was unsuccessful. (file:///android_asset/www/index.html) This is due to slow connection and is fixed in my latest release version, but not in the above, so just ignore that thanks. But if you find any other problems please let me know. Thanks a lot for your time and help. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] listview search improve performance
What exactly did you do, from what I said? All of it? Some points? I suggest you follow Skink's suggestion and most of your pains will be sorted. On 9 February 2012 11:23, vani reddy vani.reddy.bl...@gmail.com wrote: Hi Daniel, I did the same as what you said, sometimes it throws indexoutofboundsexception in adapter. It takes the old value and sets the adapter pskink -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] listview search improve performance
0. Stop creating new adapter and adding it to your ListView every time user types anything. Consult ListAdapter API - there are methods to accommodate your needs. 1. Don't scan all items every time user changes the input. Add timer to perform the search/filter and delay the search by say 0.9sec resetting the timer in onTextChanged. 2. Optimise your search. *start*, *before*, and *count* are there for a reason. 3. If you are ambitious, use better data structure behind the adapter to speed up your search or place your data in DB and use CursorAdapter. On 8 February 2012 12:27, vani reddy vani.reddy.bl...@gmail.com wrote: Hello, I have a listview in which i am loading data of size 400. for the edittext i am giving search_feild.addTextChangedListener(new TextWatcher() { ListShow _sortShow = new ArrayListShow(); public void afterTextChanged(Editable s) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void onTextChanged(CharSequence s, int start, int before, int count) { searchStr = search_feild.getText().toString().trim() .toLowerCase(); _sortShow.clear(); for (int i = 0; i m_ChannelList.getData().size(); i++) { if (textlength = m_ChannelList.getData().get(i) .getListing_name().length() || textlength = m_ChannelList.getData().get(i) .getCh_name().length()) { Show show = m_ChannelList.getData().get(i); if String) show.getListing_name().toLowerCase()) .contains(searchStr)) || (((String) show.getCh_name().toLowerCase()) .contains(searchStr)) ) { _sortShow.add(show); } sorted_ChannelList.setData(_sortShow); adapter = new LazyAdapterChannelList(ChannelGuideActivity.this, sorted_ChannelList); setListAdapter(adapter); } }); it is blocking the UI,How to resolve it -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] listview search improve performance
Fair point Skink! All that needs to happen is to implement a Filter and add it to Adapter. On 8 February 2012 14:02, skink psk...@gmail.com wrote: Daniel Drozdzewski wrote: 0. Stop creating new adapter and adding it to your ListView every time user types anything. Consult ListAdapter API - there are methods to accommodate your needs. it's AbsListView that performs filtering imho pskink -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Overlay Images
Draw each of the bitmaps on one canvas in the ascending order from deepest to topmost. On 6 February 2012 13:18, New Developer secur...@isscp.com wrote: I have 4 ImageViews one stacked on top of the other all the same size, each ImageView has it's own associated canvas that I can access. Thus allowing me to view layers of a single image on screen. I now wish to save this screen image to a file. How can I merge the canvases into one image? 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Overlay Images
Ok, Create a LayerDrawable object and keep adding to it Drawable objects (LayerDrawable.setDrawableByLayerId (int id, Drawable drawable)) extracted from each of your stacked Views. On 6 February 2012 13:47, New Developer secur...@isscp.com wrote: Thanks I don't have access to the bitmaps (I don't think) I have access to the ImageView and the Canvas associated with the ImageView Thanks again On 02/06/2012 08:37 AM, Daniel Drozdzewski wrote: Draw each of the bitmaps on one canvas in the ascending order from deepest to topmost. On 6 February 2012 13:18, New Developer secur...@isscp.com wrote: I have 4 ImageViews one stacked on top of the other all the same size, each ImageView has it's own associated canvas that I can access. Thus allowing me to view layers of a single image on screen. I now wish to save this screen image to a file. How can I merge the canvases into one image? Thanks in advance -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] VideoView and buffering
John-Marc, I am glad that it works. I am not sure whether prepareAsync would be quicker than blocking prepare call. I mean that whatever the system implementation of the player, preparing it takes the same amount of time and async call simply does not block, but if you call play as a next statement after prepareAsync, I think playing will be put on hold until the player is ready to play. You could test both approaches by adding some logging and swapping these calls to prepare. I was also thinking that you could create 2 MediaPlayer objects and the one that is not playing at the moment is being prepared in the background with the new data that arrived. In MediaPlayer.OnCompletionListener of the first player you simply cause the background, prepared player to swap seats with the one that just finished. Maybe that would be a bit smoother... ( I am only speculating here). This is simple double buffering used all over computers to avoid flickering when displaying moving objects. Not the easiest approach, but if you are swapping the files from underneath 1 player, then swapping players from underneath 1 activity should not be much more complex. Daniel On 31 January 2012 14:50, John-Marc Desmarais j...@ieee.org wrote: Hi, I'm using the reset() now. There's a little bump in the playback every time it reaches the end of the content that existed in the file when it was initially loaded which I don't like but I'm using prepareAsync so I think this hiccup is as small as I can make it with a single VideoView. Thanks for your help. -jm On Mon, Jan 30, 2012 at 11:16 AM, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: John-Marc, I have not done this myself, but here is tutorial on how to do it: http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/ They actually create new MediaPlayer object upon every update to the buffer file and point this new MediaPlayer to the updated buffer every single time. I would test calling MediaPlayer.reset() first instead of creating new player object every time, to see whether time and memory consumed by such solution is a bit better. HTH, Daniel On 30 January 2012 15:49, John-Marc Desmarais j...@ieee.org wrote: Hi, I am currently writing a video file to the SDCard while playing it with VideoView. My problem is that, if I buffer 1MB of video and begin the Video playback, the video stops after 1MB has been played, even though by this time, 5MBs of file has now been written to the sdcard. I have been trying various things in onCompletion handler.. such as: int curLoc = mp.getCurrentPosition(); Log.e(LogName.onCompletion, LogName.onCompletion + CurrentLocation: + mp.getCurrentPosition()); Log.e(LogName.onCompletion, LogName.onCompletion + Duration: + mp.getDuration()); mp.pause(); mp.prepareAsync(); mp.start(); mp.seekTo(curLoc); In this case I get a Cannot play video message. Or: int curLoc = mp.getCurrentPosition(); Log.e(LogName.onCompletion, LogName.onCompletion + CurrentLocation: + mp.getCurrentPosition()); Log.e(LogName.onCompletion, LogName.onCompletion + Duration: + mp.getDuration()); mp.prepareAsync(); mp.start(); mp.seekTo(curLoc); This crashes with prepare Async in State 128. Has anyone solved the problem of re-queuing file in the videoView so that it plays everything that has been written to the sdcard even though it starts with a smaller file? Regards, -jm -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send
Re: [android-developers] VideoView and buffering
John-Marc, I have not done this myself, but here is tutorial on how to do it: http://blog.pocketjourney.com/2008/04/04/tutorial-custom-media-streaming-for-androids-mediaplayer/ They actually create new MediaPlayer object upon every update to the buffer file and point this new MediaPlayer to the updated buffer every single time. I would test calling MediaPlayer.reset() first instead of creating new player object every time, to see whether time and memory consumed by such solution is a bit better. HTH, Daniel On 30 January 2012 15:49, John-Marc Desmarais j...@ieee.org wrote: Hi, I am currently writing a video file to the SDCard while playing it with VideoView. My problem is that, if I buffer 1MB of video and begin the Video playback, the video stops after 1MB has been played, even though by this time, 5MBs of file has now been written to the sdcard. I have been trying various things in onCompletion handler.. such as: int curLoc = mp.getCurrentPosition(); Log.e(LogName.onCompletion, LogName.onCompletion + CurrentLocation: + mp.getCurrentPosition()); Log.e(LogName.onCompletion, LogName.onCompletion + Duration: + mp.getDuration()); mp.pause(); mp.prepareAsync(); mp.start(); mp.seekTo(curLoc); In this case I get a Cannot play video message. Or: int curLoc = mp.getCurrentPosition(); Log.e(LogName.onCompletion, LogName.onCompletion + CurrentLocation: + mp.getCurrentPosition()); Log.e(LogName.onCompletion, LogName.onCompletion + Duration: + mp.getDuration()); mp.prepareAsync(); mp.start(); mp.seekTo(curLoc); This crashes with prepare Async in State 128. Has anyone solved the problem of re-queuing file in the videoView so that it plays everything that has been written to the sdcard even though it starts with a smaller file? Regards, -jm -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Existing joomla site in Android..
It is becoming off-topic... You will have to use User-Agent detection on the server site (easily done in PHP or anything else) to return the appropriate version of the page or use JS to redirect based on some properties of the browser rendering the page. First solution depends on User-Agent, which could be spoofed and is not 100% watertight. Second one, that I found (jQuery): if($(window).width() 480){ window.location = mobile.yoursite.com } ...is a bit rigid and assumes a lot about the screens that your page is being rendered on. If you are limiting the content only because of the screen resolution, then you are safe, but if you want to remove say flash or some other file types, resolution is not the way to detect the agent. Some phones have more pixels than some desktop platforms. Also, if it is only images that you are concerned with, you could use adaptive images: http://adaptive-images.com/ HTH, Daniel On 25 January 2012 09:43, sathyashrayan sathyashra...@gmail.com wrote: Ok i am back with a new question.. If suppose i don't want some files to be loaded in the mobile device. But it should be loaded in desktop devices. If that is the case then what should be the 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem evaluating javascript with a semaphore lock
Your semaphore allows ZERO passes through, in which case you have to release first. Either change the parameter to Semaphore constructor or release before calling Semaphore.acquire() Daniel On 18 January 2012 15:00, tatebn brandonnt...@gmail.com wrote: By the way, this code is located in a subclassed WebView. On Jan 18, 9:53 am, tatebn brandonnt...@gmail.com wrote: I'm trying to evaluate javascript with a semaphore lock. I need to query some web content about which context menus to show and need it to be synchronous. When I try to acquire the semaphore the thread locks without the javascript being evaluated and my javascript interface method being called. Here's my code. private Semaphore returnSemaphore = new Semaphore(0); private String returnValue; public String getJSValue(String expression) { String code = javascript:_JSEval.setValue((function(){try{return + expression + +\\;}catch(js_eval_err){return '';}})());; //String code = javascript: alert('here');; Log.d(TAG, eval: + code); this.loadUrl(code); try { Log.d(TAG, eval: about to acquire semaphore, + returnSemaphore.availablePermits()); returnSemaphore.acquire(); Log.d(TAG, past semaphore acquire); return returnValue; } catch (InterruptedException e) { Log.e(TAG, eval: Interrupted, e); } return null; } @SuppressWarnings(unused) private class JSEval { public void setValue(String value) { Log.i(TAG, eval: in set value); //if (value != null) { returnValue = value; //} returnSemaphore.release(); } } If I remove the semaphore acquire call, I get a result in setValue, so I know the interface is working. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem evaluating javascript with a semaphore lock
Why can't you just let webview evaluate the JavaScript? On 18 January 2012 15:18, tatebn brandonnt...@gmail.com wrote: I need the semaphore to hold there so that the return doesn't happen until the value is sent back from javascript. How do I get the web view to continue evaluating the javascript in the background? On Jan 18, 10:05 am, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: Your semaphore allows ZERO passes through, in which case you have to release first. Either change the parameter to Semaphore constructor or release before calling Semaphore.acquire() Daniel On 18 January 2012 15:00, tatebn brandonnt...@gmail.com wrote: By the way, this code is located in a subclassed WebView. On Jan 18, 9:53 am, tatebn brandonnt...@gmail.com wrote: I'm trying to evaluate javascript with a semaphore lock. I need to query some web content about which context menus to show and need it to be synchronous. When I try to acquire the semaphore the thread locks without the javascript being evaluated and my javascript interface method being called. Here's my code. private Semaphore returnSemaphore = new Semaphore(0); private String returnValue; public String getJSValue(String expression) { String code = javascript:_JSEval.setValue((function(){try{return + expression + +\\;}catch(js_eval_err){return '';}})());; //String code = javascript: alert('here');; Log.d(TAG, eval: + code); this.loadUrl(code); try { Log.d(TAG, eval: about to acquire semaphore, + returnSemaphore.availablePermits()); returnSemaphore.acquire(); Log.d(TAG, past semaphore acquire); return returnValue; } catch (InterruptedException e) { Log.e(TAG, eval: Interrupted, e); } return null; } @SuppressWarnings(unused) private class JSEval { public void setValue(String value) { Log.i(TAG, eval: in set value); //if (value != null) { returnValue = value; //} returnSemaphore.release(); } } If I remove the semaphore acquire call, I get a result in setValue, so I know the interface is working. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem evaluating javascript with a semaphore lock
Why does your JS has to be synchronous? Simply within JS make body of your page a throbber and only swap it back to its actual content as a last statement in the JS function that you want to process. On 18 January 2012 16:24, tatebn brandonnt...@gmail.com wrote: I'm getting the same issue using the CountDownLatch. The WebView can't load the url because of the lock. On Jan 18, 11:01 am, Streets Of Boston flyingdutc...@gmail.com wrote: We use a countdown latch instead: String returnValue; private CountDownLatch latch = null; public String run(String javaScript, int waitInMilliSecs) { latch = new CountDownLatch(1); runJS(javaScript); // this method just runs the given javascript in the WebView. try { latch.await(waitInMilliSecs, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { } return returnValue; } ... ... // method being called by the javascript in WebView public void setValue(String value) { try { // do your stuff here with 'value': returnValue = value;} finally { try { latch.countDown(); } catch (Exception e) {} } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem evaluating javascript with a semaphore lock
You can bind Java code from within your JavaScript by calling *WebView.addJavascriptInterface()*. In other words you could call one method within Java object of your choosing, when user selects A in UI or different method of different object, when user interacts with UI differently. JavaDocs are poor, but fairly good example can be found here: http://mobile.tutsplus.com/tutorials/mobile-web-apps/build-a-contacts-application-with-jquery-mobile-the-android-sdk-part-1/ (have a look at section 'Integrating HTML/JavaScript Based UI With Android Java Back-end') HTH Daniel On 18 January 2012 17:21, Streets Of Boston flyingdutc...@gmail.com wrote: It's from a separate class (runJS does something like mWebView.loadUrl(javaScriptUrl);) In my sample code, the run and runJS are usually executed on the main UI thread (that's why there the await call has a (short) timeout). The WebView's JavaScript execution's callback to Java (setValue in your example) is done on a separate thread (managed by the WebView, i suppose). If you use my code, does the call to 'latch.await' time-out? If so, this means that the WebView never properly loaded the url (code) in the loadUrl call. Look at your LogCat and see what may be the problem. Note that the WebView we use returns false for it's WebViewClient's shouldOverrideUrlLoading method. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Problem evaluating javascript with a semaphore lock
It should read that you can bind your Java code so it is accessible from JavaScript. Obviously the biding is defined within your Java code, and JavaScript assumes existence of said binding. Reading through the example should clarify... On 18 January 2012 17:41, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: You can bind Java code from within your JavaScript by calling *WebView.addJavascriptInterface()*. In other words you could call one method within Java object of your choosing, when user selects A in UI or different method of different object, when user interacts with UI differently. JavaDocs are poor, but fairly good example can be found here: http://mobile.tutsplus.com/tutorials/mobile-web-apps/build-a-contacts-application-with-jquery-mobile-the-android-sdk-part-1/ (have a look at section 'Integrating HTML/JavaScript Based UI With Android Java Back-end') HTH Daniel On 18 January 2012 17:21, Streets Of Boston flyingdutc...@gmail.com wrote: It's from a separate class (runJS does something like mWebView.loadUrl(javaScriptUrl);) In my sample code, the run and runJS are usually executed on the main UI thread (that's why there the await call has a (short) timeout). The WebView's JavaScript execution's callback to Java (setValue in your example) is done on a separate thread (managed by the WebView, i suppose). If you use my code, does the call to 'latch.await' time-out? If so, this means that the WebView never properly loaded the url (code) in the loadUrl call. Look at your LogCat and see what may be the problem. Note that the WebView we use returns false for it's WebViewClient's shouldOverrideUrlLoading method. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: WebView ignore Javascript that invokes PUT/DELETE Http method
...or look at cash control on the server side: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 On 17 January 2012 13:38, Mark Murphy mmur...@commonsware.com wrote: You might look at setCacheMode() on WebSettings, if caching seems to be your issue. On Tue, Jan 17, 2012 at 8:35 AM, Ori Harel ori.ha...@gmail.com wrote: Those are not part of Android, but the problem exist only in Android WebView. Anyway, I solved it by forcing the WebView to ignore the cache by: $.ajax({ type: methode, url: 'some_url?d' + new Date().getTime(), data: JSON.stringify(req), }); As you can see I added a new Date() object creation in order to overcome that caching mechanism. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.7 Available! -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: MVC Architecture
I am with TreKing on this one. The question is very vague. Does Sree want to know about MVC in general? His question certainly looks so. If so, then it's hardly Android SDK, and Wikipedia has an entry for it, so why wasting people time and bandwidth. This list seems to have a lot of noise like that (victim of Android's success) and one receives around 50 posts every hour, out of which maybe 3 are relevant, well formed and interesting. If it is about MVC in Android, then it is still quite generic and speculative, but interesting. I don't think that you implement MVC as such as long as you use Activity and View objects. You could, when taking full controll of the screen, like in a game with your custom UI. In most cases, I think, you are a mere user of MVC implemented by Android SDK. Activity hosts Views so it is a View + Controller, but can easily hold Model objects too, in case when model is small. Model could also be implemented separately by a Service or Content Provider. Daniel On 13 January 2012 08:20, Android2ee mathias.seguy...@gmail.com wrote: Ok, nice first answer. The question is not stupid, because an Activity mix life cycle and view, so implementing MVC is not so obvious. And to make simple, your activity manage lifeCycle and delegate GUI to your GUI package. In that package you do usual MVC. In fact you implement usual layers separation (Model, View, BuisnessService, Service (i mean android service), DAO (that contains usual DAO and your Content providers) and you also have the Communication layer and the transversal one), as usual in Java. You just need to manage your models' life cycle according to your activity life cycle. And it should work. On Jan 13, 6:21 am, TreKing treking...@gmail.com wrote: On Thu, Jan 12, 2012 at 10:46 PM, Sree sreelathapavul...@gmail.com wrote: I want some information about MVC Architecture http://www.justfuckinggoogleit.com/ - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit tracking app for Android-powered devices -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Power harvesting in Accessory mode
Alex, I am not an expert, but ADK assumes that the accessory takes the role of USB HOST on the bus Android --- Accessory. This according to USB standard has very specific power implications, including provision of power to devices connected to USB bus. Host provides the power, while client drains it. I am not aware of a phone that can act as USB HOST (i.e. charging other devices hanging of its USB port) and presumably this is to always protect the battery. USB Accessory for Android talks only about communication and it is a high level standard (no power control from the SDK), which *could* mean that the standard simply assumes that phone always gets charged from the host at the host's full charging capacity (500mA, 5.5V) HTH, Daniel On 13 January 2012 15:15, Alex O. alex.c.olte...@gmail.com wrote: Hello, Let me rephrase my question. If I understand this correctly, an accessory must have its own power source and, moreover, should also provide power to the phone (500mA at 5V for charging power). In this case, it seems that the accesories can only be bulky devices (such as the Arduino board in ADK) with charging cables and no form factor constraints. Or, perhaps, augmentations to extra-battery packs. 1) Is this the scope of the Open Accessory, or am I missing the point? 2) Is there any way that, at least, the accessory should provide its own power, but not have to power the phone as well? Best regards, Alex On Jan 8, 10:27 am, Alex O. alex.c.olte...@gmail.com wrote: Hi all, We are interested in developing an USB dongle for Android devices. We consider implementing the Open Accessory protocol for the dongle, so it would work with both tablets and phones, without changes in the kernel for the Android device. However, if I understand this correctly, the dongle would need to have its own power source and provide 500mA at 5V for charging power. Is there any way to make this dongle without its own power source? Thank you,Alex -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Obfuscate SharedPreferences with ProGuard
Boris, Obfuscating as such makes sense only with the code, since the code does not change its structure, only literal values (i.e. class names, method names, variable names, ...). By obfuscating (renaming all your method names within a class to say a(), you are making it harder for attacker to understand your code once its decompiled. As you see this will be of no use, when trying to protect data, which is your case. You have to look into some encryption solution, but even when the number gets encrypted, nothing stops the attacker to remove said number altogether, or much simpler attack: uninstalling your application. Daniel On 9 January 2012 10:40, Boris Ehlers boris.maccar...@googlemail.com wrote: Hi, Currently I am working on a business application for android which sends among other things IMEI and IMSI via textmessage to a second phone number, in case it assumes to be attacked. Currently the user is able to store the second phone number within the SharedPreferences. But in case Android is rootet, an attacker can easy manipulate the *_preferences.xml - File. For this reason, I would like to follow the obfuscate - approach with ProGuard but I am not sure, whether ProGuard is usable for obfuscating other filetypes than the java - sourcecode. I would highly appreciate other suggestions. Another approach would be to store secure relevant data to a secure element like a smartcard, but not every android device has such an additional hardware- extension. Cheers, Boris -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Best encryption method?
Ian, Only AES and 3DES are encryption/decryption solutions (so called ciphers). MD5 is a crypto hash function no loger deemed safe (there are few much better ones) and Base64 is an encoding used to transfer binary data over text based protocols using only ASCII characters. Daniel On 6 January 2012 10:04, giles ian gilesian@gmail.com wrote: Hello, Which is the best encryption method. My need is to encrypt data and store it in DB. Which would be the best among: 1. Base 64 2. AES 3. 3 DES 4. MD - 5 in terms of: 1. Security 2. Performance 3. Easy of implementation -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] checkbox checked in listview
Vani, Each checkbox has to be a separate object, while it seems like you are adding the same checkbox to every list item. Daniel On 4 January 2012 12:41, saran vonteddu saran.myw...@gmail.com wrote: Hi vani, Uncheck the other checkboxes, its as simple as it is.. regards, Saran On Tue, Nov 8, 2011 at 4:56 PM, NaveenShrivastva kumarnaveen.si...@gmail.com wrote: http://android-codes-examples.blogspot.com/2011/03/listactivity-with-checkbox-using.html On Tue, Nov 8, 2011 at 4:47 PM, vani reddy vani.reddy.bl...@gmail.com wrote: Hi, I have created a custom listview of text and checkbox. When i click on a particular checkbox the other checkboxes in the rows also gets checked. How to avoid this?? -- Regards, Vani Reddy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to Remote wipe SD card
On 9 December 2011 07:44, giles ian gilesian@gmail.com wrote: haha u are funny daniel, I know. ok so, I want to remote wipe data on sd card. I know the code of wiping the data on SD card. What I am struggling with is how to invoke this code remotely. Stand back and think, what you are asking for. The content of the SD card is not yours. It could have many applications that users paid to get. The value of the data stored there is even higher, potentially priceless. If you let people here know, what exactly is a reason behind this functionality and the reason seems valid enough, you might get some help. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to Remote wipe SD card
On 8 December 2011 11:19, giles ian gilesian@gmail.com wrote: Hi All, How to Remote wipe SD card You cannot be serious... In case you are, here is the answer: With a soft antistatic cloth attached to a stick? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Zoom or magnifying glass Effect
It is not trivial graphic transformation. You could use openCV, openGL, or implement it in pure Java. On 6 December 2011 05:20, amit amitsha...@gmail.com wrote: Then how it is possible ?? On Dec 6, 7:40 am, Zsolt Vasvari zvasv...@gmail.com wrote: I'd say this is hard to do if you are not in countrol of the image displayed, i.e., if you are trying to zoom a portion of an arbitrary screen. On Dec 5, 9:12 pm, amit amitsha...@gmail.com wrote: Hello all, i am new on android paltform and i have a assignment to make a Zoom or Magnifying glass effect on android app means when we are click on image(ImageView or Bitmap image) then then clickable area of image is show with zoom effect like a magnifying glass. but i dont know how to do this task please help me for this issue. i am do so many RD with ImageView and Bitmap but im not got success. Thanks in Advance 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Bitmap - Clarity issue
Do you use sub-sampling to create the first bitmap? Can you save the decoded image to a file and add it to gallery? You could then use gallery system app to look at it in great detail. Try zooming-in to see whether you have lost some details or not. Daniel On 7 December 2011 15:17, Jovish P android.f...@gmail.com wrote: In our app we are converting a Base64 string to Bitmap. Assigning this bitmap to an imageview. The problem is the clarity of the image is not good but when I load it in a browser like firefox the clarity is good but at the same time when we load in the mobile native browser the clarity is not good. Any idea how to improve the clarity of the image. Is any attributre I am missing to set properly? This is my code byte[] decodedByteArray = Base64.decode(base64String); Bitmap decodedBitMap = BitmapFactory.decodeByteArray(decodedByteArray, 0, decodedByteArray.length); imageview.setImageBitmap(decodedBitMap); Attaching the screenshots too ... -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Openfeint gives weird error
On 7 December 2011 16:15, Raghav Sood raghavs...@androidactivist.org wrote: Not that I could find. I've spent more than two hours googling this. The closest I came was the same error being mentioned in a Cyanogenmod log published online, but no solution. Thanks https://ofdev.zendesk.com/forums -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Bitmap - Clarity issue
On 7 December 2011 16:27, Jovish P android.f...@gmail.com wrote: Do you use sub-sampling to create the first bitmap? No Good Can you save the decoded image to a file and add it to gallery? Yes , I will save the decoded image to a file and check the clarity of that image. You could then use gallery system app to look at it in great detail. I will look into it . Thanks for your suggestion. NP Try zooming-in to see whether you have lost some details or not. I prefer to use image view instead of webview, clarity is not good even if zoom in the pic I meant that once you have your image saved into a file and available through the gallery app, you can keep zooming-in to find out, whether there were any issues with the decoded image. Also try playing with ImageView.ScaleType and see... you are scaling quite a big image (1280x768) into a very small view. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Openfeint gives weird error
On Thursday, 8 December 2011, Zsolt Vasvari zvasv...@gmail.com wrote: How did you find that? Is there some secret website on the Internets that lets you search for stuff? yes, and it's not a secret. I so BINGed it bro. (even writing it makes me feel dirty... lol) On Dec 8, 12:26 am, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: On 7 December 2011 16:15, Raghav Sood raghavs...@androidactivist.org wrote: Not that I could find. I've spent more than two hours googling this. The closest I came was the same error being mentioned in a Cyanogenmod log published online, but no solution. Thanks https://ofdev.zendesk.com/forums -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Eclipse can't see my alcatel MOVE phone for debug. Please help !!!
On Wednesday, 7 December 2011, Lidia lidyp...@yahoo.com wrote: Hello friends, I have an alcatel move phone, and i do not know what else to do to make my eclipse recognize this phone for debug. I checked on my phone - Application - Development -USB Degugging I installed a driver from Alcatel for this phone (T-Mobile Android Manager), but it is most for account synchornization . Tried with the following commands to see if my device is listed: adb devices sudo adb kill-server sudo adb devices Your driver might be not suitable. I have not tested this, but have a look at this xda thread. Further down there is a link to packaged drivers from Alcatel: http://forum.xda-developers.com/showthread.php?t=1273508page=2 HTH With other phone (android HTC) everything is ok, i installed a driver and successfully debugged with eclipse. But with android MOVE it seems to be impossible to debug. Please , if someone had the same problem and found a solution, help me Thanks in advance, Lidy -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to create a bitmap from binary data?
Vincent, You do realise, that the values you showed in your example are half-bytes? The problem you are trying to solve is not too hard. For each byte received keep detecting the leftmost bit using binary AND operator and appropriate mask. Once you detect 1 add 'black pixel bytes' into your traget byte array. Upon detecting 0 add 'white pixel bytes'. Then binary shift the source data left and repeat detecting the leftmost bit again. Do this in a loop. If your bytes have values 0-15 you will have to shift left by 4 positions before starting to analyse the input. Once your target byte array is ready, use BitmapFactory as suggested by Streets of Boston. HTH On Monday, 5 December 2011, Vincent renws1...@gmail.com wrote: Hi, I want to create images from binary data. e.g. If the binary data is: 0110 1110 0011 1010 1000 0001 1011 1100 0110 1101 0100 0011 1001 0011 which is store in 4*4 bytes { 6 14 3 10 8 1 11 12 6 13 15 0 4 3 9 3 } I want to create a image(might be bitmap) from the binary data, if 1, draw a black pixel, if 0, draw a white pixel so the image would be .. ... ... . . .. .. .. . .... . .. And I will receive new data and refresh the image frequently. Could you give me some hints/suggestions? Android 3.2 (API Level 13) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Measuring FPS method
On 1 December 2011 10:46, Pete Houston pete.houston.17...@gmail.com wrote: I'm currently trying to customize Google Android Launcher; however, on home screen, when I try to fling left-right to move between screens, it doesn't seem to be smooth. I'm wondering how to calculate the frame per seconds when I fling screen left-right? Is there any idea on how to improve Google Android Launcher performance? I'm working on 2.3.3 Gingerbread. Really appreciate your support! Pete, How do you paint the wallpaper? You could write your custom extension of Drawable class and in its draw() method, you could capture the drawing events, thereby increasing the frame count. Then all you have to do is to have timer task that is called every second, to calculate FPS and reset the frame counter. Your performance will depend on how much actual painting happens on the screen. If the transition is very quick (say shift of 480pixels in 0.5 seconds), you could optimise it by not painting everything. Have a look at performance optimisations in ListView, which does quite lot of tricks to speed-up scrolling. 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 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] ARM DS-5
On 30 November 2011 11:44, Narendra Bagade bagadenaren...@gmail.com wrote: How to use this tool? did you try HELP or ARM's on-line documentation? Does anyone has idea about it... some people do... -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] how to copy an object?
On 29 November 2011 09:41, 杨辉 yanghui1986...@gmail.com wrote: Hi: I try to copy an object in android with the method of Serializable,but failed. Your object that you are trying to 'copy' needs to implement interface Serializeable. It is a place-holder interface marking given class as serialiseable. Have a read here [*], then go to find some examples and see, whether it is achievable, what you are trying to achieve. [*} http://docs.oracle.com/javase/1.5.0/docs/api/java/io/Serializable.html -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Speed up dalvikvm calls
On 16 November 2011 17:40, New Developer secur...@isscp.com wrote: Thanks Daniel Iam trying to call it every 5ms But I would settle for as fast as possible. Um... I don't think you have a choice, unless you can settle for impossible. Why do you need 200fps? I have tried so somehow buffer, thus trying to do all the I/O first and then just view but this has failed hopelessly I can only load 15 frames into memory and then get an OutOfMemory Do you by any chance know how to find the bandwidth of the Xoom and Sony S bus what is it capable of If I have to call every 20ms but get a smoother flowing video playback that would be fine. 20ms still gives *very smooth* playback / animation. Go for 40ms - it is still standard for TV, cinema and DVD (give or take). Experiment and see, what is possible, but to be honest I think you either aiming too high or approached it from a wrong angle. If you are displaying it only as 320 x 180, why not transcode the video to that format and save on bandwidth and processing for scaling down? But the most important question is, why don't you use MediaPlayer? I am not sure what are you trying to achieve by extracting frame by frame from a movie clip and displaying them as still images as fast as possible to achieve smooth transitions as in a movie clip. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] sound spectrum analyzer
On 16 November 2011 11:21, ron simon beachboy2...@googlemail.com wrote: Hi Dev. Team, I want to create a spectral analyser but I'am new in this field . For writing a content from a music file in an array I used this try { File file = new File(mFileName, array_spinner[Getposition()]); file.createNewFile(); InputStream is = new FileInputStream (file); BufferedInputStream bis = new BufferedInputStream (is); DataInputStream dis = new DataInputStream (bis); while (dis.available() 0) { dis.read(buffer,byteOffset,byteCount); Ron, How big is your buffer? Where do you manage offset and byte count? You don't check what values did DataInputStream.read() returned. You have to do a bit more management in order to read the whole file into a byte array. Just google for 'reading a whole file in Java' or better still 'copying files in Java'. That should show you, what needs doing around buffers, offsets etc. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Speed up dalvikvm calls
On 17 November 2011 12:25, New Developer secur...@isscp.com wrote: Thank you for your input I'm not needing 200fps, in fact the purpose is to go from 30fps on down to 5fps I'm trying to get a video player that will play at normal speed and then slow down to around 10x slower Have a look at this thread: http://groups.google.com/group/android-developers/browse_thread/thread/68faac2c99db7b96/679f0aca6422ab41 It uses a trick of pausing MediaPlayer whilst playing the video for short periods of time to achieve slow-mo. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Speed up dalvikvm calls
On 17 November 2011 14:05, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: On 17 November 2011 12:25, New Developer secur...@isscp.com wrote: Thank you for your input I'm not needing 200fps, in fact the purpose is to go from 30fps on down to 5fps I'm trying to get a video player that will play at normal speed and then slow down to around 10x slower Have a look at this thread: http://groups.google.com/group/android-developers/browse_thread/thread/68faac2c99db7b96/679f0aca6422ab41 It uses a trick of pausing MediaPlayer whilst playing the video for short periods of time to achieve slow-mo. Lol, that thread back in May included you. Ignore me. I would rather research painting on a transparent pane overlaying the MediaPlayer, but it seems you have tried that. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Speed up dalvikvm calls
On 16 November 2011 15:48, New Developer secur...@isscp.com wrote: Hi all, I have a runnable thread which is called every 5 ms mHandler.postDelayed(buffering, 5); Yet from the LogCat it is taking much longer. 11-16 10:32:14.110: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free 23172K/27463K, paused 25ms 11-16 10:32:14.420: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free 23172K/27463K, paused 25ms 11-16 10:32:14.720: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free 23172K/27463K, paused 24ms 11-16 10:32:15.030: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free 23172K/27463K, paused 25ms 11-16 10:32:15.330: D/dalvikvm(1945): GC_FOR_ALLOC freed 1801K, 16% free 23172K/27463K, paused 25ms Is there a method to speed up this call and reduce the paused 25ms time ? There should be a TURBO option in the phone somewhere. But honestly you creating 1.8MB of garbage (dereferenced objects) 3 times within each second, so your GC runs like crazy. Things to look at: - Avoid repeated string concatenation - Pre-size your collection data structures - Keep caches of frequently-used values rather than reallocating them - Eliminate references to objects promptly when you no longer need them. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Speed up dalvikvm calls
On 16 November 2011 16:45, New Developer secur...@isscp.com wrote: Thanks to all It is a video player I'm using the MediaMetadataRetriever so that I can load and if necessary stop and edit a bitmap I've tried (obviously unsuccessfully to read the bitmap and make it smaller (for the purpose of memory) the original video is 1280 x 720 I was trying to save this as a 320 x 180 bitmap so as to use up less memory mBitmap = Bitmap.createScaledBitmap(retriever.getFrameAtTime(frame*1000) , 320 , 180 , false); Item.setImageBitmap(mBitmap); // 1280 x 720 Here ^^^ mBitmap is 320x180, however retriever.getFrameAtTime() returns the full thing... How often is this code called? Do you know, that retriever does I/O to pull the frame out? Are you trying to have it running every 5ms? Do you appreciate that 1280 x 720 x 4B = 3.5MiB and if you want that every 5ms, then your I/O bus and memory bus would have to have bandwidth of 700MiB (assuming processing takes zero time in the 5ms slot, which obviously it doesn't). That is a big ask for any mobile phone. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Urgent help required
issue. On Thu, Nov 10, 2011 at 10:56 PM, Sunil Mishra ... read more » -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Urgent help required
On 11 November 2011 14:23, Sunil Mishra suniljmis...@gmail.com wrote: @skink and @Dainel According to me URL translation is like follows 1. Read the html file before sending 2. Grab the relative url 3. Convert it to absolute url 4. Write the html file with the converted absolute url Please correct me if i am going wrong. Or provide me a link which explains about URL translation. Not quite. Have a look here: http://en.wikipedia.org/wiki/Web_server#Path_translation URL translation happens for every HTTP request. User at the browser knows only URL. Http server knows how to translate the URL to a file on a file system, in order to serve it back to the client. Http server serves a web page as is. No URL rewriting here. It is the browser, that upon receiving of a given page, in subsequent requests demands all referenced resources (images, css, js, ...). In those subsequent requests, server has to translate every URL to the path of a file, that the user requested. That is it. Daniel On Nov 11, 6:51 pm, skink psk...@gmail.com wrote: On Nov 11, 2:43 pm, Sunil Mishra suniljmis...@gmail.com wrote: As a workaround i tried storing the image in app_images folder in sdcard and trying to provide the url of that path. But still the issues exists. Is there any other work around possible?? And do you have any clue On Nov 11, 5:18 pm, Daniel Drozdzewski daniel.drozdzew...@gmail.com wrote: Daniel already gave you an answer: To achieve this, your server has to do translation from URL 'images/ topWrapper-bg.jpg ' to a file path within your storage '/yourstorage/ yourwebserver/ wwwroot/webisteA/ images/ topWrapper-bg. jpg'. pskink -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Incorrect output values with gluUnProject… why?
gl.glTranslatef(x, y, z); //Move z units into the screen //gl.glScalef(0.8f, 0.8f, 0.8f); //Escalamos para que quepa en la pantalla //Rotamos sobre los ejes. gl.glRotatef(xrot, 1.0f, 0.0f, 0.0f); //X gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f); //Y gl.glRotatef(zrot, 0.0f, 0.0f, 1.0f); //Z //Dibujamos el cuadrado square.draw(gl); mg.getCurrentProjection(gl); mg.getCurrentModelView(gl); } //si el surface cambia, resetea la vista, imagino que esto pasa cuando cambias de modo portrait/landscape o sacas el teclado físico en móviles tipo Droid. public void onSurfaceChanged(GL10 gl, int width, int height) { if(height == 0) { height = 1; } gl.glViewport(0, 0, width, height); //Reset Viewport gl.glMatrixMode(GL10.GL_PROJECTION); //Select Projection Matrix gl.glLoadIdentity(); //Reset Projection Matrix //Aspect Ratio de la ventana GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f); gl.glMatrixMode(GL10.GL_MODELVIEW); //Select Modelview Matrix gl.glLoadIdentity(); //Reset Modelview Matrix } public boolean onTouchEvent(MotionEvent event) { float [] outputCoords=getOpenGLCoords(event.getX(), event.getY(), 0); x=(outputCoords[0]/outputCoords[3]); y=(outputCoords[1]/outputCoords[3]); //z=outputCoords[2]/outputCoords[3]; Log.d(X, X: +x); Log.d(X, Y: +y); return true; //El evento ha sido manejado } public float[] getOpenGLCoords(float xWin,float yWin,float zWin) { int screenW=SectionManager.instance.getDisplayWidth(); int screenH=SectionManager.instance.getDisplayHeight(); //CODE FOR TRANSLATING FROM SCREEN COORDINATES TO OPENGL COORDINATES float [] modelMatrix = new float[16]; float [] projMatrix = new float[16]; modelMatrix=mg.mModelView; projMatrix=mg.mProjection; int [] mView = new int[4]; mView[0] = 0; mView[1] = 0; mView[2] = screenW; //width mView[3] = screenH; //height float [] outputCoords = new float[4]; GLU.gluUnProject(xWin, ((float)screenH)-yWin, zWin, modelMatrix, 0, projMatrix, 0, mView, 0, outputCoords, 0); return outputCoords; } } -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] ARMy of one?
On 1 November 2011 15:23, bob b...@coolgroups.com wrote: Is it true that almost all Android phones are powered by an ARM chip made by ARM company in England? Why would you ask such question to this group and subject yourself to ridicule, rather than simply type your question into Google and have the instant answer? -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Google+ App consumes phone memory
On 31 October 2011 15:09, Neil neil.gh...@gmail.com wrote: Hi All, I installed Google + app for android in my Samsung Galaxy ACE. It got installed in SD card according to the Application Manager However when I check back the phone memory usage , it shows me that 17 mb less. For this reason I am getting low phone memory warning and unable to use the app. Since it is installed in SD card it should have been consuming memory in SD card not in phone memory. When I uninstall the app I got the phone memory back. Neil, This list is not for sharing of stories of Android users. Applications consume memory. SD card is a storage where the app got saved, not where it runs. When you open it, OS loads it to main memory (RAM) in order to execute it and that is where your warnings come from. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Conversion to Dalvik format failed with error 1
On 25 October 2011 17:08, Pius Njoka piusnj...@gmail.com wrote: Am adding jaxrpc.jar to my android project and i get the following issue [2011-10-25 18:26:25 - loyaltycardapplication] Dx trouble processing javax/xml/messaging/Endpoint.class: Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. Pius, JAX-RPC cannot be simply imported to your project and run on Android, as it has platform dependencies. Please have a look at the following page to see, what are the supported platforms: http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.5/ReleaseNotes.html However you can go and use any other pure Java XML-RPC implementation, that will simply compile for Dalvik without a problem. Have a look at these two open-source projects: http://ws.apache.org/xmlrpc/index.html http://xmlrpc.sourceforge.net/ Good Luck! -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Concerning CPU Occupancy
On 20 October 2011 09:55, Hiko hikosais...@gmail.com wrote: Hi, I implemented a widget to display a CPU occupancy. CPU occupancy is taken from cpu information in the /proc/stat. I faced a problem. CPU occupancy is raised rapidly at the moment when this cpu occupancy widget is on the home screen. I have one question. Is CPU occupancy raised when a widget is on the screen? You should only read the /proc/stat file and render the results then wait for prolonged period of time (refresh rate say 5 seconds, or possibly even longer) doing nothing. Do you have an active loop, that checks for changes in this file? Daniel -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Android UI designing .
Friend List as ListView, with each list element as a relative layout of left flushed ImageView and two TextViews for 2 latest twits to the right of the image. On 20 October 2011 13:50, Ashish Tiwari ashish...@gmail.com wrote: https://lh5.googleusercontent.com/-gKWMCY-YrOQ/TqASpqk2NKI/Al0/yMglyHAFkac/android_listview.jpeg hi friends, I'm new to android development , I'm designing an UI something like the above, There is a friend list and their two tweets(List), What will be the best solution to design this UI ? -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] video uploading to youtube account by using Youtube api
On 19 October 2011 10:43, Ravinder Reddy ravinderjre...@gmail.com wrote: How to upload videos in to youtube account from my android application.(By using Youtube API) Any sample code please share with me. Description and code samples: http://code.google.com/apis/youtube/2.0/developers_guide_java.html#Uploading_Videos -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to store cookies in an application for future use?
On 11 October 2011 16:06, Christopher Van Kirk christopher.vank...@gmail.com wrote: Isn't the point of cookies that all this sort of work is done for you? If not, then perhaps you should consider storing (and accessing) the data in an alternative way. That is true... a web browser has to confirm to cookie contract, whereby it has a global cookie storage and attaches cookie to each request to the domain that cookie originated from. In Shruthi's case it is his application that has to fulfil this contract, in case he is using web view. As Mark suggested, retrieve and save to a file or a DB all cookies from a session upon exit and revert the process upon re-entry to the application. You could integrate it even more, by implementing your own CookieStore interface, that automatically uses storage or DB behind the scenes. Have a look at the following point: http://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.html#d4e816 -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to store cookies in an application for future use?
On 11 October 2011 16:41, Christopher Van Kirk christopher.vank...@gmail.com wrote: Hmm. Still sounds a bit dodgy. One wonders why this guy's use case necessitates him building a new browser, and whether a well placed intent would achieve his goal with a lot less effort. Point taken... sometimes http client use could mean something else than just a browser. Maybe presence of a cookie (acquired through a legit interaction via web view) is being verified in some REST api call... you never know. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Email formate validation
On 6 October 2011 15:12, Chris crehb...@gmail.com wrote: This regex pattern should match email addresses: [A-Za-z0-9_]+([-+.'][A-Za-z0-9_]+)*@[A-Za-z0-9_]+([-.][A-Za-z0-9_]+)*\.[A-Za-z0-9_]+([-.][A-Za-z0-9_]+)* Regex is a bad way to validate an email address. You risk to run out of resources (some very long regexes), annoying people with real but weird email addresses and people will still register using throw away email accounts. If you need to know for sure that email is valid, make 2 step registration with a link sent to said email address with one-time ID'd link back to your validator. If however you don't run a bank or serious commercial operation, take pretty much any email thrown at you and your emailer should remove bouncing ones from its database. Please read the following: http://www.regular-expressions.info/email.html http://www.codinghorror.com/blog/2005/02/regex-use-vs-regex-abuse.html http://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses http://fightingforalostcause.net/misc/2006/compare-email-regex.php -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Serializable subclass of non-serializable class
JM, sorry I missed your reply among 100s of emails yesterday... On 5 October 2011 17:18, Jean-Michel jeanmichel.caz...@gmail.com wrote: Daniel, sorry to be a pain in the bum, but there are still 2 things I cannot figure out. First I am not sure what you mean by DTO, but from what I understand it is basicaly a place holder for the data in my non-serilizable class. I understand how to transfer dta (the one I care about) between LocationDTO and Location. It is not a place holder. It is actual data holder and Location is left alone. You do the following: 1. Define LocationDTO that implements Serializable, which will store all data that you need from Location. 2. When you are about to persist your Location to storage, you populate that DTO with the latest values from Location. 3. You serialize DTO and persist resulting stream. application is OFF here 4. Upon re-launch of your application, you read the serialized DTO from the storage, therefore de-serializing the DTO. 5. Create brand new Location (Location loc = new Location()) and populate all its properties from deserialized DTO. As you can see, you have not serialized or deserialized Location class (or any of its subclasses) at all, therefore avoiding all the troubles that you have with it. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Serializable subclass of non-serializable class
On 5 October 2011 15:09, Jean-Michel jeanmichel.caz...@gmail.com wrote: Hi there, I am hitting a brickwall with serialization of a subclass of Location (probably more a Java question actuall, but let's try anyway). Location is not serializable. I have a first subclass called FALocation that does not have any instance variables. I have declared it serializable. You cannot do that in Java. Implementing serializable subclass of non-serializable super class will blow out, simply because to de-flatten the object back, you need to create its superclass, but it did not get serialized (since it's not serializable). A bit recursive explanation, but I hope you understand. Here is, what serializable class has to do, to fulfil the contract: - Implement the Serializable interface. - Make sure that instance-level, locally defined state is serialized properly. - Make sure that superclass state is serialized properly. - Override equals( ) and hashCode( ). You skipped the 3rd point. Now luckily for you, Location in Android implements Parcelable interface, which could be of help, depending where are you sending to and receiveing from your Leg/Location related data. If it is within the same machine between a service and an activity, then you are fine. If you are passing it via network, you need to implement a DTO, that implements Serializeable and holds all the necessary data that you depend on. You then pass that DTO and with its help you create new Location object at the receiving end. HTH -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Serializable subclass of non-serializable class
On 5 October 2011 16:20, Jean-Michel jeanmichel.caz...@gmail.com wrote: No, I am serialising to disk. Do you think it could work out? Any idea how to use Parcelable ? Many thanks, Jean-Michel Jean-Michel, Parcelable is used for inter-process communication and is designed specifically for that (i.e. passing the data between services and activities). In order to save it to disk, you have to create mentioned DTO. It can sound serious, but it is simple: class LocationDTO implements Serializable { //all properties extracted from Location that you need //... with all getters and setters. } When you need to preserve the location, you create this DTO, populate all properties yourDTO.setAcuracy(yourLocation.getAcuracy()); ... and preserve this DTO. Then when you need it back in memory, you deserialise this DTO, create new Location object and populate its properties from DTO. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Why most file browsers are implemented as activities?
On 4 October 2011 09:37, Peter ptr...@gmail.com wrote: Folks, I have been looking around for code that would let users select a file from the sd card. I have seen a few implementations for such an open file dialog. However, all of them have been implemented as activities and not as a dialog. I am wondering why developers are implementing it this way. For me, it appears open file must be a dialog. Must is a strong word. You are used to desktop file selectors, where in most cases they are just a pop-up dialogs. However in mobile it makes more sense for the file selector to occupy as much screen as possible. Otherwise you will end up with a dialog that in landscape mode displays max 3 files and browsing involves lots of fast (i.e. inacurate) scrolling. Please also mind, that mouse pointer in desktop environment is 1px. With touch screen we are talking pointers 5 x 5 px all the way up to 20 x 20 in high res sreens. That is not to say that file selector would not work as a dialog. It would most likely require some very neat and clever UI tricks. Feel free to innovate and implement one. When done right, people will write articles about it. -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] How to back up call history programmatically
On 4 October 2011 10:27, GopalaKrishnan D gopall...@gmail.com wrote: How to back up call history programmatically *call* and *history* have more than one meaning in the context of Android SDK programming. Do you mean actual phone call history? -- Daniel Drozdzewski -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en