**** BEGIN LOGGING AT Thu Jul 09 10:11:52 2009 Jul 09 10:16:27 i'm trying to add a imagebutton to my widget. if added the imagebutton, set a source, made the layout settings... do i have to do some more for it to show up? Jul 09 11:04:02 hi all, wondered if anyone can help me with this: holder.statusbutton.setImageDrawable(getResources().getDrawable(R.drawable.unpaid_button)); Jul 09 11:04:45 getResources is saying cannot make a static ref to a non-static method Jul 09 11:13:46 i thinnk I need to add a new context, still trying to understand context Jul 09 11:24:25 johnnyzen: what type of object is holder? Jul 09 11:25:08 static class ViewHolder Jul 09 11:25:37 what's a viewholder? Jul 09 11:25:50 you can't have a static class Jul 09 11:26:21 you can have static methods but not a static class :) Jul 09 11:26:23 just a class to hold ref e.g: ImageButton infobutton; as per Romain Guys's tricks to optimise layouts Jul 09 11:27:04 Amorgos: taken from: http://code.google.com/events/io/sessions/TurboChargeUiAndroidFast.html Jul 09 11:27:35 in java, when ou get the error "cannot make a static ref to a non-static method".. it meeans that you are calling a method which is not static Jul 09 11:28:28 intersting, I still dont understand when to use static and non-static. when I start using static methods, I always end up making other methods static to stop that error message. Jul 09 11:28:49 so i end up with a whole class full of static methods. Jul 09 11:29:55 I'd recommend you take time to read a book on basic java. It'll make your android life much easier. This is key java stuff and you'll struggle with android if you're not familiar :( Jul 09 11:30:31 for example, within a static method, I need to call another method, but that method I am calling is non-static, so hence the error. Jul 09 11:31:20 yes, I should get my head around static and non static, - i did try to read about this, I will read again Jul 09 11:31:22 well yes, that's because a non-static method is called on an object, not a class. Jul 09 11:32:13 an object is an instance of a class Jul 09 11:32:28 AClass object = new AClass(); Jul 09 11:32:37 object.nonStaticMethod(); Jul 09 11:32:44 AClass.aStaticMethod(); Jul 09 11:33:25 a ha. Jul 09 11:34:07 so static uses the class directly and non-static uses the instance ? Jul 09 11:34:55 yes Jul 09 11:35:12 you create a static method for general things Jul 09 11:35:26 you create a non-static method for things only for that object Jul 09 11:35:31 i think Android is wrong way when AspectJ/AspectWerkz/GluonJ is used Jul 09 11:36:35 ok, thanks, I will try to understand this in my code :) Jul 09 11:41:58 But i'd DEFINETLY recommdend picking up a basic java book. It's impossible to code android without knowing it. It is java after all. Jul 09 11:45:47 Why is this channel full of so many people and so very very quiet!? Jul 09 11:53:21 .... no answer :) Jul 09 11:55:54 everyone is busy coding :) i'm trying to learn :) Jul 09 11:57:44 Out of interest johnny, what are you trying to code? :) Jul 09 12:01:18 why dont we have opensource 3g or LTE stack for telephony :p Jul 09 12:11:27 Amorgos: just a custom list with buttons :) Jul 09 12:12:39 vinzy: write one for gnu radio ;) Jul 09 12:16:34 anyone here asked by netdragoncompany.cp for app distribution to chinese market? Jul 09 12:17:07 mharkus: no, but what are they? Jul 09 12:18:50 http://ir.netdragon.us/ Jul 09 12:18:57 primarily working on online game development Jul 09 12:19:21 * Ge0rG was already called by chinese gold farmers... but nobody wanted my appz Jul 09 12:19:57 but they asked me to translate my apps to chinese and sell it via http://android.sj.91.com/ Jul 09 12:20:24 i got an email from some chinese too Jul 09 12:23:10 This is Whynonna writing from NetDragon Websoft Inc. (China). Jul 09 12:23:12 our company website: www.nd.com.cn, and the English website: http://ir.netdragon.us welcome you review it freely. Jul 09 12:23:26 Currently, we can only provide free service to translate and distribute free or trial versions. If you have other apps Jul 09 12:24:30 "This is Eva Zhao from Android Business Department of NetDragon Company" - this is what I got Jul 09 12:25:15 maybe diferent people because you have a paid app? Jul 09 12:25:38 I only have free apps Jul 09 12:25:47 dont china have android market? Jul 09 12:26:15 the certain carriers may not Jul 09 12:26:15 i think they are being blocked from accessing google sites? Jul 09 12:27:15 my big concern is that im going to get a flood of chinese emails Jul 09 12:27:20 and not be able to respond Jul 09 12:27:27 ive already gotten a few and my app is only in english Jul 09 12:27:31 blau: google-translate :D Jul 09 12:27:35 lol Jul 09 12:28:04 hi. System.getProperty("user.dir") returns null, is this expected behaviour or did i miss something? Jul 09 12:28:13 what kind of emails are you getting? or i suppose, you don't know seeing as ou can't understand them :) Jul 09 12:28:30 they look short Jul 09 12:28:37 lol Jul 09 12:28:58 ????LED???,??????!???! Jul 09 12:29:05 what app have you developed to make the chinese interested? Jul 09 12:30:18 the 2 i was contacted about were dg alert and dgaway Jul 09 12:30:29 a couple of widgets..fml widget and moon phase..both free Jul 09 12:30:52 what do the widgets do? Jul 09 12:30:57 i made a fml proof of concept Jul 09 12:32:28 i got this off the web.. "FML Widget is a widget that displays latest FMLs from FML website. Updates every hour. " Jul 09 12:32:32 the fml widget simply pulls fml items and displays it..the moon phase just displays the phase of the moon.. :) Jul 09 12:32:36 ok.. so what's an FML? :) lol Jul 09 12:32:37 yeah Jul 09 12:32:53 http://fmylife.com/ Jul 09 12:33:21 collection of people's F*** my life experiences.. Jul 09 12:33:25 ah ok Jul 09 12:33:54 lol, that's not a straightforward translation to chinese is it ? :D Jul 09 12:35:13 maybe they will just need to translate the app's strings.xml, not the data being pulled from FML site Jul 09 12:35:56 yeah, but the data from the FML site is kinda the important bit though! No point in translating the app if the content is in english Jul 09 12:36:22 yeah Jul 09 12:37:05 Thats what i like about android dev though, it almost forces your app to become very easily translatable Jul 09 12:40:04 so mharkis, out of interest, how much interest have you had up to now? Jul 09 12:40:11 mharkus Jul 09 12:40:41 in the application i mean, how many people are using it? Jul 09 12:51:41 is it allowed to add subfolders to res/ ? Jul 09 12:53:30 tarzan: no i dont think you are Jul 09 12:53:38 it's pretty strict with that stuff Jul 09 12:53:59 it's annoying not being able to add subfolders to the drawable folder Jul 09 12:54:44 if i want to deliever multiple jars with my application (dexed osgi bundles), where should i put these to be deployed? Jul 09 12:55:24 what's a "dexed osgi bundle" jar? Jul 09 12:57:50 its basically normal jar containing classes which are loaded at runtime by the osgi environment i am using. currently im manually pushing them with adb to the sdcard Jul 09 12:58:21 dexed = using dx / aapt to add classes.dex to the jar Jul 09 12:59:03 but it would be nicer if i had a folder in my eclipse project which is pushed to the emulator when the application is deployed Jul 09 12:59:11 well, if you're android project is referencing them in eclipse, it will bundle them with the rest of your code it will convert the java bytecode to dalvik Jul 09 12:59:32 that's the point, there are no references Jul 09 12:59:46 at least not to all of the jars Jul 09 12:59:57 well, can't you make them references? Jul 09 13:01:10 i don't want to, is there no other way to do this? Jul 09 13:02:02 have you tried putting them in the assets folder of your project? Jul 09 13:02:25 so maybe you could manually do what you need from code and access them from there Jul 09 13:05:04 will the files in the assests folder be deployed somewhere to the file system where i can read them or is AssetManager the only way to get the files? Jul 09 13:09:52 i dont know if the AssetManager is the only way to access the files Jul 09 13:10:11 ok thanks, i will continue reading the docs and googling :) Jul 09 13:11:11 np Jul 09 13:16:29 How to place two radio's next to each other ... I tried relative layout but radios need radiogroup :( Jul 09 13:18:09 radio buttons are sorely neglected on mobile platforms Jul 09 13:19:18 ic ... tnx Jul 09 13:20:10 how can I make a list like the songs list on the music player, or the prefs list, or any list that has icons at the right of the items Jul 09 13:20:48 Skail, download the Apidemos example project from google, and go from there Jul 09 13:20:52 if the text is "wrap_content" the icon doesn't go at the right, but if the label is fill_parent, it pushes the icon off the edge Jul 09 13:21:39 the docs say this is because the text doesn't know how much space the icon is going to need ahead of time, but that gives no hint as to the solution Jul 09 13:22:50 I can't realy visualise what you're trying to do Jul 09 13:23:09 have you considered another Layout type? Jul 09 13:23:32 Amorgos: think of the preferences lists. there is some text, with often an icon or checkbox at the right Jul 09 13:23:47 I've been trying all the layouts, I just don't see how to get the right result Jul 09 13:24:13 Table layout? Jul 09 13:24:29 i've done kinda the same thing. text on one side and icons on the right Jul 09 13:24:47 you should be able to set the android:layout_width of the image. i think that might be the right direction for you. Jul 09 13:25:27 setting the width of the image is no help, because the system parses the text label first, and uses up all the space if it's fill_parent Jul 09 13:26:00 dont use fill_parent. the very definition of that option is "use all space" Jul 09 13:26:23 for each item i your list, you could have a tablelayout inside them. that'll work Jul 09 13:26:23 kaay: yeah, obviously, but then how else does one get the text to fill the space? Jul 09 13:27:00 you can use wrap_content and android:layout_weight Jul 09 13:28:40 oh lovely.... wrap_content is only wrap_content with no weight.... Jul 09 13:28:52 kaay: that seems to do exactly what I need Jul 09 13:28:55 thanks! Jul 09 13:30:03 * Skail mumbles something about the docs not having mentioned this special little behaviour :) Jul 09 13:30:30 there's a lot lacking in the docs :/ Jul 09 13:31:34 hi. Jul 09 13:31:59 most docs do "leave em wanting more" :) Jul 09 13:32:32 I'd like to use some non-sdk functions, (for personal use, not for sale, so i dont care that its not API stuff). how do I do that ? Jul 09 13:32:41 android docs are fantastic compared to iphone :) Jul 09 13:32:48 to be more specific, I want to use bluetooth related functions. Jul 09 13:33:50 unwesen: fantastic compared to the docs for a LOT of other things, really. We don't really have TOO much cause for complaint. Jul 09 13:34:15 nope, that's what I'm saying. iPhone just sticks out like a sore thumb Jul 09 13:34:27 and when the docs don't tell you what you need to know, you can read the source Jul 09 13:34:47 is the iphone easy to develop with (apart from shitty docs that is) ? Jul 09 13:34:56 kind of Jul 09 13:35:21 it's fairly easy if you stick to what the examples do, or if you start everything from scratch and bypass the SDK as much as possible. Jul 09 13:35:24 uh Jul 09 13:35:26 objective c Jul 09 13:35:30 * AakashPatel barfs Jul 09 13:35:39 twisting the SDK into something it's not designed for isn't a source of joy, though Jul 09 13:35:48 android's APIs are a lot more flexible in comparison Jul 09 13:36:01 syntactically and aesthetically, I'd prefer objective C over C++ any day Jul 09 13:36:05 and yes, objective-c ain't pretty, but it's not the worst part by far. Jul 09 13:36:12 objective c != c++ Jul 09 13:36:20 very different things Jul 09 13:36:54 both programming languages... :) Jul 09 13:37:06 :D Jul 09 13:37:07 i tried objective c Jul 09 13:37:11 it made no sense hha Jul 09 13:37:11 I'll grant you that Jul 09 13:38:45 eh, I can't say I like objective-c, but I don't like perl either, and can use it. Jul 09 13:39:31 you get things done Jul 09 13:40:25 someone can help with this -> http://www.anddev.org/viewtopic.php?p=24125#24125 ? Jul 09 13:41:46 patrick: have you looked in logcat for a stacktrace? Jul 09 13:42:04 no Jul 09 13:42:12 I'll do it Jul 09 13:42:37 look in Logcat first. then irc/forums ;-) Jul 09 13:43:04 patrick91: move setContentView before findViewById ? The stack trace would help Jul 09 13:43:24 ok Jul 09 13:43:34 setContentView(R.layout.view_odl); .. where is view_old? Jul 09 13:43:38 odl even Jul 09 13:44:03 good point :) Jul 09 13:44:03 it's not in that layout Jul 09 13:44:23 R.layout.view_odl is the layout Jul 09 13:44:51 but the top level LinearLayout has no id called view_odl Jul 09 13:45:57 unwesen: patrick91: move setContentView before findViewById ? The stack trace would help <- It works thanks :D Jul 09 13:46:08 yw :) Jul 09 13:46:37 Amorgos: but the top level LinearLayout has no id called view_odl <- I don't need the id Jul 09 13:47:05 ah yes of course Jul 09 13:47:55 and setContentView inflates the view, so you wouldn't have found the textview before it was inflated. probably causing the error Jul 09 13:50:04 do applications need special permissions to access files stored on the sd card? Jul 09 13:50:53 do you get a permission exception in logcat when you try? Jul 09 13:52:50 tarzan: not generally, no Jul 09 13:53:56 Amorgos: no Jul 09 13:54:03 unwesen: thanks, i thought so Jul 09 14:02:08 <_Roman> I have a string stored in the strings.xml file. How can I go about getting the text out of this string within my code? Jul 09 14:02:34 getSTring(R.strings.my_sting_name); Jul 09 14:03:59 <_Roman> Amorgos: eclipse wont let me call getString(). It is undefined. What is it a method of? Jul 09 14:04:25 Context Jul 09 14:05:30 <_Roman> How do I go about calling it? my method does not have a context object passed to it (nor can it). Can I just create a new Context object? will that work? Jul 09 14:06:13 no. you'll have to pass a context object to it. why can't you pass a parameter to your method? Jul 09 14:06:17 <_Roman> no apparently not, you can not instantiate Context directly. Jul 09 14:07:13 <_Roman> I am implenting a SQLiteOpenHelper subclass, I need to get the string in onCreate(). Jul 09 14:07:44 <_Roman> Actuially I have just realised that the Context is passed in on the constructor, so I can just store a private reference to it in my object Jul 09 14:08:13 yeah, so you can just make the context a parameter and get it from there Jul 09 14:08:44 <_Roman> just make the context a parameter?? what do you mean by that? Jul 09 14:08:55 <_Roman> instance variable? Jul 09 14:09:03 i mean the Context an instance variable yes :) Jul 09 14:09:23 _Roman: What class are you trying to do this in? what does it inherit? if it's any sort of activity then "this" is a context instance Jul 09 14:09:36 <_Roman> ok, cool. Just a little bit new to java, so just want to make sure that I do not misunderstand things. Jul 09 14:11:10 <_Roman> I am inheriting from the SQLiteOpenHelper class. I want to store my database creation statements outside of the class to keep things neat and tidy, so I thought I would use strings.xml to store the statements for use in the onCreate() method. Jul 09 14:12:20 well then you'll need to pass a context parameter to your SQLiteOpenHelper subclass from the activity that is using it Jul 09 14:12:24 Roman: there's a good example of that in Professional Android Development by Wrox. I was doing the same thing about an hour ago :) Jul 09 14:14:21 <_Roman> Amorgos: I will buy that now. btw. is it just me or are the official docs on developer.android.com not that great? Jul 09 14:15:43 i think the docs are alright. theres always a few things missing. if you do the tutorial and exercises i think you'll have a decent understanding of the fundamentals. Jul 09 14:16:05 <_Roman> thanks for all your help. Jul 09 14:16:12 they're 80% ok atm. better than 95% of frameworks :) Jul 09 14:16:23 doc_savage, great idea last night :) Jul 09 14:16:37 titefuzz: it worked? :) Jul 09 14:16:44 yes but now i have another problem... Jul 09 14:17:04 now if i do setcontentview... or create an activity and use startactivity() all i get is a blank screen Jul 09 14:18:14 but yeh, main program should always extend activity Jul 09 14:18:21 hmm, do you get a normal view on the first call to it? what's in the XML? Jul 09 14:18:42 theres two different layouts i have tried Jul 09 14:18:53 one is a linearlayout with a listview and a button Jul 09 14:19:22 titefuzz: I think you're ok to use a ListActivity as the main, but ListActivity *requires* that you have a listview within, so when you changed to another layout, it got upset Jul 09 14:19:39 yeah Jul 09 14:19:44 are these the same XML files you were using before when it was ListActivity (and they worked)? Jul 09 14:19:50 yes Jul 09 14:19:57 hmmm Jul 09 14:20:00 * doc_savage scratches head Jul 09 14:20:02 well, one is the same, and one is a new one Jul 09 14:20:32 i dont really see anything in the log that throws off a red flag Jul 09 14:21:47 so in onCreate your calling setContentView, and nothing is displaying... can you post the XML pastebin? Jul 09 14:22:14 no, the main menu displays fine Jul 09 14:22:24 but when i try to call setcontentview to change the layout Jul 09 14:22:37 in a button click event Jul 09 14:22:46 it changes to a blank screen Jul 09 14:23:28 http://pastebin.com/m21f6494f Jul 09 14:24:17 and that worked before (displayed ok)? Jul 09 14:24:42 yep Jul 09 14:24:45 im wondering Jul 09 14:26:12 I'm not 100% on the changing views mid-way through, would it not be better to have 2 activities? So when they press "add task" on the main menu, it spawns a new activity to add the task, then returns to the original? Jul 09 14:27:04 well thats what i tried for add task but i still got a blank screen, but i think i may have fixed it, testing it now Jul 09 14:27:14 nope :( Jul 09 14:27:15 ah ok :) Jul 09 14:27:47 let me whack that XML into one of my projects so we can see if it's the XML or something else going screwy Jul 09 14:28:12 well Jul 09 14:28:15 i have one other idea Jul 09 14:29:54 btw, has anyone had there emulator freeze before loading Jul 09 14:30:08 and the log has a few lines with type qemud Jul 09 14:31:07 so, i ave added both a constructor and the oncreate method to my addtask activity and used setcontentview but still blank Jul 09 14:31:44 so... user clicks menu to add task, and you call setContentView again to change the layout to that one, and that's where it goes blank? Jul 09 14:31:51 the first view your using works fine? Jul 09 14:32:27 yeah Jul 09 14:33:16 lol omg Jul 09 14:33:35 sry saw something funny on the highway Jul 09 14:34:29 ooooo Jul 09 14:34:33 lol I got visions of you then, driving along with a laptop balanced on the dash Jul 09 14:34:54 lol nah, im looking out the window of my office theres a highway right out here hehe Jul 09 14:35:14 some dude in a motorized wheel chair holding up traffic in the right lane Jul 09 14:35:15 classic Jul 09 14:35:21 haha quality Jul 09 14:35:33 ok Jul 09 14:36:12 now i get an unable to instantiate activity error... Jul 09 14:36:29 I'm not sure on the workings of setContentView, and whether it should be called twice, it says "This view is placed directly into the activity's view hierarchy." so I don't know whether it properly replaces the current view Jul 09 14:36:29 i guess my activity should be a seperate class Jul 09 14:37:02 that's the route I'd take, create a new activity class, get it to setContentView the new view, and just start that activity from the first Jul 09 14:44:32 *crosses fingers* Jul 09 14:45:43 :( Jul 09 14:45:48 uh oh Jul 09 14:46:16 still blank? Jul 09 14:47:12 unable to instantiate class error, wondering if i missing a method thats required to be overridden Jul 09 14:48:14 you're starting the new activity with an intent? and have added the new class to androidmanifest.xml? Jul 09 14:48:23 yeah Jul 09 14:49:05 super.onCreate(savedInstanceState); Jul 09 14:49:05 setContentView(R.layout.addtask); Jul 09 14:49:13 thats my oncreate method of my addtask class Jul 09 14:49:37 it's public, returns void, the class extends activity, you have activity imported for that class? Jul 09 14:49:40 Why is the market not installed on emulator? Jul 09 14:49:52 Intent i = new Intent(TaskManager.this,AddTask.class); Jul 09 14:49:52 startActivity(i); Jul 09 14:50:27 do i have to call finish() on the main activity? Jul 09 14:50:50 you shouldn't, unless you dont want to return to it Jul 09 14:51:01 ok Jul 09 14:51:30 when I do it, I would use Intent i = new Intent(this, AddTask.class); Jul 09 14:51:37 but i'm pretty sure that's the same as what you're doing anyway Jul 09 14:52:38 are there any other clues in logcat? double check the androidmanifest entry is right, that the new activity is a child of the application etc. Jul 09 14:52:59 nm : just read http://www.anddev.org/viewtopic.php?p=15311 ... this sucks :( Jul 09 14:53:54 logcat just says null pointer exception Jul 09 14:54:08 on what line, what's that line doing? Jul 09 14:54:33 trying to load the activity Jul 09 14:54:35 ngnp: what do you need it in the emulator for? Jul 09 14:55:07 titefuzz: specifically look at the "objects" on that line, one of them won't have been instantiated properly Jul 09 14:56:33 doc_savage: first thought was for testing my app stack (stupid thought :), other was playing games for my daughter and last was reverse enginering some apps :) Jul 09 14:56:34 working :))) Jul 09 14:56:50 had to remove the constructor Jul 09 14:56:59 titefuzz: nice :) and not blank? Jul 09 14:57:05 not blank :) Jul 09 14:57:17 sweet - get there in the end Jul 09 14:57:30 Hi guys, just a little question is there an easy way to correct this ugly thing while using a high screen resolution : http://img102.imageshack.us/i/screenr.png/ ? Jul 09 14:58:16 ngnp: ah, well if you have a phone, you should be able to swipe the APKs off that to install into the emulator (for games/apps, not the market) Jul 09 14:58:33 whats ugly abotu that Jul 09 14:58:57 doc_savage: you're right :(|) Jul 09 14:59:03 * ngnp bangs head ;) Jul 09 14:59:03 its not full screen blau-mikeDG Jul 09 14:59:04 the space betweens icons Jul 09 14:59:24 oh.. Jul 09 14:59:28 how do you have a high resolution? Jul 09 14:59:38 louis: you could modify Launcher Jul 09 15:00:22 Launcher ? Jul 09 15:00:30 I was thinking launcher was the "slider" Jul 09 15:00:45 louis: Launcher is the name of the Home app in the source Jul 09 15:00:51 okay Jul 09 15:01:05 thx i'll check this Jul 09 15:05:37 this should have been user configurable... Jul 09 15:06:16 feel free to contribute a patch Jul 09 15:11:15 lol Jul 09 15:11:26 how do you have a high resolution? Jul 09 15:11:49 the end user should really never be seeing high res launcher Jul 09 15:12:25 its not the question Jul 09 15:12:50 was thinking about Archos Android tablet Jul 09 15:13:20 well they can modify the os themselves Jul 09 15:13:25 and contribute the changes to the main Jul 09 15:13:59 hi Jul 09 15:14:05 well... Jul 09 15:14:13 i'll try to make it myself. Jul 09 15:14:22 but not today XD Jul 09 15:14:25 see you later :) Jul 09 15:18:36 i'd like to install libspeech.so in my htc magic (htc mytouch) to use VoiceSearch. anyone knows how to install?? Jul 09 15:19:12 mount your /system partition as read only, toss the so in there if you have room Jul 09 15:19:32 alternately, you can use System.load("libspeech") if you include it in your app and have it extracted to the libs dir Jul 09 15:24:24 I don't have root. Can I load libspeech with System.load(libspeech.so) ? Jul 09 15:25:40 yes Jul 09 15:25:55 System.load will load it for you for your app's instance Jul 09 15:26:25 on donut (iirc) when you put your app in /lib it becomes accessable for other apps as well, as long as they have appropriate permissions Jul 09 15:26:34 but I'm not really clear on that, do your own investigation there. Jul 09 15:27:02 I try it, thank u Jul 09 15:28:36 but yeah, you can absolutely do System.load. Jul 09 15:28:41 it's how copilot works : ) Jul 09 15:28:48 or is it loadLibrary? Jul 09 15:28:51 heck I forget now ._. Jul 09 15:29:05 LoadLibrary Jul 09 15:29:49 * doc_savage has just found out that android doesn't like managing null cursors Jul 09 15:35:23 vol_: the problems is, how to install libspeech.so in /system/lib in a handset without root ?? Jul 09 15:36:40 oh. You can't. Jul 09 15:37:41 :( Jul 09 16:06:07 2009-07-09 11:06:05 - HelloActivity] Unknown error: SDK is not loaded yet Jul 09 16:06:33 i am stucked with the error Jul 09 16:07:04 anybody know the solutions Jul 09 16:07:05 then you shouldn't call yourself a guru ^_^ Jul 09 16:07:18 that error happens when the sdk isn't totally loaded when your project is Jul 09 16:07:24 if you wait a few seconds it should resolve itself Jul 09 16:07:36 check the path in your settings to make sure that you have the right path Jul 09 16:07:41 try closing/reopening the project Jul 09 16:07:53 i wait about 1 hour Jul 09 16:08:54 if you're looking at the text log it won't clear itself Jul 09 16:09:03 do you get errors trying to compile because of this? Jul 09 16:09:33 the progress is 60% always Jul 09 16:09:41 yes when I compile Jul 09 16:09:59 try setting up the sdk from beginning again ... Jul 09 16:10:40 ok Jul 09 16:38:22 anybody around? Jul 09 16:50:41 What's the proper way to remove an overlay item from the map? Say I have 4 overlay items (map markers) on a map and I go to delete one, it shrinks the size of the ArrayList but all the other markers keep their index which causes an OutOfBoundsException when I try to click on the latest one added or when I remove another one. Are overlay items not meant to be removed? Jul 09 16:52:48 when you do remove from an arraylist, i thought it dynamically resize it no? Jul 09 16:53:27 i am pretty sure that's how it's suppose to be Jul 09 16:53:59 nm u meant the items Jul 09 16:54:09 phreak: ummm remove and do populate again Jul 09 16:56:15 chouman82, that worked great, however when there is only one left it throws an out of bounds exception, should I just do a check if there's one left and instead delete the entire overlay to combat this issue? Jul 09 17:04:32 like when there is one left and u r trying to remove the last one? Jul 09 17:04:51 yea haven't tried to remove opverlayItems Jul 09 17:05:02 i guess taht could be one work around Jul 09 17:05:17 it seems sometimes removing a point works sometimes it doesn't. when it crashes it gives me this: IndexOutOfBoundsException: Invalid location 3, size is 3 Jul 09 17:07:12 is it the index that you are trying to remove is wrong? Jul 09 17:07:31 maybe u want location -1 ? Jul 09 17:07:35 just a thought Jul 09 17:11:49 I'm not sure, it removes the right one when I click on the marker I want removed so that's not an issue, it's the ArrayList that keeps screwing up. If I remove them in order 0, 1,2,3 I only get the OutOfBoundsException when I try to remove 3, if I remove 2 first and then try to remove 1 I get an OutOfBoundsException on that one Jul 09 17:11:49 I have a TabHost, with each tab linked to an activity. I want an activity to be able to start a new activity, but have the new activity also contained in the TabHost. right now, the new activity goes fullscreen. Jul 09 17:14:17 phreak: well yes, that's normal Jul 09 17:14:36 phreak: if you have an ArrayList with 4 elements, and remove any element, then the array list has only 3 left Jul 09 17:14:42 therefore the index 3 does not exist anymore Jul 09 17:15:02 so I guess I need to prevent the list from shrinking when an index is removed? Jul 09 17:15:12 no you cannot Jul 09 17:15:21 either don't use an ArrayList Jul 09 17:15:28 or don't store the index of each marker Jul 09 17:15:44 you can call remove(Object) on an ArrayList btw Jul 09 17:16:09 well I think the ItemizedOverlay class stores the index, so you can use the onTap method, which is what I'm using to display a toast, which is why I liked the index scheme Jul 09 17:16:41 is there another type of list I could use that wouldn't shrink? Jul 09 17:16:58 it's called an array Jul 09 17:17:44 okay, I'll look into using an array then Jul 09 17:17:49 thanks for the help Jul 09 17:25:27 Does anyone know about swapping out what activities are associated with a tab in a TabHost? Jul 09 17:26:55 romainguy, how exactly would I go about implementing it as an array? Jul 09 17:27:26 as of right now, the arraylist stores an object, can you do with with arrays? Jul 09 17:30:08 yes, you can store objects in an array Jul 09 17:31:12 okay I've defined the new array like so: OverlayItem[] mOverlays; and I know I can add them like so: mOverlays[0] = overlay Jul 09 17:31:36 so now I would have to rewrite the addOverlay method to add a new overlay to the end of the array, correct? Jul 09 17:33:40 and I could do that using mOverlays.length as the index right, because that will return the size of the index and the index starts at 0 so it should always be the end index Jul 09 17:36:14 when building layouts, what do you guys usually use? (linear?,relative?,table?,absolute?) Jul 09 17:38:06 relative or linear Jul 09 17:38:11 absolute should really be your last choice Jul 09 17:38:26 only if it really, absolutely, has to be 10px off from the top left. Jul 09 17:38:37 otherwise, when devices come out with different resolutions your app looks stupid Jul 09 17:38:49 (or for a sizable minority of poorly made ones, when the user rotates the screen) Jul 09 17:39:26 ic Jul 09 17:40:38 I have had some trouble using relative so am using a table layout for my current application. I am worried about different hardware/screen resolutions causing my app to look funny or distorted on some devices. Jul 09 17:44:37 use whatever you think is necessary, just remember that things might be more brittle than you think. Jul 09 17:45:28 If I want to have an xml file to populate a view, is the best place for the xml file in assets? Jul 09 17:45:51 probably Jul 09 17:46:00 or res/raw Jul 09 17:46:11 res/raw lets you have variations based on resolution, locale, etc. Jul 09 17:48:10 argh, I mixed up res with assets Jul 09 17:48:17 what romainguy said Jul 09 17:48:26 Does SimpleExpandableListAdapter allow you to map to non-Strings? Jul 09 17:48:54 it looks like it does since it's generic, but i keep getting a class cast exception in bindView whenever I try to use a custom type Jul 09 17:49:30 thanks Jul 09 17:49:32 SimpleListExpander.java:249 -- v.setText((String)data.get(from[i])) Jul 09 17:50:15 should that be v.setText(data.get(from[i]).toString()) instead? Jul 09 17:51:39 oops, that's SimpleExpandableListAdapter.java: 249 Jul 09 18:16:27 hi all I am slowing getting my head around basic static/non-static and context, still having a little difficulty working out how to do certain things, for example: infoDialog = new AlertDialog.Builder(this).create(); - "this" needs changing, as getting a error. Jul 09 18:16:50 what's the best way to trace cursors that have umm been left open by shoddy coding and are causing exceptions when the app closes? Jul 09 18:17:17 johnnyzen: this code is in an inner class? Jul 09 18:18:20 hi romainguy: i am using your tricks for reusing layouts from the google video, so its within a onclick handler, within your getView trick (EfficientAdapter) Jul 09 18:19:26 but when you used static classes, etc, it has got me a bit confused, Jul 09 18:19:31 romainguy: filed the above SimpleExpandableListAdapter issue as http://code.google.com/p/android/issues/detail?id=3218 Jul 09 18:20:54 I have got my layout working, reclycing views - which is EXCELLENT btw :) Jul 09 18:21:25 johnnyzen_: from an inner class instance you can refer to the outer class instance by using TheOuterClass.this instead of this Jul 09 18:21:32 it doesn't work with static inner classes Jul 09 18:22:23 a ha. yes i read about this :) but didnt quite understand how to fix. :) thanks Jul 09 18:23:10 romainguy_: I've successfully switched from an ArrayList to an Array and it works when I add one item setting a fixed size for the array, but how can I make the array dynamic so I can add more than one item? Jul 09 18:24:24 romainguy: so in your example, the outer class would be - public class Testing extends ListActivity, but Testing.this is stating out of scope., I did think I tried this earlier (been trying to work out for hours) Jul 09 18:27:05 romainguy: sorry the exact message is: No enclosing instance of the type Testing is accessible in scope Jul 09 18:27:45 is your inner class static? Jul 09 18:29:03 "private static class EfficientAdapter extends BaseAdapter" - yes Jul 09 18:29:39 "romainguy_: it doesn't work with static inner classes" Jul 09 18:29:43 so make it non-static Jul 09 18:30:00 or just pass the Context as an argument of the constructor of your adapter Jul 09 18:30:47 yes, i would like to use a context, buy couldnt work out how to get the right context. Jul 09 18:31:57 could I create a variable Context outsidecontext = getApplicationContext and use this ? Jul 09 18:32:27 I need to replace "this" with the context of the outsideclass ? Jul 09 18:33:53 does anyone know around how many views I can draw without getting a big slowdwon? I'm drawing 15 atm and its pretty slow to render Jul 09 18:35:03 johnnyzen_: when you create your adapter, just do something like new EfficientAdapter(aContext) (which can be the activity itself) Jul 09 18:35:14 meanburrito920_: it depends on the views Jul 09 18:35:19 but 15 should not be slow Jul 09 18:35:32 (if the views don't do anything stupid that is) Jul 09 18:35:41 romainguy_: 10 textviews and 5 image views Jul 09 18:36:02 are you stretching the images in the image views? Jul 09 18:36:10 its a 1 image view + 2 text view in a relative layout, all passed to a list adapter Jul 09 18:36:11 (or shrinking for that matter) Jul 09 18:36:32 romainguy_ they look to be the right size Jul 09 18:37:08 romainguy_ the images are coming in over the network, but i have a threaded image loader running in the background. Jul 09 18:37:18 romainguy: thanks, I will look at this Jul 09 18:39:57 meanburrito920: this session was really helpful for figuring out list performance: http://code.google.com/events/io/sessions/TurboChargeUiAndroidFast.html Jul 09 18:40:05 romainguy: well the adapter is created within onCreate - setListAdapter(new EfficientAdapter(this)); Jul 09 18:41:23 johnnyzen_: then the adapter already has the contxet Jul 09 18:41:25 context Jul 09 18:43:59 romainguy: hmmm lost agina, here is the code, - pastebin.com/d3dc5e452 (line 168) - I think if I can suss this context / static-nonstatic I will be so happy, I viewed some Jul 09 18:44:32 videos on static / non-static - I kinda get it. Jul 09 18:44:43 you're *already* passing the Context to your adapter Jul 09 18:44:53 there's no need to deal with the static/non-static nature of your adapter Jul 09 18:44:55 you have a Context Jul 09 18:44:58 hello romain :) Jul 09 18:44:59 just pass it to your AlertDialog Jul 09 18:47:16 :) yes but how ? Jul 09 18:48:08 (new AlertDialog.Builder(context).create(); Jul 09 18:48:14 doesnt work Jul 09 18:49:20 argh Jul 09 18:50:16 (sorry Jul 09 18:50:19 maybe you should first keep that reference to the context in a class member Jul 09 18:50:44 or even easier Jul 09 18:50:50 use v.getContext() in your onClick() method Jul 09 18:52:59 so basically a context is a referernce to a class ? so AlertDialog needs to know the whereabouts of the class that will use it ? Jul 09 18:55:48 johnnyzen_: a Context is a handle to the system, it provides services like resolving resources, obtaining access to databases and preferences etc Jul 09 18:56:28 johnnyzen: and the reason it is called context is that the resource locations/permissions are different for each application/activity Jul 09 18:56:51 yes i think I understand, in the case of the AlertDialog, it needed the context of the view to create ? is this right in saying this ? Jul 09 18:57:43 hello. I have a ListPreference dialog/popup with options for days of the week and I wanted to add an "All Days" that checks every box. Is this possible with ListPreference or should I be using something else now? Jul 09 18:57:59 (sorry if I understand the context for alertdialog, I should be able to understand other uses) Jul 09 18:58:05 :) Jul 09 18:58:45 johnnyzen: so, when you are creating an alertdialog, it is still rendering it to the screen in context of the application which is running it Jul 09 19:00:49 herriojr: almost like saying "AlertDialog, you need to render to the screen of the application, so here is the "context" of the application new AlertDialog.Builder(->context<-).create() ? Jul 09 19:03:24 is there no onCreate for an AppWidgetProvider? Jul 09 19:03:45 johnnyzen: yeah, that's how I usually think about it Jul 09 19:04:03 I'm not romainguy so I don't know exactly what's going on behind the scenes Jul 09 19:04:14 but thinking about it like that will get you by Jul 09 19:04:35 anybody familiar with creating a dynamic array? Jul 09 19:04:50 THANK YOU SO MUCH - :) sorry, I just find it hard to grasp, I need simple words :) Jul 09 19:05:28 sometimes, I feel like homer simpson, espically the episode where he smokes pot. Jul 09 19:06:10 phreak: there's no such thing as a dynamic array, other than Vector or ArrayList Jul 09 19:06:26 if you want to change the size of the array, you create a new array and you copy stuff from the old array to the new one Jul 09 19:06:30 (using System.arraycopy()) Jul 09 19:06:43 phreak: arraylist does this for you very conveniently Jul 09 19:06:54 emmby: he doesn't want to use ArrayList :) Jul 09 19:07:01 my bad Jul 09 19:12:08 phreak: are you looking for something where you can use realloc() like in C? Jul 09 19:12:58 no, I'm looking for an array that does not shrink, that way the indexes remain constant Jul 09 19:13:21 phreak: "romainguy_: if you want to change the size of the array, you create a new array and you copy stuff from the old array to the new one" Jul 09 19:13:30 it's for an itemizedoverlay, I need the ability to add and remove Jul 09 19:13:38 yes, I'm implementing that now =] Jul 09 19:13:39 it is better imo to use an array list Jul 09 19:13:40 you could also use a SparseArray I guess Jul 09 19:13:46 kaay: yes but he refuses to :p Jul 09 19:14:08 ArrayList doesn't work, I would LOVE to use it but I can't remove items from it and have onTap still work.. Jul 09 19:14:19 well from an efficiency stand point the array list is pretty good at add and remove accesses Jul 09 19:14:44 I receive outofboundsexceptions when I try to remove some of them Jul 09 19:14:44 phreak: explain why arraylist is unsuitable? perhaps we can identify a data structure that is Jul 09 19:15:20 Okay so you start with the ArrayList, you add 4 overlayItems to it it's size is now 4 with indexes 0,1,2,3 Jul 09 19:15:42 onTap works fine at this point, as it should Jul 09 19:15:53 now you go to remove index 2 Jul 09 19:16:05 Size is now 3 Jul 09 19:16:31 and now if you go to remove index 1, you get an out of bounds exception Jul 09 19:16:34 i think what you're looking for is maps. Jul 09 19:16:46 you can remove and add items without affecting others Jul 09 19:16:49 can you elaborate a bit? Jul 09 19:17:21 maps are a set of java structures that map keys to values Jul 09 19:17:37 for instance a hashmap Jul 09 19:18:10 ah I see, so like index 0 would be mapped to an overlayItem? Jul 09 19:18:13 you use put and get to add and remove elements Jul 09 19:18:16 and idnex 1.. etc etc Jul 09 19:18:28 okay that definitely sounds like it would do what I want Jul 09 19:18:57 *put and remove add and remove things Jul 09 19:19:02 get accesses an element Jul 09 19:19:52 im not sure precisely what you're doing in android. ive just walked in and suggested a new data structure. there's no warranty i'm afraid :D Jul 09 19:20:22 I'm adding and removing map markers to a map using the ItemizedOverlay Jul 09 19:20:42 adding works great with the ArrayList, removing not so well since I'm using onTap to get the point to remove Jul 09 19:20:58 and the indexes often land outside the array after you remove one item Jul 09 19:21:11 but maps sound like they might be a solution Jul 09 19:21:40 might be a simple solution yeah Jul 09 19:22:15 i dont know if its possible for you to do but you could just track which items are being removed and then alter the index your trying to access accordingly Jul 09 19:22:34 or a SparseArray? Jul 09 19:23:23 SparseArray maps an integer to an object Jul 09 19:23:28 isn't a Map a sparsearray? Jul 09 19:23:35 no idea Jul 09 19:23:53 no, doesn't look like it Jul 09 19:24:08 Maps map objects to objects Jul 09 19:24:48 so I'd assume SparseArray is probably faster, but I'm not sure Jul 09 19:25:27 I haven't tried testing it out since I don't care that much Jul 09 19:25:53 either one provides an interface for what i think you want to do anyway by the looks of things Jul 09 19:26:15 yeah SparseArray looks pretty good Jul 09 19:26:28 the underlying implementation is probably important if you want efficient but im watching SG:A atm and not reading about the ins and outs of the sparsearray structure :) Jul 09 19:27:02 SparseArray - from docs -- It is intended to be more efficient than using a HashMap to map Integers to Objects Jul 09 19:27:21 brb Jul 09 19:27:49 lol Jul 09 19:27:49 I'm interested in making an application which needs to send data to a server for my application. which protocol should I choose ? most of the data would be text, and not too much of it. Jul 09 19:28:11 does anyone know of an example of a ListPreference that has a "select all" option? (or does that require extending DialogPreference? still would like an example) Jul 09 19:34:39 guess no one has done what i'm asking before... can't find anything online either Jul 09 19:36:13 Does anyone know if Android supports input from USB? I am looking to build a weather sensor that will plug into an Android phone (USB or Bluetooth) and be able to record the data. I had heard it's more of a limitation of the G1 and hardware than Android. Wondering if anyone has any thoughts? Thanks. Jul 09 19:38:07 The USB pinout for HTC's phones are somewhat proprietary Jul 09 19:38:10 so, good luck on that :\ Jul 09 19:39:56 the android documentation sucks :( Jul 09 19:40:02 theres no examples for anything Jul 09 19:40:23 are you f'ing kidding me? Jul 09 19:40:28 the entire project is open source Jul 09 19:40:45 could someone take a look at my class project Jul 09 19:40:50 im just about done with the presentation Jul 09 19:41:02 jasta: open source != good documentation Jul 09 19:41:22 it needs to have some examples Jul 09 19:41:39 vol_ thanks. Any other suggestions? or should I look at some other manufacturer / platform to do what I need. Jul 09 19:42:17 what about my question ? Jul 09 19:42:20 maybe buglabs. Jul 09 19:42:20 localtone: eh. Not really sure what to suggest. xda-developers might have someone who poked at it. I know some people have been prodding. Jul 09 19:42:23 http://docs.google.com/Presentation?id=dc2vs2x5_536kzztzcm Jul 09 19:42:28 any input is greatly appreciated Jul 09 19:42:33 ido--: http is probably more than sufficient Jul 09 19:42:41 and would be pretty simple to set up Jul 09 19:42:44 php backend Jul 09 19:42:49 http post your text Jul 09 19:42:54 use simple authentication or something Jul 09 19:43:35 alternately, if you're willing to write and host your own server, just make whatever server and send it in whatever format. heck, pass it through a gzip filter. it should compress delightfully. Jul 09 19:43:37 whats xmpp used for ? Jul 09 19:43:45 vol_ thanks. Jul 09 19:43:50 ido--: nothing in android... Jul 09 19:43:54 ido--: google talk Jul 09 19:44:00 vol_: no... Jul 09 19:44:03 well, not quite. Jul 09 19:44:06 gtalk is based off of xmpp Jul 09 19:44:16 the protocol android uses is quite unlike XMPP Jul 09 19:44:27 :\ Jul 09 19:44:36 not for android Jul 09 19:44:38 gtalk's desktop client protocol makes absolutely no sense for a mobile device Jul 09 19:44:41 anyway, jabber Jul 09 19:44:56 at any rate, he asked "what is xmpp used for" Jul 09 19:45:01 hrm. Jul 09 19:45:12 http sounds interesting Jul 09 19:45:32 something similar to soap ? Jul 09 19:45:41 soap is for washing yourself Jul 09 19:45:51 this is not an appropriate forum for personal hygene Jul 09 19:50:58 and the error messages are so awful :( Jul 09 19:51:14 making me want to go back to C Jul 09 19:51:45 guys, the SparseArray works beautifully, thanks a lot for the help, must appreciated! Jul 09 19:53:37 anyone thats around now have any idea on my question? I want to create something like a ListPreference but with a "Select All" option at the top Jul 09 19:54:23 bnovc: don't know, sorry. consider extending the class and making it yourself : ) Jul 09 19:55:23 bnovc: the PreferenceActivity thing is not that extensible. you're probably better off designing everything yourself. Jul 09 19:55:33 bnovc: use checkboxes like gmail does I guess Jul 09 19:55:33 using CheckedTextViews or whatever Jul 09 20:04:32 i was trying to use DialogPreference and put a layout inside of it Jul 09 20:04:44 i was going to put a button and then a list, but i've been unable to do that so far Jul 09 20:05:47 I tried adding a ListActivity inside of onCreateDialogSomething, but it requires a Context parameter and I didn't know what to put Jul 09 20:06:35 are there examples of these things like CheckedTextView somewhere that I'm not seeing? Jul 09 20:06:44 and maybe a picture even Jul 09 20:06:53 look at the ApiDemos Jul 09 20:07:45 "6. More Spanning and Stretchable" ? Jul 09 20:07:52 it doesn't give you the resource file or a screenshot or anything Jul 09 20:08:05 it only gives you a couple lines of generic code Jul 09 20:08:07 look in the SDK Jul 09 20:08:10 install the ApiDemos Jul 09 20:08:12 play with them Jul 09 20:08:15 then look at the source code Jul 09 20:08:18 that's what they're for Jul 09 20:09:11 that sounds like it would help. i wasn't using the sdk Jul 09 20:28:26 hi Jul 09 20:28:42 how can i get the id of a contact i just created via Uri newPersonUri = this.contentresolver.insert(People.CONTENT_URI, personValues); Jul 09 20:29:45 is there supposed to be an icon for these api demos in the sdk by default? Jul 09 20:35:05 bnovc: like I said earlier "romainguy: install the ApiDemos" Jul 09 20:35:48 well i was trying to figure out how to do so Jul 09 20:35:55 unfortunetly the apidemos section on the site doesnt say Jul 09 20:36:24 i can't "ant debug" it Jul 09 20:36:42 romainguy: thanks (by proxy) for lunch. :P Jul 09 20:37:06 you're welcome (by proxy) :) Jul 09 20:37:09 :D Jul 09 20:37:39 romainguy: my new favorite Googlite bought a few of us lunch and phoned us Jul 09 20:43:01 why is all of this so unintuitive :( Jul 09 20:43:13 "error inflating class linearlayout", bleh Jul 09 20:44:11 can I not put a LinearLayout inside of a DialogPreference? Jul 09 20:52:51 bnovc: yes you can Jul 09 20:53:12 do you of any examples that do this anywhere? and is it not possible to do what I had described with just ListPreference? Jul 09 20:54:22 why don't you just add an item called "All" in your listpreference? Jul 09 20:55:26 because I want it to check all of the other checkboxes when it is clicked Jul 09 20:59:10 I have an uncaught exception "uncaught handler: thread exiting due to uncaught exception" but how do I find out which line it was caused on in ddms? Jul 09 20:59:26 it should say in the traceback Jul 09 21:00:07 the line below is related to sms (07-09 21:47:40.770: DEBUG/SmsProvider(104): insert url=content://sms/inbox, match=2) Jul 09 21:00:17 but the rest of the trace is the same error? Jul 09 21:01:12 in that case, ERROR/AndroidRuntime(25127): java.lang.RuntimeException: Error receiving broadcast Intent { action=android.provider.Telephony.SMS_RECEIVED (has extras) } <--- the stack trace for this contains no lines that are in any of my classes Jul 09 21:01:12 martin___: this is in logcat? Jul 09 21:01:19 yes Jul 09 21:02:16 the last line of the stack trace says it was caused by a nullpointerexception, now that would be fine... but it doesn't say where Jul 09 21:06:10 I dont really know the next step to take without any line numbers... except commenting things out Jul 09 21:06:22 and breakpoints Jul 09 21:09:47 martin___, pastebin it Jul 09 21:11:57 android is such a disappointment Jul 09 21:12:25 bnovc: ?? Jul 09 21:12:39 herriojr: no hand warmer feature Jul 09 21:13:12 bnovc: statements like that aren't very productive, what is it you find disappointing? Jul 09 21:13:43 bnovc, ?? Jul 09 21:14:05 what i've been trying to get help with for the past 3 hours Jul 09 21:14:19 so, all you need to do is run through the items in the list and check them Jul 09 21:14:30 bnovc, which is...? Jul 09 21:14:31 and trying desparetly to find examples of anything online and all i get is useless doxygen stuff Jul 09 21:14:43 bnovc, what is the problem though. Jul 09 21:14:53 he wants to check all items in a list Jul 09 21:14:59 i'm trying to setup a layout inside of a DialogPreference and add a button at the top and then a list but i can't find any examples of this kind of thing Jul 09 21:15:05 so, he needs to get the listview, and iterate through the children and check them Jul 09 21:15:34 you can't add a button at the top of a ListPreference or even grab when items are clicked, right? Jul 09 21:15:39 it just returns them when its done Jul 09 21:15:44 bnovc, did you look at the api examples? Jul 09 21:16:10 yes but they are only a couple lines on the website and nothing with what i want to do, as far as i can see Jul 09 21:16:22 bnovc, have you looked into creating a custom DialogPreference or ListPreference? Jul 09 21:16:30 you get stuff like http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/TableLayout6.html which is 2 lines Jul 09 21:16:33 not very useful Jul 09 21:16:40 romainguy: do you only load the images when scroll state idle in your shelves app? Jul 09 21:16:47 KNY: i've been trying to create a custom dialogpreference and i just get generic crashes or errors Jul 09 21:17:04 bnovc, re: that link, you might want to try looking at the XML file for it Jul 09 21:17:05 i can't get the list to go inside it and i can't find any examples of doing it Jul 09 21:17:09 it's likely more useful Jul 09 21:17:16 the xml file isn't there... you click on the api demos link and it goes to that Jul 09 21:17:39 really? http://developer.android.com/guide/samples/ApiDemos/res/layout/table_layout_6.html Jul 09 21:17:41 i guess maybe its in the sdk somewhere Jul 09 21:17:51 where was that linked from? Jul 09 21:17:59 I used common sense Jul 09 21:18:06 Is there a way to "getString()" without passing in resources/context ? Jul 09 21:18:06 but um Jul 09 21:18:06 http://developer.android.com/guide/samples/ApiDemos/index.html Jul 09 21:18:07 here Jul 09 21:18:08 http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/index.html Jul 09 21:18:12 mbarkhau, no Jul 09 21:18:18 ah you have to backward two and then go to res/, eh. Jul 09 21:18:24 KNY: thx Jul 09 21:18:27 i had gone to the views page directly from google Jul 09 21:18:34 bnovc, no, you click the "API Demos" link on d.android.com Jul 09 21:18:42 and it takes you straight there Jul 09 21:20:09 bnovc, if you need a good example, get the android source at source.android.com and look at the contact app where you set the ringtone for each contact. That has the exact format you want. Jul 09 21:20:31 ok i'll try, thanks. Jul 09 21:20:40 it would be *incredibly* helpful if the class pages had examples... like DialogPreference Jul 09 21:20:49 and if the error messages told me more than "can't inflate list" :( Jul 09 21:21:17 sorry if i came across poorly...this has been really frustrating trying to pick up with no examples related to what i wanted anywhere Jul 09 21:27:51 i would have never guessed to find the ringtone selection, for example Jul 09 21:28:05 when iterating through a cursor's values, do you need to call moveToFirst() before while(cursorName.moveToNext())? the docs say it's random access so I assume not? Jul 09 21:28:47 meanburrito920_: isn't that just a premade list? with radio boxes Jul 09 21:29:07 bnovc, no, it has save and cancel buttons Jul 09 21:29:13 and a radio list Jul 09 21:30:26 bnovc: have you looked at the logcat to see more about the error? Jul 09 21:31:03 romainguy: i don't suppose you know of a way to enable HttpClient logging? Jul 09 21:31:20 it's supported through properties using the Jdk14Logger it seems, but i cant tell how ot pass java properties into Dalvik Jul 09 21:31:25 no clue Jul 09 21:31:40 np, i'll keep looking :) Jul 09 21:40:27 romainguy: i was looking at ddms, which I thought showed the same thing. It gave a backtrace, but nothing that I learned anything from Jul 09 21:43:35 oh well i have real work to do now. no playing around w/android for a bit Jul 09 21:48:23 hi all: could anyone help me with how to refresh a listactivity which uses convertview ? Jul 09 21:50:10 or more useful to refresh a particular row Jul 09 21:53:20 its ok, solved it :) Jul 09 21:59:34 why does the ContentProvider for the contacts list (android.provider.Contacts.Phones.NAME and NUMBER) contain null contacts? Jul 09 22:00:57 or at least the cursor points to null values Jul 09 22:01:42 is there a preset maximum size for the number of contacts in the contacts list and the nulls are just ones I haven't filled yet? Jul 09 22:01:53 no Jul 09 22:02:01 you get null for values that you haven't filled out yet Jul 09 22:02:09 it can be for instance a contact that has only an email address Jul 09 22:02:09 etc. Jul 09 22:02:17 ahh, gmail contacts Jul 09 22:02:33 ok thanks :D Jul 09 22:02:50 (well not just gmail contacts, but they're the most likely) Jul 09 22:03:50 hmm, I'm having the worst trouble with GPS on the emulator. Everything was working fine on Tuesday, but today, with no changes to the code that I am aware of, the GPS refuses to accept locations Jul 09 22:03:58 any ideas of how to troubleshoot? Jul 09 22:04:17 blarg. In eclipse how the hell do you turn off debugging and go back to a regular view? Jul 09 22:04:41 theres arrows in the top right corner Jul 09 22:04:45 top right, perspectives, click java Jul 09 22:07:12 ty] Jul 09 22:24:18 So my code is here: http://pastebin.com/d3f46214c Jul 09 22:24:32 but when I run it on my phone I get a giant, empty list Jul 09 22:24:38 not the names I was expecting Jul 09 22:26:02 scratch that Jul 09 22:26:14 I'm getting the names, but there's a ton of blank entries above them Jul 09 22:28:03 whaledawg, that will pull up all of your gmail contacts, even ones without names stored Jul 09 22:28:28 whaledawg, try setting your "from" to Contacts.PeopleColumns.EMAIL or something like that Jul 09 22:29:53 could those be phone contacts? numbers I used that have no names? Jul 09 22:32:08 can i run eclipse on my computer that has 512 MB of RAM? Jul 09 22:32:39 there is no EMAIL :/ Jul 09 22:34:23 it's DISPLAY_NAME Jul 09 22:34:29 thanks KNY Jul 09 22:34:39 Liutenant: ahahahhahhaaa Jul 09 22:34:45 what? Jul 09 22:34:58 Lieutenant, what are you doing with 512 MB of RAM? Jul 09 22:35:09 computing? Jul 09 22:35:10 i dunno Jul 09 22:35:13 eclipse alone burns through 1.2 gigs + on my machine Jul 09 22:35:15 i use this comptuer all the time Jul 09 22:35:18 Lieutenant: buy more ram Jul 09 22:35:20 but i'm sure your swap will take care of the rest Jul 09 22:35:29 Lieutenant: or a better computer Jul 09 22:35:34 are u serious?! Jul 09 22:35:34 man fuck that Jul 09 22:35:39 this computer was 2k Jul 09 22:35:43 7 years ago. Jul 09 22:35:45 haha Jul 09 22:35:48 nice Jul 09 22:35:54 whaledawg, I'm running eclipse on an eee pc with a 900mhz cpu, i'm sure he can manage it :D Jul 09 22:35:58 Lieutenant: you can buy a better one new for $400 or less Jul 09 22:36:05 my Eclipse is using ~400MB right now Jul 09 22:36:10 Lieutenant: hell, you can probably buy a /netbook/ that's better for <$400 Jul 09 22:36:18 Lieutenent, listen to me. I am a cheap bastard. I hate buying new hardware. But never, ever develope on a low end machine Jul 09 22:36:20 i want to buy an AIO touchsmart PC Jul 09 22:36:25 or build your own for $300 Jul 09 22:36:31 it's not worth it. Jul 09 22:36:36 whaledawg++ Jul 09 22:36:39 whats not worth it? Jul 09 22:36:42 Lieutenant: your other option is, keep trying to sell your ideas to people and don't bother with development :P Jul 09 22:36:46 the touchsmart HP? Jul 09 22:36:55 your own pc Jul 09 22:37:00 oh Jul 09 22:37:02 * grey- thinks developers -should- develop on low end machines, so that they make their programs _fast_. Jul 09 22:37:16 developers w/ fast machines write bloated slow code. Jul 09 22:37:17 screw that, just write everything in assembly Jul 09 22:37:25 machinecode! Jul 09 22:37:27 * martin___ runs his apps to test on his phone as the emulator takes 4-5 minutes to boot Jul 09 22:37:29 by that logic grey the less I eat the better chef I'll be Jul 09 22:37:33 verilog! Jul 09 22:37:38 is it easy to learn java? Jul 09 22:37:44 whaledawg: now now, logical fallacy of analogies. ;) Jul 09 22:37:56 Lieutenant, yes, but its not something you particularly want to do Jul 09 22:37:56 Lieutenant: if I can learnded it anyone can Jul 09 22:38:06 if this is a choice, get out now Jul 09 22:38:11 martin___, you only have to boot the emulator once. Jul 09 22:38:36 real men etch their programs in to silicon layers manually with a very very tiny needle Jul 09 22:39:00 meanburrito920_, yeah, but it takes my cpu to 100% whilst it's open Jul 09 22:39:19 martin___, what comp are you running? Jul 09 22:39:24 eee pc 900 Jul 09 22:39:25 :D Jul 09 22:39:48 well there's your problem Jul 09 22:39:59 martin___, see above ^^ Jul 09 22:40:06 i'll be back with my pc on tuesday don't worry ;D Jul 09 22:40:16 but its better than nothing Jul 09 22:40:19 i couldn't live with so little screen area Jul 09 22:40:38 I haven't been home in two weeks and I have no laptop, so... :) Jul 09 22:40:41 how much ram does the g1 have? Jul 09 22:40:51 not enough Jul 09 22:40:56 kind of like your pc Jul 09 22:41:02 it has 512 aswell? Jul 09 22:41:52 it's.. 50 something? Jul 09 22:42:15 oh.. 192 Jul 09 22:42:18 if i buy a ram chip for this computer, and i buy a new computer soon, can i just take this ram out and put it in the new computer? Jul 09 22:42:20 http://www.htc.com/www/product/g1/specification.html Jul 09 22:42:37 Lieutenant, if they're compatible, sure Jul 09 22:42:42 probably not, new computers use DDR2 or DDR3 ram, while yours probably uses DDR Jul 09 22:42:46 oh Jul 09 22:50:02 Hi all - can anyone help with Eclipse /Android SDK problems ? Jul 09 22:51:35 bytesemantics: depends on the problem.. Jul 09 22:52:45 I either get "No classfiles specified" errors - and project doesn't build (Its an source code example from the book "Unlocking Android" (Manning Publications)) Jul 09 22:53:33 No matter how many times I clean/re-build or reboot Eclipse - can't reset. Jul 09 22:54:02 Project is configured for a 1.5 AVD Jul 09 22:54:14 Eclipse 3.5 - Android SDK 1.5r2 Jul 09 22:54:33 Any help much appreciated Jul 09 22:54:41 theres something wrong with the project Jul 09 22:54:58 (I've googled - and followed all instructions from google search results hits) Jul 09 22:55:30 I've tried Properties->Android->Fix project properties Jul 09 22:56:13 how about Jul 09 22:56:23 clicking on the project folder Jul 09 22:56:26 and clicking refresh Jul 09 22:56:35 done that - lots of times ;-( Jul 09 22:56:53 clean - refresh - build project Jul 09 22:56:58 reboot eclipse Jul 09 22:56:59 i would use eclipse 3.4.2 Jul 09 22:57:16 Also tried the OPen DDMS perspective - and reset ADB Jul 09 22:57:31 it's the biggest pile of spaghetti in your life, i would just assume that something is broken in a new version Jul 09 22:57:32 http://developer.android.com/sdk/1.5_r1/upgrading.html#UpdateYourProjects Jul 09 22:57:34 try that Jul 09 22:57:54 titefuzz: thanks - already tried that - no joy! Jul 09 22:58:29 Got it working this morning - then decided I wanted to use Google APIs Jul 09 22:58:48 I changed the project to use a Google APIs AVD Jul 09 22:59:19 I since changed it back Jul 09 22:59:25 but can't get it to re-build Jul 09 22:59:41 Seems quite flakey - but then I'm a relative android noob Jul 09 22:59:48 well Jul 09 22:59:56 i have had this problem happen before Jul 09 23:00:00 like 3 years ago Jul 09 23:00:02 forget what i did Jul 09 23:00:42 its not really android specific Jul 09 23:00:45 Will the problem be in the .project/.classpath file ? Jul 09 23:00:53 Or in the app manifest xml file ? Jul 09 23:01:02 Happy to fix either (outside of eclipse) Jul 09 23:01:18 probably not in the manifest Jul 09 23:01:28 did you recently move the project? Jul 09 23:01:32 or any of the files in it? Jul 09 23:02:02 nope Jul 09 23:02:22 how do you run the file? Jul 09 23:02:56 I find my eclipse will only run the files properly if I right click on the project name, and then select run as Jul 09 23:03:10 b0nn: thats what I try Jul 09 23:03:26 well, when I say properly, Im having a little nightmare with eclipse/emulator/gps Jul 09 23:03:26 b0nn: but it won't run - if it can't build Jul 09 23:03:52 nightmare ? - are you using ddms to set gps locations ? Jul 09 23:03:53 hmm Jul 09 23:04:00 yes, trying to Jul 09 23:04:08 you can also use telnet Jul 09 23:04:22 tried that ? Jul 09 23:04:24 but the emulator wont update the gps, apparently I am sitting off the coast of africa (Long0, Lat 0) Jul 09 23:04:27 yes Jul 09 23:04:30 still fails Jul 09 23:04:56 at any rate, you can install an app via cli Jul 09 23:04:58 I guess I'm going to have to dig into the build scripts that Eclipse is using.... Jul 09 23:05:24 have a look in workspace//bin/ Jul 09 23:05:38 and from there adb install foo.apk Jul 09 23:05:48 assuming it has been built of course Jul 09 23:06:13 What's the general advice ? Jul 09 23:06:21 Use standard Eclipse building ? Jul 09 23:06:29 Or use a generated build.xml ? Jul 09 23:06:40 * b0nn shrugs Jul 09 23:06:40 (generated by android tooling - I mean) Jul 09 23:06:54 I've been wanting to drop eclipse for a while now, because it's a steamer Jul 09 23:07:02 I guess I'm really asking - which is more reliable Jul 09 23:07:16 does anyone know where I could find the source of the android youtube app? Jul 09 23:07:24 it's not open source Jul 09 23:08:18 romainguy__, in that case, do you know how they do the progressive load of their list views? Jul 09 23:08:35 So - I guess - Eclipse/Android SDK - is not a totally reliable development environment then ? Jul 09 23:08:40 where it has the loadie wheel at the bottom, then loads the other clips without refreshing the entire page Jul 09 23:08:46 Any other suggestions ? Jul 09 23:08:55 bytesemantics, its the best atm Jul 09 23:09:18 other than doing everything by hand, it's the only atm Jul 09 23:09:22 meanburrito920: was hoping that would not be the case Jul 09 23:09:40 bytesemantics, you don't like eclipse? Jul 09 23:09:49 bytesemantics, the error your having isnt android specific Jul 09 23:09:56 Yes - I've used eclipse for years Jul 09 23:10:05 happy with eclipse (mostly) Jul 09 23:10:47 but concerned about reliability of dev environment - if I can't sort out this project problems.... Jul 09 23:11:14 why are you saying it's not reliable? Jul 09 23:11:27 does anyone know how to do listview paging such as in the youtube app? Jul 09 23:11:49 romainguy_ : because eclipse is extremely easy to break? Jul 09 23:13:08 bytesemantics, what issues are you having? Jul 09 23:13:43 meanburrito920_: I'd assume load a set number, then when the footer is viewed, start loading the next set, but that's just a guess Jul 09 23:14:08 herriojr, is there a "on view footer" callback though? Jul 09 23:14:25 sounds like a good idea Jul 09 23:14:26 I'm assuming you'll know when it gets bound Jul 09 23:14:28 I don't believe it - but I've just sorted it Jul 09 23:15:06 Clean project - go to project properties - builders - deselect all builders bar the first (Android Resource Manager( Jul 09 23:15:11 Build project Jul 09 23:15:14 so, you may need to make a custom view for the footer view Jul 09 23:15:15 yeah Jul 09 23:15:22 that starts loading the next set when it is viewed Jul 09 23:15:34 Had to delete the "Problems" that had been raised too. Jul 09 23:15:49 I haven't researched it, so I don't know the best solution off the top of my head Jul 09 23:15:52 then I re-enabled each of the builders - one at a time - and re-built after Jul 09 23:16:06 now I have all 4 builders selected - and it isn't complaining. Jul 09 23:16:10 all you need is a scroll listener Jul 09 23:16:12 i.e. its building Jul 09 23:16:17 and just watch what positions are displayed on screen Jul 09 23:16:22 integration is flaky Jul 09 23:16:42 thanks, I would have led him down the wrong path :) Jul 09 23:24:51 romainguy_, I can't seem to find anything on scroll listeners Jul 09 23:25:16 seriously... Jul 09 23:25:29 http://d.android.com/reference/android/widget/AbsListView.OnScrollListener.html Jul 09 23:25:34 rtfm, etc. :)) Jul 09 23:26:50 romainguy_ i saw that one, actually. but I couldnt find anywhere in ListView to actually set the listener Jul 09 23:27:14 http://d.android.com/reference/android/widget/AbsListView.html#setOnScrollListener(android.widget.AbsListView.OnScrollListener) Jul 09 23:28:21 oh duh... i was still looking in listview Jul 09 23:28:31 * meanburrito920_ bangs his head on the wall Jul 09 23:35:58 how would I get the ListView from a ListAdapter in ListActivity Jul 09 23:36:47 I never declare a ListView; i just declare a relativeLayout that gets passed to the ListAdapter Jul 09 23:37:28 getList() from ListActivity, I believe Jul 09 23:38:19 KNY: getListView(). awesome, thanks Jul 09 23:38:38 I was close :) Jul 09 23:41:56 what happened to the realtime 2d graphics example at Google IO being released as open source? Jul 09 23:48:13 herriojr, which one? Jul 09 23:48:26 that game with the android jumping around? Jul 09 23:48:33 yeah Jul 09 23:48:36 I would guess that it's not done Jul 09 23:48:39 I did a search for it and couldn't find it Jul 09 23:48:47 and if I was him, I wouldn't release it before ADC2 apps are due Jul 09 23:48:47 ah oik Jul 09 23:48:49 *ok Jul 09 23:49:00 why? Jul 09 23:49:15 because you'd get a million people swapping out graphics and calling it a game Jul 09 23:49:23 and most people wouldn't know that they didn't do it themselves Jul 09 23:49:30 lol Jul 09 23:50:55 I just wanted to see whether he used opengl or whether he just used the standard canvas/view to do a 2d game....I've not dealt too much with games, so I wanted to see if doing 2D in OpenGL is overkill Jul 09 23:54:25 anyways, I have no plans in entering ADC2 Jul 09 23:56:06 does anyone know how to refresh a listView with newly extended contents without resetting the ListAdapter? Jul 09 23:56:31 listView.dataSetChanged or something like that Jul 09 23:59:27 notifyDataSetChanged Jul 09 23:59:49 call it on the adapter Jul 10 00:01:57 what kind of adapter are you using? Jul 10 00:11:56 herriojr, a simplecursor adapter, but it's cast to a listadapter Jul 10 00:12:19 does anyone know how to change what a cursor queries? Jul 10 00:12:27 without creating a new cursor? Jul 10 00:13:56 I'm trying to update the data in my cursor for the listview pagination I'm working on. however, if i requery the db i get a new cursor, so notifying my adapter doesnt do anything Jul 10 00:15:52 ok, nevermind, i got it working. Jul 10 00:15:59 this paginate thing is pretty awesome :D Jul 10 00:31:14 meanburrito920_, ? Jul 10 00:32:31 KNY, i used changeCursor on the SimpleCursorAdapter Jul 10 00:32:57 ah Jul 10 02:19:57 any cursor/sqlite gurus out there? I keep getting "Leak found - SQLiteDatabase created and never closed" exceptions, they seem to be random, I'm using the same type of DbAdapter as the notepad tutorial, which also does it... and I can't seem to get it to stop, regardless of closing it in onPause and reopening it Jul 10 02:33:23 method for inquiring whether an edittext has focus? Jul 10 02:34:26 Hi! Jul 10 02:43:01 method for inquiring whether an edittext has focus? **** ENDING LOGGING AT Fri Jul 10 02:59:57 2009