**** BEGIN LOGGING AT Sun May 06 03:00:02 2012 May 06 03:06:01 So I know if you do android:noHistory="true" it will always finish() if it's brought in the background. Is there a atribute I can apply to make it auto finish after it's like the 3rd process in the background? May 06 03:06:27 I basically don't want it to finish on the first time it's in the background, maybe like 2nd or 3rd process in the background. May 06 03:08:33 just let it finish when it finishes May 06 03:09:09 Well I have pages in my app. May 06 03:09:19 17 pages specifically. May 06 03:09:30 I just don't want to use to be annoyed by pressing the back button 15+ times. May 06 03:09:52 So if I could kill the activity if say 3 activities go infront of it, that would be ideal. May 06 03:10:39 But I don't want to kill them right away because the user might of miss clicked, as well as I have a dialog activity that can get activated. May 06 03:10:56 just make it a viewpager or something where you can swipe views back and forth and use the back button to exit them all at once May 06 03:12:07 It would be a pain, and a cpu hog. I have 16 buttons per page all with onclick and onlongclick listeners. May 06 03:12:15 Times that by 10+ pages. May 06 03:12:17 hi, I have simple demo to load webview have a div with image background and img child tag. When I touched on screen the image tag disappeared. My device galaxy nexus ics 4.0.2. May 06 03:12:17 Oh boy. May 06 03:12:42 thank for any idea to debug this issue May 06 03:13:07 use the same listener for each button May 06 03:13:15 differentiate in code by the button ID May 06 03:13:23 Do you have any onTouch/click listener on your page gimi May 06 03:13:34 You mean to impliment view.onClickListener? May 06 03:13:48 Because I do, do that, and then do button.setOnClickListener(this); May 06 03:13:53 Doesn't that still create a new instance? May 06 03:14:16 of what? May 06 03:14:16 T-Dub|DlolPics: you can use the NO_HISTORY flag when you start an activity May 06 03:14:22 T-Dub|DloPics: I tried add ontouchstart and removed it but still the same May 06 03:14:53 but yeah, viewpager sounds very elegant as pragma- suggested May 06 03:15:07 I know readme, I don't want to kill it the moment it goes into background. I have a dialog that opens up when you long press, and by doing the no history it would finish the activity when the dialog shows up. May 06 03:15:17 it seems the way when webview render web page very strange May 06 03:15:31 Have you tried on a different os gimi? May 06 03:15:39 T-Dub|DlolPics: once the activity has lost visibility to the user and onPause has been called: anything can happen May 06 03:15:54 you no longer have control over what happens to the activity, you might as well assume it's getting killed after onPause May 06 03:15:59 What if it hasn't lost visibility to the user? May 06 03:16:04 then it's obviously fine May 06 03:16:16 But what if onPause is called, but still showing to the user? May 06 03:16:25 that's not possible. May 06 03:16:40 member:identifier:t-dub%7Cdlolpics:yes, it works fine on other device with android 2.3.x and 4.0.3 May 06 03:17:11 But it is. My activity1 opens up a new activity that is a android dialog theme (doesn't fill up the page). So in the "background" you can see activity1. However the current in focus activity is the dialog. May 06 03:17:23 Activty1's onpause is called, but you can still see part of it. May 06 03:17:26 don't think of it like that May 06 03:17:34 it can be killed at that point May 06 03:17:38 Gotcha May 06 03:18:00 I'll just deal with the fact the user might have 50 pages open. After all I have a home button for a reason. May 06 03:18:06 Thanks for the advice though. May 06 03:18:10 the "50 pages" thing is a big mistake May 06 03:18:16 Gimi ics can just be stupid. May 06 03:18:28 It was an exageration. May 06 03:18:30 your app is a soundboard, right, just an array of buttons May 06 03:18:47 They aren't arrays, but yes a soundboard. May 06 03:18:56 you need only one activity, period May 06 03:19:17 I have categories. May 06 03:19:24 Which is why I do different activities. May 06 03:19:31 that doesn't require a new activity either :) May 06 03:19:34 here is simple web page http://pastebin.com/T5w940ub May 06 03:19:45 No, but it is easier for me. This is my first application. May 06 03:19:50 you should use pragma-'s viewpager suggestion May 06 03:20:03 well, try this, for amateur hour: you can make two layouts May 06 03:20:16 you can setContentView() more than once in the same activity you know May 06 03:20:20 that will allow you to switch them May 06 03:20:24 Gimi excuse the stupid comment, but do you have internet access :s? May 06 03:20:32 Hm May 06 03:20:35 Never thought of that. May 06 03:20:37 fml May 06 03:20:45 Fragments are the ideal way, though. May 06 03:21:07 Fragments should be the way we take everything from my understanding.... May 06 03:21:09 T-Dub|DloPics: yes sure May 06 03:21:35 Android introduced fragments in Android 3.0 (API level 11) May 06 03:21:40 I'm coding for 2.2+ May 06 03:21:41 use the support lib May 06 03:21:44 yeap May 06 03:22:01 even then you don't need a fragment to swap the views and use only one activity May 06 03:22:06 so if you dont' want fragments, that's an option. May 06 03:22:08 just add the support library to your "libs" folder, and then use Fragments like normal May 06 03:22:09 not hard May 06 03:22:26 fragment is just a way to make it cleaner May 06 03:22:37 T-Dub|DloPics: what does you mean pragma-? May 06 03:23:05 readme: but technically speaking a fragment is a sub-activity so you would still be using multiple activities. May 06 03:23:16 no May 06 03:23:16 correct?? May 06 03:23:33 Not sure your question or the answer your looking for gimi. I don't know why it doesn't work in ics. May 06 03:23:35 fragments are nothing special May 06 03:24:02 they are simple classes which assist in managing views May 06 03:25:34 and another question, how can I upgrade from 4.0.2 ics to higher version? May 06 03:25:47 your OEM controls that May 06 03:25:54 email whoever made your phone May 06 03:26:54 JakeWharton: in case they have not any update version we can not upgrade? May 06 03:27:06 not unless you use a hacked ROM May 06 03:27:12 like CM9 build or something May 06 03:27:23 yeah, that's a question that goes beyond the scope of this chat room May 06 03:28:29 ok, I see May 06 03:30:47 readme did u see wat i said earlier? May 06 03:31:36 Storm2010: i'll check my backlog May 06 03:31:57 Storm2010: oh great. glad you figured it out. May 06 03:32:44 xD i still didnt but i was excited to see tht part of code actually was correct all along May 06 03:33:40 thing is i have to figure out how to change the mp.create data source when the cursor.position changes May 06 03:44:35 readme i use a viewbinder for tht dont i? May 06 03:54:41 what happens when I System.out.println() in an android app? May 06 03:55:29 would it display in eclipse's console? May 06 03:58:47 yeah what you prolly want is Log.d() etc May 06 04:00:43 System.out.println is basically an alias for Log.w May 06 04:00:51 but you should use Log May 06 04:16:15 Does anyone know of any easy to follow tutorials for preferences for honeycomb and ICS? I can only find ones for Gingerbread and lower. May 06 04:16:51 preferences are different between honeycomb and ICS? May 06 04:17:05 afaik, the difference is between gingerbread and honeycomb May 06 04:17:14 and you should see commonsware's fragmentsbc project May 06 04:18:06 https://github.com/tom-dignan/cw-android/tree/master/Prefs/FragmentsBC May 06 04:18:18 oh, I gave you my fork. You should probably use the original. May 06 04:18:45 readme, thats what I ment, honeycomb and ICS are the same, but I can only find tutorials on Gingerbread May 06 04:19:00 the project I linked is pretty much the key May 06 04:19:13 hey readme May 06 04:19:16 it shows how to use the best apis on the best verisons in the same app May 06 04:19:23 did you want that code todo with fonts May 06 04:19:31 readme, thanks, I'll take a look May 06 04:19:49 Napalm: share it on github if you think i would want it others probably would as well May 06 04:20:02 i'll take a link whenever its up somewhere May 06 04:20:20 i dont really use github, i have to sort out my account and keys and whatnot May 06 04:20:28 i'll give it to you and you can host it if you like on yours May 06 04:20:32 its all yours May 06 04:20:37 do with it as you please May 06 04:23:21 readme, thanks, that helped a lot! May 06 04:24:38 readme: http://android.netcore2k.net/TypefaceOverride.zip May 06 04:26:06 its not nice, per-se but it works and well May 06 04:26:09 readme: ^ May 06 04:26:14 looks good May 06 04:26:29 so you basically can use it wherever there is a LayoutInflater May 06 04:26:36 yup May 06 04:26:39 awesome May 06 04:26:45 even better May 06 04:26:49 this is untested May 06 04:27:22 but since ContextThemeWrapper base's itself from the orignal context it should mean that this should also work May 06 04:27:27 so only apply once per activity May 06 04:27:36 and its golden May 06 04:28:14 readme: the only other way to do this was to proxy getLayoutInflater() and not only was proxying all those functions a pain but its not exactly global and causes other issues May 06 04:28:37 readme: a little something extra for you May 06 04:28:49 readme: thanks for the cache code btw May 06 04:28:51 ;) May 06 04:29:38 readme: http://android.netcore2k.net/setOptionsMenuBackground.java May 06 04:29:56 this will assign a drawable to each button in the old style popup menu May 06 04:30:08 so you can make them solid white or something that fits the ICS style May 06 04:30:11 if you so desired May 06 04:32:11 oh nice May 06 04:32:40 y u no github May 06 04:32:49 i said earlier May 06 04:32:58 i need to reconfigure my account and a load of other crap May 06 04:33:01 I missed it. I assume it's because you are a rebel May 06 04:33:02 since i stop paying May 06 04:33:03 oh May 06 04:33:05 i cant be assed atm May 06 04:34:38 GitHub is life May 06 04:34:44 haha May 06 04:34:47 hey jakey May 06 04:34:51 :D May 06 04:34:54 hello May 06 04:34:58 someone write my presentation for me May 06 04:35:08 lol May 06 04:35:15 i'll write one May 06 04:35:24 on how crap Android is and how great iOS is May 06 04:35:29 /sarcasm May 06 04:35:46 iOS certainly has many advantages May 06 04:36:00 JakeWharton: Slide 1: 42. Slide 2: Questions? May 06 04:36:02 oh no you didnt May 06 04:36:03 lol May 06 04:36:10 j/k May 06 04:36:19 (subtext on slide 2: see slide 1) May 06 04:36:23 haha May 06 04:36:23 yea, i mean both have good points and bad ones May 06 04:36:51 i find Android suites me best, but i think most /true/ devs might say that May 06 04:37:02 ;) May 06 04:37:05 even woz likes android May 06 04:37:09 I love listening to our iOS developers argue about why Android/Java sucks May 06 04:37:20 they're usually always wrong May 06 04:37:24 factually May 06 04:37:30 JakeWharton: i'm porting an IOS app right now and I swear obj-c looks like unruly spaghetti May 06 04:37:34 just hit them with the big NS May 06 04:37:36 lol May 06 04:37:41 I looked at the code once, useless to me, anyway. May 06 04:37:50 i am porting the user experience, I guess :P May 06 04:38:04 the one guy thinks we have to wrap every method in try/catch May 06 04:38:13 and sometimes nest try/catch May 06 04:38:13 Is android 2.3.7 API10 or API11? May 06 04:38:16 great way to defeat the purpose of exceptions May 06 04:38:18 10 May 06 04:38:21 11 is honeycomb May 06 04:38:29 that guy should read the first 5 pages of stroustrups book May 06 04:39:25 on a side note, im told this is good.. not got around to watching it myself http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Keynote-Bjarne-Stroustrup-Cpp11-Style May 06 04:40:16 it crashed google chrome :( May 06 04:40:45 not surprising May 06 04:40:48 back to firefox. May 06 04:40:58 I get mad at chrome and switch to firefox, then back to chrome, every month or so May 06 04:41:52 obj-c is c with smalltalk sprinkled on top. i like it. May 06 04:42:09 syntx ugly? yeah, but prefer it to java except for its lack of namespaces May 06 04:43:19 g00s: the only problem I have with obj-c is that it definitely requires an IDE May 06 04:43:40 g00s: since the object declaration and implementation are always seperated May 06 04:45:18 like c and c++ ? :D May 06 04:45:34 Napalm, damn, you're still up? May 06 04:45:42 yup May 06 04:45:50 im coding like a mad monkey from hell May 06 04:45:55 :O May 06 04:46:08 i think i might have red eyes at the moment May 06 04:46:09 at least your not a rabid mad monkey from hell May 06 04:46:13 the screen is all blurry May 06 04:46:17 lol May 06 04:46:34 even those aren't as bad as fanbois though :) May 06 04:49:36 ignorance bothers me more than fanboyism May 06 04:50:27 g00s and JakeWharton: http://android.netcore2k.net/TypefaceOverride.zip if you want it, it will allow you to override the typeface assignment on ALL views May 06 04:50:31 Roboto ftw! May 06 04:50:50 you should watch that stroustrup video that you linked May 06 04:50:54 it's pretty good May 06 04:51:01 its on my list May 06 04:51:08 cant detract from my coding atm May 06 04:51:13 makes me want to write C++ right now, but I am kind of buzzed so May 06 04:51:13 or i will loose the plot May 06 04:51:30 Nothing in the world makes me want to write C++ May 06 04:51:30 a taste of stroustrup will do that to you May 06 04:52:20 i never really liked c++, but after reading several of stroustrup's books, i came to appreciate his great intellect - i think for greater than goslings May 06 04:52:23 *far May 06 04:55:18 ok, one reason chrome is better than firefox. opening a private browsing session in firefox closes your regular one :| May 06 04:58:20 JakeWharton, so, why haven't you merged viewpagerindicator into abs? May 06 04:58:31 because they're unrelated May 06 04:58:45 and monolithic frameworks such May 06 04:58:45 the tab indicator looks like it can be re-used in abs May 06 04:58:56 is there a standard way to store a library of songs for an mp3 player? May 06 04:58:56 building an app that uses both frameworks is kind of a pita May 06 04:59:06 for some reason, vpi had a default target of android-5 May 06 04:59:08 so it wouldn't build May 06 04:59:19 or does the list get created at every startup? May 06 04:59:21 and the fact that both depend on the android-support lib is a pita, too May 06 04:59:42 sounds like both are ADT problems May 06 04:59:44 need to remove the .jar from both and make them point at a new library reference May 06 04:59:52 adt, no May 06 04:59:56 but it is a standard sdk build problem May 06 05:00:35 RustyShackleford: thats what MediaScanner is for see http://developer.android.com/guide/topics/data/data-storage.html#AccessingExtFiles May 06 05:00:48 the latest ADT won't include multiple .jars from library projects May 06 05:00:59 is that so May 06 05:01:00 * pfn shrugs May 06 05:01:03 * pfn doesn't use adt May 06 05:01:07 but tried building with ant May 06 05:01:09 it wasn't happy May 06 05:01:29 well I use maven May 06 05:01:30 works great May 06 05:01:38 yeah, it works fine in my sbt build, too May 06 05:03:13 so… no problem! May 06 05:04:51 although, I need to hack my sbt build to avoid the duplicate jar problem May 06 05:05:05 * pfn should get around to fixing that some time May 06 05:05:32 just unjar everything and rejar everything up before passing it to proguard/dex May 06 05:05:39 sounds hacky May 06 05:05:45 why don't you pull it from maven central? May 06 05:05:47 there isn't any other way to dedupe May 06 05:06:04 and exclude the transitive dependency May 06 05:06:18 I guess, if I wrote support for apklibs May 06 05:06:26 but I don't wanna figure that out May 06 05:06:43 Napalm, so I"m getExternalFilesDir(DIRECTORY_MUSIC) May 06 05:06:44 they're just a .zip of the project folder May 06 05:06:47 is this foolproof May 06 05:07:05 for example, what if music is spread across multiple directories? May 06 05:07:42 that returns the standard location for music May 06 05:08:12 so then I want to search the entire sd card? Where is the standard location for music? May 06 05:08:36 yes. and you just wrote the code to get it. May 06 05:08:41 RustyShackleford: use the Media content provider May 06 05:23:01 This talk is reminding why I dislike C++ May 06 05:27:27 I stopped watching a while ago May 06 05:28:24 Hello, has anyone ever been in a similar situation like me where I created my own Quiz App and I am trying to bundle 100 questions with it. 100 questions seems like a pretty large amount of data to hard-code inserting it into the database at first run. What can you guys suggest I do, put it in some sort of external file like XML and parse it at first run? May 06 05:28:54 100 questions is not a lot of data May 06 05:29:00 Agree May 06 05:29:13 So should I just hardcode it in Java? May 06 05:29:17 no May 06 05:29:25 it should be in a sqlite database May 06 05:29:35 if you need to change them, then you should pull them from a web service May 06 05:29:48 Yeah I have that, but I'm asking how do I put it in the database at first run May 06 05:29:54 you don't need to May 06 05:29:58 Like making a lot of insert statements hardcoded in Java? May 06 05:30:00 you can just stick a database in your assets/ dir May 06 05:30:41 Makes sense! May 06 05:32:27 Ok how about actually inserting it into the sqlite database before sticking it in my assets/dir, do I manually insert the 100 questions + 400 choices using the shell? What would be a less painful approach? May 06 05:32:45 write a script to do it May 06 05:33:44 Like a script that would parse the .doc file where the questions are? May 06 05:34:43 doc? ha! May 06 05:34:49 oh wait May 06 05:34:52 it's a pdf May 06 05:35:05 oh, even better May 06 05:35:30 Why is it better? May 06 05:35:33 first thing to do is to get the data out of that paper-replacement format May 06 05:35:44 into a csv or something parseable May 06 05:36:34 But that would mean I have to manually make it parseable? May 06 05:36:55 Indeed May 06 05:37:05 Not a chance you're going to parse it from a pdf May 06 05:37:11 And I was just told the 100 questions + 400 choices is just a single module, and I need to bundle 8 modules with it May 06 05:37:21 Oh great May 06 05:39:00 Oh well, might as well start on it, thanks for the advice guys! May 06 05:40:30 Last question guys May 06 05:42:29 If I make an SQLiteDatabase using native Java and JDBC (So that I can easily input my csv file to an SQLiteDB), and I stick it in my assets/dir, would it be compatible? Or should I create a DB first in the emulator, pull it, then use that one to insert files from a native Java app with JDBC? May 06 05:43:13 convert your database with human https://www.mturk.com/mturk/welcome May 06 05:43:40 ocr May 06 05:44:21 for a very small database like he has I guess it might suffice to use OCR and then edit it a bit himself May 06 05:44:44 or text pdf just copy paste May 06 05:45:01 i'd rather hire someone for two bucks to do all the copy paste for me May 06 05:46:13 No I'm asknig about the compatibility between an SQLite DB made from Java JDBC and the one made from Android May 06 05:46:58 sqlite is sqlite May 06 05:47:11 sqlite is platform dependent, is it not May 06 05:47:16 32bit vs. 64bit and endianness May 06 05:48:14 life is life! May 06 05:48:29 pfn: Oh ok, thanks for the clarification! May 06 05:48:33 "A database that is created on one machine can be copied and used on a different machine with a different architecture." May 06 05:48:41 http://www.sqlite.org/onefile.html May 06 05:48:55 franzks: next time check your facts before praising someone. May 06 05:49:00 readme: Thanks, that is good news! May 06 05:49:14 I've been reading through docs for quite a bit. I still can't figure this out May 06 05:49:42 I want to retrieve a list of all songs in storage May 06 05:50:03 Then be able to sort by album/artist/etc. May 06 05:50:25 I think I need all this information before I can draw the gui for this media player May 06 05:51:58 look at the source for the platform music player May 06 05:52:23 RustyShackleford: http://pastie.org/3866338 May 06 05:52:37 don't use the deprecated apis, though :P May 06 05:57:14 readme, so all the songs are already in a database? May 06 05:57:44 yes May 06 05:59:02 MediaStore.Audio.Media.EXTERNAL_CONTENT_URI is what exactly? May 06 05:59:47 it's a mediastore external content uri for audio media May 06 06:00:27 LETS call it, an MSAMECU for short May 06 06:01:14 * readme goes to bed May 06 06:05:18 Android seems to "upgrade" my oggs when I load them with SoundPool. By that I mean if I encode them as 8KHz mono 8 bit, they take up more memory than 11KHz stereo 16 bit. Is there another format I could use or something? May 06 06:07:50 Sorry May 06 06:08:00 I was confused May 06 06:08:06 It's not soundpool at all May 06 06:08:23 I'm using soundpool on < 2.3, but this device has 2.3.4 May 06 06:08:28 So ignore me May 06 06:09:45 man that talk was long May 06 06:19:50 ? May 06 06:21:52 some C++ crap May 06 06:22:07 not sure why I watched it May 06 06:25:50 Hi, I'm trying to port some java applet lib, but it fails to work, it gives me the following exception: java.security.NoSuchAlgorithmException: SSLContext SSL implementation not found, when using: SSLContext context = SSLContext.getInstance("SSL"); May 06 06:26:09 I'm using API version 7 on my 2.1 device May 06 06:26:29 haha May 06 06:26:30 nice May 06 06:26:46 I used to see c++ as a disaster May 06 06:26:51 but the more I play with it, I like it May 06 06:26:58 it IS a mess May 06 06:27:20 but still amazing what you can do with it May 06 06:29:05 * g00s does not understand pinterest. maybe i'm just getting too old. it makes twitter seem profound. May 06 06:29:17 haha May 06 06:29:30 I thought the very same thing when twitter first started making the rounds May 06 06:29:32 more like May 06 06:29:55 "...this is the dumbest fucking idea I've ever heard of... its facebook minus the stuff that actually makes facebook worth a shit... nobody will use this..." May 06 06:30:00 and sure enough I was hugely wrong +) May 06 06:30:07 :) May 06 06:30:10 people are lemmings and like to be told what they like May 06 06:30:29 and the proof is in stuff like breaking dawn and hunger games and shit May 06 06:30:31 harry potter May 06 06:30:40 not saying they were the worst things in the world May 06 06:30:46 but hoenstly twilight was crap May 06 06:30:50 the mor banal and inane, the easier it is to share inflated puffery of yourself; the more likely success i guess May 06 06:31:13 haha May 06 06:31:47 what I'd say the most successful people in the world had the ability to turn off the second guessing, *OR* are completely oblivious and have no idea about competition May 06 06:32:09 JakeWharton: i just finished watching it also May 06 06:32:22 so instead of retweet, they have repins May 06 06:32:25 zomg May 06 06:32:38 I've been told its like twitter with twitpic for women May 06 06:32:49 I've never signed up for twitter or pintrest May 06 06:33:22 i'm a hard sell on social though - i think fb and g+ are useless crap also May 06 06:33:29 not me May 06 06:33:40 you didn't like harry potter or hunger games? May 06 06:33:42 facebook is decent for keeping family up to speed and avoid having to call them and shit May 06 06:33:48 i thought they were good easy reads May 06 06:33:59 for example, when i go to the g+ page, i wish there was a 'stfu' button that just silenced everybodies replies May 06 06:34:08 twilight, on the other hand, is crap May 06 06:34:16 i had the misfortune of reading all four books May 06 06:34:34 JakeWharton - I refused to read harry potter as it seemed like it was blatant targetting of that teen audience... and I have a hard time getting into stuff thats super popular... just because its super popular May 06 06:34:38 how the fuck did you read 4 twlilight books ? May 06 06:34:44 girlfriend May 06 06:34:45 JakeWharton: why didnt you at least stop after the first twilight book May 06 06:34:46 lol May 06 06:34:48 I got suckered into watching the movies May 06 06:34:49 i would have aborted after a few pages of the first May 06 06:34:54 haha May 06 06:35:04 aborted as in suicide May 06 06:35:12 aborted the author May 06 06:35:15 and man it was a huge progestrone fest May 06 06:35:36 thats the gay ass shit women like May 06 06:35:37 harry potter is actually pretty decent, if unsophisticated... twilight is just appalling May 06 06:35:46 oh this guy is emo, and he likes this girl, and this other dude likes this girl May 06 06:35:53 i only had to suffer the first two movies May 06 06:35:56 then we broke up :D May 06 06:36:02 they both have life so hard because one guy is a wolf and the other a vampire May 06 06:36:11 think up some excuse to have a guys shirt off every 3 seconds May 06 06:36:17 haha May 06 06:36:29 I went to see one movie, under a misunderstanding... she thought I wanted to go, I was just going to laugh at it... she went to see the other movies without me May 06 06:36:43 seriously it pisses me off such crap is so successful May 06 06:37:11 and my wife is *HUGE* into that kinda bs May 06 06:37:35 I get stuck watching pretty little liars, and once upon a time and all these teeny bopper night time soap opera shows May 06 06:37:52 so bad, I'd consider cancelling cable/sat so I didnt have to watch it, and lose all the stuff I watch too =) May 06 06:38:36 hahaha May 06 06:38:53 we have a good agreement on that... she watches whatever she wants, I mess around on IRC... she doesn't try to get me to watch her stuff May 06 06:39:05 I assume twilight speaks directly to a common female fantasy May 06 06:40:00 I prefer not to think about it much lest I turn even more misogynistic I already am May 06 06:40:39 alankila: enture books have been written about it http://www.amazon.com/Seduced-Twilight-Contradictory-Messages-Popular/dp/0786460423 May 06 06:41:06 i would put it on your wish list if i could May 06 06:41:08 :) May 06 06:41:55 I prefer your impotence on the matter. May 06 06:44:16 sooo . i have this issue. i create a calendar object in the Eastern Timezone. clear() it, and add some seconds. When i print it out, its one hour off. how the fuck. May 06 06:44:47 does SimpleDateFormat not take into account dst? that would be very weird May 06 06:46:03 omg tonight is a supermoon, i bet ron_frown is howling May 06 06:46:43 I was texting my buddy who goes to school in new york and his texts were labeled 1 hour earlier May 06 06:46:52 but he's two hours ahead May 06 06:47:57 * g00s sighs May 06 06:48:02 negative May 06 06:48:13 I'm making a Keynote theme based on the Android Design Guidelines May 06 06:48:19 Looks damn sexy May 06 06:48:36 I abandoned impress.js for my presentation which was sad :( May 06 06:50:05 I have no idea what your presentation was May 06 06:50:16 I wish there was a better tool for mocking up android ui's btw May 06 06:50:21 pencil aint terrible May 06 06:50:37 bu the templates google released for it, leave a lot to be desired as far as ics goes May 06 06:51:08 someone was showing me some feature in xcode that shows the navigation between the screen, and maybe some mockup May 06 06:51:15 what is that called? May 06 06:51:24 what? May 06 06:51:42 storyboards? May 06 06:51:49 yeah ! May 06 06:52:17 I havent been successful in using them... apparently storyboards + xcode + 8gb ram mbp was not happy May 06 06:52:30 got about 5 view controllers in the storyboard, and xcode was a wrap May 06 06:52:59 Xcode is so much more complicated to learn IMO compared to android development May 06 06:54:57 its just a different line of thought May 06 06:55:03 I dont really think its considerably worse May 06 06:55:14 i found it way more confusing May 06 06:55:28 personally, i picked up android development much faster May 06 06:55:38 well xcode 4 is a lot better... its because basicallly all the tuts the avg person would encounter are forcing you to use mvc May 06 06:55:57 basically you create a class, and expose IBActions for methods/procedures May 06 06:56:01 and outlets for properties May 06 06:56:04 can someone example what the tag parameter does in the Log class? May 06 06:56:14 interfacebuilder lets you connect ui elements to those actions/outlets May 06 06:56:31 RustyShackleford: use the class name May 06 06:56:32 log.i("boo","eat shit!") May 06 06:56:36 boo: eat shit! May 06 06:56:38 haha May 06 06:56:43 huh, lumia 900 is the #9 best selling phone on amazon - not bad for something nobody has :) May 06 06:56:48 it's just to keep track of where these messages are being sent from? May 06 06:56:52 yes May 06 06:57:01 and you can use it in filtering with logcat May 06 06:57:32 so it's an arbitrary choice May 06 06:57:39 it can be whatever I want May 06 06:57:58 once you see the limitations of how you filter, you may rething your tag strategy May 06 06:58:27 the way you link views is confusing May 06 06:58:35 honestly I just usually do what I see all over in android source May 06 06:58:39 put a private static final String TAG = "ClassName"; at the top of each class and use it May 06 06:58:41 which is create a tag constant per class May 06 06:58:44 and classname May 06 07:01:43 thats what i do, but find it frustrating when you have hundreds of classes - and just want to see your own shit in logcat May 06 07:01:56 that's when you filter by PID May 06 07:02:01 i have had issues with adt logcat following by PID May 06 07:02:18 and you can't do it from adb by itself, from what in understand May 06 07:02:29 well, unless you write a script like proclogcat May 06 07:02:36 but that doesn't work now either :) May 06 07:02:37 grep May 06 07:02:59 the pid changes May 06 07:03:07 you have to map the pid to the package May 06 07:04:29 so write a three line bash script that takes a package name, listens to logcat for the launch and then runs logcat | grep pid May 06 07:04:58 mkay May 06 07:05:17 I just use IntelliJ May 06 07:05:37 does IntelliJ do this ? May 06 07:06:41 I don't know about that specifically May 06 07:06:52 probably May 06 07:06:55 it does everything else May 06 07:07:50 i found it easier to do ANDROID_LOG_TAGS='ActivityManager:I AlarmManagerService:S BATTD:S Calendar:S ConnectivityService:S EventLogService:S GlsClient-query:S GoogleLoginService:S GTalkService:S HierarchicalStateMachine:S IInputConnectionWrapper:S InputManagerService:S KeyCharacterMap:S MediaProvider:S MediaUploader:S MobileDataStateTracker:S NetworkLocationProvider:S NetworkManagmentService:S NetworkStateTracker:S PackageManager:S May 06 07:07:50 SntpClient:S SystemClock:S Tethering:S VoiceDialerReceiver:S WifiService:S dalvikvm:S installd:S global:S' May 06 07:07:57 :) May 06 07:08:49 my god, there's some smarts to adb logcat to shut it up? May 06 07:08:58 i have no idea what that does May 06 07:09:04 but it looks far too complicated to maintain May 06 07:09:08 JakeWharton any idea how to pause logcat in gd intellij? May 06 07:09:13 No it does not. Copying that immediately. May 06 07:09:14 click somewhere May 06 07:09:22 obvious May 06 07:09:23 haha May 06 07:19:31 1-click ordering on amazon is so dangerous to my bank account May 06 07:20:07 And Amazon knows that May 06 07:21:40 yes they do May 06 07:22:04 i can't wait until they can offer same-day delivery May 06 07:22:54 hopefully i'll still be alive May 06 07:23:42 keynote doesn't let you copy and paste objects from master slide to master slide May 06 07:23:43 wtf May 06 07:24:50 booooo May 06 07:25:32 gah May 06 07:25:43 and it defaults to a middle vertical alignment on shit May 06 07:25:46 i don't know how to change that May 06 07:25:49 JakeWharton haha I accidentally bought some shit on amazon because of that May 06 07:25:59 i just bought paper towels May 06 07:25:59 well I mean I was going to buy... some diesel additive May 06 07:26:02 ultimate in laziness May 06 07:26:04 but I didnt need a couple gallons May 06 07:41:13 wut there is no markdown based presentation tool ? May 06 07:41:48 g00s: Hehe.. that seems like a pretty easy thing to make. I'd be surprised if 10 of them didn't exist. May 06 07:41:57 http://tobyho.com/2011/12/21/preston-presentation-tool/ May 06 07:43:00 :) :) http://www.hecticgeek.com/2012/02/tpp-command-line-text-presentation-ubuntu-linux/ May 06 07:43:04 http://bartaz.github.com/impress.js/ May 06 07:43:11 I originally started with impress.js May 06 07:43:12 b May 06 07:43:22 but the slides were due this past tuesday so i'm hashing them out in keynote real quick May 06 07:44:21 if I have time I'll go back and use impress.js May 06 07:46:50 g00s: Another one is Vroom - http://search.cpan.org/~ingy/Vroom-0.25/ May 06 07:47:21 It's not Markdown, but it is quick and effective. May 06 07:47:28 did you see that Reto did his I/O presentation on a tablet? May 06 07:47:35 he said he was going to open source it but never did May 06 07:47:39 i'll have to poke him to May 06 07:47:45 rking: but … its perl May 06 07:47:49 :( May 06 07:48:02 Hehe.. like 50% of your running software is Perl. May 06 07:48:14 i use ack a lot :) May 06 07:48:18 It's more YAML than it is Perl. May 06 07:50:41 JakeWharton: He was asked that question in a dev hangout.. iirc he mentioned something about doing it around google io May 06 07:51:10 i'm always curious to see code from the masters :) May 06 07:51:27 i'd like to see the new iosched too. the last one was a clusterfuck May 06 07:51:55 didn't manage the cursors correctly - was the biggest bug May 06 07:52:21 why not just become a master May 06 07:52:24 and write awesome code May 06 07:52:34 there will always be someone more master :) May 06 07:52:42 hello all. i'm trying to figure out what method is best to get information from Activity->FragmentA->FragmentB back to Activity->FragmentA, where the arrows represent parent/child relationships. May 06 07:52:51 What i've found on google so far is confusing me May 06 07:53:33 what kind of info? May 06 07:54:06 have to part/join for new themes to take effect in Colloquy May 06 07:54:28 but now I have Roboto + Android Design colors :D May 06 07:54:34 heh May 06 07:54:39 I set roboto as my font May 06 07:54:44 but I didn't like it -_- May 06 07:54:44 hesperaux: startActivityForResult in A? May 06 07:54:50 the Gs look funny May 06 07:55:01 ggGG May 06 07:55:07 the info would be several arrays or an object of them May 06 07:55:31 containing which items in a list are checked, as well as some form data for each list element (a numeric value provided by the user for each list item) May 06 07:55:32 hesperaux use call backs in your fragments May 06 07:55:43 Do you have a fragment in a fragment? ;d May 06 07:55:46 oh... true May 06 07:55:53 also that May 06 07:55:59 don't do Fragmentception.l May 06 07:56:16 SimonVT, no, the fragment is transacted May 06 07:56:50 just pass the info to the new fragment from your hosting activity May 06 07:57:25 new theme re-enabled join/part messages… damn May 06 07:57:38 where is a good place too look for how to make a button open a app drawer? May 06 07:57:40 Your Activity should be in charge of passing date, doing transactions, etc.. So it's rather easy May 06 07:58:04 i know how to pass data into a fragment I suppose, but how to get it from a fragment back to the activity? May 06 07:58:21 expose an interface in each fragment, have the activity implement it May 06 07:58:23 Callback interfaces May 06 07:58:31 That's what I would do May 06 07:58:31 hesperaux: (FooActivity) getActivity() followed by whatever ... May 06 07:58:34 other option is. May 06 07:58:35 yea May 06 07:58:35 i don't know what that means =/ May 06 07:58:36 that May 06 07:59:17 alankila, you're suggesting that i get the activity within the fragment and then set predefined variables or call predefined functions right? May 06 07:59:19 hesperaux: http://developer.android.com/guide/topics/fundamentals/fragments.html#EventCallbacks May 06 07:59:30 This is the first thing you should have read May 06 07:59:52 wtf try/catch block? May 06 08:00:10 instanceof is so much cleaner May 06 08:00:10 hesperaux: I would say that you would be calling predefined methods. It is hard to call not predefined methods. May 06 08:00:39 i was suggesting that I may not want to do that because it would require creating lots of functionality in the activity that should be fragment-based May 06 08:00:54 the activity is the dispatcher between fragments May 06 08:01:08 that logic should be there May 06 08:01:18 Fragment > fragment communication should NOT be fragment-based .. that's entirely up to the activity May 06 08:01:21 the activity is what knows whether you're one-pane or two, etc. May 06 08:01:48 ok May 06 08:01:57 The Fragment does not know whether it's in a 1-pane, 2-pane or even 3-pane layout. It doesn't know what Activity it is attached to. It only knows that it can rely on an interface to relay information back May 06 08:02:18 at first i was doing too much in the activity, now I am doing too much in the fragment... *sigh* May 06 08:02:31 It's a fine balance :P May 06 08:02:36 the question is not about doing too much or too little, but knowing their roles. May 06 08:02:44 which are, arguably, difficult to know May 06 08:02:53 so it seems May 06 08:03:24 it's difficult to do things right the first time May 06 08:03:48 that's why IDEs include refactoring :) May 06 08:03:58 hehe May 06 08:04:03 There should be a button to "make this work in android properly" May 06 08:04:13 I'd push it every day May 06 08:04:16 my project is becomming a mess May 06 08:04:33 luckily i think most of the work has been on backend classes for database work and stuff May 06 08:05:20 i feel like those are kinda messy, but don't know how to make it neater. as for the GUI stuff, at this point I'm just fiddling with fragments to show/test the data May 06 08:05:44 i'm trying not to get locked into any specific UI flow May 06 08:06:30 which is why i'm trying to do too much in the fragments probably. I know the UI will be different later. I've been treating the activity as a UI handler =/ May 06 08:07:19 just try to make your fragments so they could be place in any activity May 06 08:07:23 I think i'm going to start doing this: http://codr.cc/b77f43/java May 06 08:07:26 not just your one spicific one May 06 08:07:38 because then it was pointless to put it as a fragment anyway May 06 08:07:48 public class MyFragment extends ContractFragment { public interface Contract { … } } May 06 08:08:02 t0mless, that's what i've been trying to do. It just gets confusing when I have to decide if a fragment should do something or the activity May 06 08:08:11 android is chock full of masturbatory java classes May 06 08:08:41 there's so much abstraction i can't figure out what's going on half the time May 06 08:08:49 or at least I hope such a thing as ContractFragment doesn't exist May 06 08:08:56 i just made that May 06 08:09:09 y u no click on my link :( May 06 08:09:19 hehe May 06 08:09:20 oh May 06 08:09:46 JakeWharton, what does this do? May 06 08:09:54 more importantly, does that compile? May 06 08:09:57 it should May 06 08:10:00 why wouldn't it? May 06 08:10:03 * alankila is dubious about the instanceof T May 06 08:10:09 hesperaux: it ensures that the activity implements the fragments interface May 06 08:10:09 Generics son. May 06 08:10:30 but in the compiled form that instanceof T is just instanceof Object in the class file May 06 08:10:33 so ... May 06 08:10:54 that being abstract and leaving T unspecified may save it though. May 06 08:11:07 yeah shit May 06 08:11:09 need a TypeToken May 06 08:11:20 because the concrete class does record the types, it just may be that it has to be done via acquiring the parameterized types manually and using reflection May 06 08:11:30 don't know if this works in android May 06 08:11:37 * hesperaux explodes May 06 08:11:47 but it works in jdk May 06 08:13:26 * alankila has one advice: don't play type games in java, you'll just be sorry if you do :-p May 06 08:13:36 what about minecraft? May 06 08:13:41 i play that in java May 06 08:13:47 * t0mless lols May 06 08:13:51 type games May 06 08:13:53 inb4 omg minecraft's code sucks May 06 08:14:39 alankila, i wouldn't know if i was playing a type game. that's how smart i am May 06 08:15:27 i wish i could send my code to a service that sends it back with tons of suggestions and critiques May 06 08:15:56 alankila: updated :) May 06 08:16:11 JakeWharton: yay May 06 08:16:15 so hacky May 06 08:16:29 you did not write Class though May 06 08:16:36 yeah it doesn't let me May 06 08:16:38 try it May 06 08:16:42 whut, that's odd. May 06 08:16:57 stupid html escaping is stupid May 06 08:17:02 or lack thereof May 06 08:17:11 ah, you mean that May 06 08:17:15 I thought java forbade it May 06 08:17:34 oh, no. just this online editor thing has trouble with them May 06 08:18:17 anyway I sort of wish that java's compiler detected this case and just allowed it May 06 08:18:46 so use of the type T is permissible if you are in an abstract class because it gets specified by the concrete class May 06 08:20:13 every such use would look like utter rubbish in the class file, given the lack of reification, but at least the source would be pretty and we could pretend it worked properly. Alternatively java could specialize these methods somehow in the subclass maybe, if there was a keyword like "reify", imagine it like this: "reify public void foo()" followed by whatever uses the type May 06 08:20:15 I wish you could return as a type May 06 08:20:24 except it would still be challenging, it'd be some kind fo classloader problem then May 06 08:20:42 but I think getting that shit to work one way or other would be great May 06 08:21:49 the reason why it's a classloader issue is that I imagine you would have libraries declaring these abstract types and they're already compiled and you have to at class loading time look for the superclass, see the god damn reify tag there, and then start to emit code in the class to fill in the concrete types ... May 06 08:21:49 I guess the try/catch method would work too May 06 08:21:58 i can't make sense of this section of the guide May 06 08:22:06 the one you linked May 06 08:22:31 I'm pretty sure that java will not do compiler games if it ever gets them. This is so clearly a runtime problem that it needs support there. :-/ May 06 08:23:17 this section talks about implementing an interface in the fragment, but it shows no code that implements whatever they're trying to do in the activity May 06 08:24:04 hesperaux: the implementation of that is up to you May 06 08:24:06 they make a listener function, but i can't figure out why it ever gets called May 06 08:24:28 anyway I'm a lazy git and I wouldn't even bother with a listener, I just cast to the single activity that hosts my fragments. If I need flexibility for more activities, I add the interfaces then May 06 08:24:36 why should a method i define in a fragment get called automatically by the framework? my head hurts May 06 08:24:38 but feel free to dislike my style May 06 08:25:02 * SimonVT dislikes alankilas style May 06 08:25:03 :p May 06 08:25:07 lol May 06 08:25:23 I just hate writing extra code, sight unseen, on the theory that it will one day be useful. Best just keep it stupid and simple and evolvable. :_p May 06 08:26:02 i don't have the foresight to design an application to be modular May 06 08:26:07 * Hiraghm sighs May 06 08:26:11 nor do I have the knowledge of how to do that cleanly May 06 08:26:19 JNI is whipping my butt :( May 06 08:26:29 because there's a thing called complexity budget and all extra flexibility you add to a system adds towards that. And when you exceed that complexity budget -- easily definable as the maximum amount of complexity your brain can handle -- your flexibility stands in the way of evolving the system to the directions it actually needs to go May 06 08:26:32 every time i've tried (and not just in java) I end up making things worse May 06 08:26:49 indeed May 06 08:27:39 alankila, but somehow lots of people manage to do it. i don't know how it's possible May 06 08:27:56 i suppose they're just talented in this field May 06 08:28:58 hesperaux: at least you are employing your higher brain functions searching for the method May 06 08:29:08 that means you will most likely learn a style that suits you May 06 08:29:19 hopefully May 06 08:29:30 mine is basically the tired old KISS May 06 08:29:41 at this point, my higher brain has shut down and i'm starting to stare at stuff. it's 3:30am so I should probably sleep now May 06 08:29:47 I hate code and I write the least possible amount of it that just does the job. May 06 08:29:57 lol May 06 08:30:20 i try to avoid extra junk that seems to do nothing, and excessive separation of tasks May 06 08:30:36 doesn't mean I don't employ OO though. Sometimes you have to, for the design to remain palatable. 1000-line methods look as awful to me than anybody else May 06 08:30:46 lol May 06 08:30:55 i worry about making too many classes May 06 08:31:46 having too many files also hurts my brain, and then there's the question: by having all these objects, am I introducing a very bad algorithmic slowdown into the program? May 06 08:31:47 once a method gets to about 30 lines, we split May 06 08:32:11 99% of methods that big can usually be further modularized May 06 08:32:44 does anybody here have any experience with JNI? May 06 08:32:46 hahaha May 06 08:32:48 awesome May 06 08:32:50 * Hiraghm doesn't look optimistic May 06 08:32:56 Amazon's app of the day is XMen May 06 08:32:59 hesperaux: number of classes is not necessarily a factor towards speed because of the jit which has a habit of inlining method calls, for instance. java's beautiful side is that you can in general ignore performance and just write the obvious code that will work May 06 08:33:00 the old Konami one May 06 08:33:23 that is so sexist, t0mless. "XMen"... shouldn't it be "XPersons"? May 06 08:33:23 alankila, is that why java is known for its slowness? =/ May 06 08:33:30 * Hiraghm ducks and runs away May 06 08:33:35 i know that some of that comes from being on a VM May 06 08:33:42 hesperaux: nah... that reputation was born before it had JIT, pretty much May 06 08:33:45 no, people are just dumb May 06 08:34:08 Hiraghm I will literally hunt you down and punch you in the face. May 06 08:34:20 lol May 06 08:34:26 stand in line, t0mless. stand in line May 06 08:34:39 hesperaux: since the time people said java was slow, 10 years have passed, and computing power increased. And people have started to write programs increasingly in scripting languages with their own kind of VMs anyway, because all that performance and memory simply makes it more acceptable May 06 08:35:01 Yo JakeWharton, interfaces are implicitly static :p May 06 08:35:04 speaking of java being slow May 06 08:35:08 my tablet is running like shit atm May 06 08:35:15 alankila, that's hard for me to swallow when i have to write code for microcontrollers :D May 06 08:35:16 so's your face May 06 08:35:20 lol May 06 08:35:21 haha May 06 08:35:53 and btw, python coders make me severely upset (read: rage) May 06 08:35:58 I have a C++ class; it compiles into a library using ndk-build just fine. But, I don't know how to access the functions within the class from the java side :( May 06 08:36:14 there's something fundamental I'm not able to wrap my brain around and it's driving me crazier. May 06 08:36:18 hesperaux: in any case I have seen a fairly complicated program ported line-by-line from C++ to Java, and then run as compiled by gcc and as jvm. The performance of the java codebase was within factor of 2 of the C++ codebase, so I thought java did quite well May 06 08:36:31 Hiraghm: you put native methods on a class May 06 08:36:40 and call System.loadLibrary("name") May 06 08:36:48 alankila, i guess that's acceptable May 06 08:37:09 too bad it's not possible to compare C to java May 06 08:37:15 there's really not much basis to call java slow anymore. The other problem, garbage collection, has been improved several generations from the time people got the idea that GC means your app stops every now and then May 06 08:37:55 I suppose it still technically stops, but the pause lengths can be very short, often mere milliseconds. May 06 08:38:01 but how do the native methods call the functions? Normally it'd be something like "myObject = new myClass(); myClass.disFunction();" May 06 08:38:21 so do I create an instance of the C++ object within my java code? May 06 08:38:30 * Hiraghm hopes he's just overthinking this May 06 08:38:52 hmm May 06 08:39:10 it's been 5 years or so since I've done any C++, so I'm quite rusty. May 06 08:39:43 i gotta sleep May 06 08:39:57 Hiraghm: I've seen native C++ objects stored on some private int object; on the java class May 06 08:40:00 gnight all, thanks for the chat May 06 08:40:03 it's the pointer (although this is not 64-bit clean) May 06 08:40:25 I've no idea if that is preferable, or if it should be done in some more intelligent way. May 06 08:40:44 SimonVT: should getContract() be final? May 06 08:40:47 Hiraghm: but the guy who did this basically wrote N_init() to call native init method that allocated the object and stored it May 06 08:40:51 i hate how so much shit in Android is final though... May 06 08:41:02 plus for testing you might want to override? May 06 08:41:13 but then you could just mock that method call May 06 08:41:40 JakeWharton: Hm, probably.. I mean, you shouldn't be overriding it May 06 08:42:26 it might be better to make it private long object to extend it to full 64 bits and then just cast the top 32 bits away if your architecture doesn't have them May 06 08:43:23 JakeWharton: Why not make it protected May 06 08:43:29 testing May 06 08:43:30 * Hiraghm scratches his head May 06 08:44:00 alankila, it embarasses me to admit I barely understood what you just said May 06 08:44:12 (I'm going to hide behind the fact that it's a quarter til 4 am here) May 06 08:44:33 Hiraghm: okay. You have your java object, which has a constructor and destructor. The constructor calls N_init, destructor N_destroy, or something. There's a "private long object" on the java instance. May 06 08:44:55 Hiraghm: N_init allocates C++ object and stores the pointer over jni methods to the java class's object property, every other method takes that object value and casts it to the class May 06 08:45:05 N_destroy just deletes the object May 06 08:45:34 hm. thanks. let me try wrapping my brain around that a minute. May 06 08:45:41 this is one way to do it. It could well be an antipattern for all I know May 06 08:47:13 so N_init is a java method... how does it "allocate" a c++ object? May 06 08:47:54 (yeah, I know everyone, I'm being incredibly stupid here...) May 06 08:47:58 it's not a java method May 06 08:48:02 you write private native N_init() May 06 08:48:18 then javah will spit out a header, you implement it, link it to your library May 06 08:48:30 then you can call N_init May 06 08:48:38 whoa... okay, I think I'm catching on to something I missed here... May 06 08:48:54 in the tutorials on JNI for Java (not android), they talk about "javah" May 06 08:49:09 but I haven't seen it referenced in any of the tutorials for android JNI May 06 08:50:00 I assume they already know how to do this stuff May 06 08:50:30 javah... I need to invoke this, like on the command line? May 06 08:50:34 javah takes a java class containing native method declarations and writes out the appropriate header with method descriptions for you to implement May 06 08:50:50 javah this.that.other.Class May 06 08:51:47 okay cool. I think May 06 08:51:47 and you may have to extern "C" { }your whole jni-to-C++ bridge May 06 08:51:52 not sure how that goes May 06 08:52:08 I'm not there yet, alankila, but you've definitely set me back on the path May 06 08:52:18 (I was about ready to give up altogether) May 06 08:52:27 No it looks like the header already specifies C linkage May 06 08:52:49 so you don't have to worry about extern "C" yourself May 06 08:53:25 woo hoo! May 06 08:53:47 I found a stackoverflow post which used "private long handle" for the C++ object pointer storage on java side May 06 08:54:01 so I guess my advice is how people generally do it May 06 08:54:04 javah executes from the cygwin terminal May 06 08:54:43 javah needs the compiled class file in java class syntax May 06 08:57:11 oh, man, thank you SO much alankila! May 06 08:57:20 no problem. May 06 08:57:25 like I said, I'm still not there yet, but at least I'm able to make progress. May 06 09:08:34 http://daltoncaldwell.com/2-brilliant-moves-created-apple-ios May 06 09:08:44 i always thought move #2 was rather brilliant ;) May 06 09:10:50 i bet someone here wants the entry-level Phantek Astroglide :D May 06 09:11:22 #android-offtopic May 06 09:11:45 "Why hasn't Dell or Samsung or HP implemented their own version of the “Moore's law market segmentation” strategy?" .. well, this is where things get more complicatated May 06 09:13:03 i think he misses in his conclusion of why android oems don't do # 2; i think its more technical May 06 09:13:24 my 3rd gen iPod still runs ios 5.x fine; my droid-1 won't run ics for shit i'm betting May 06 09:13:42 apple optimizes the fuck out of the whole stack May 06 09:14:57 alankila? May 06 09:15:35 * g00s hears alankila's nick echo across the great void May 06 09:15:44 I still have the same problem, though. May 06 09:16:33 my C++ code consists of a C++ class, LWIO, with functions within it. How do I allocate them in N_Init(), as you said? May 06 09:17:03 private native myCppClass.myCppFunction(); ? May 06 09:17:55 you can't call C++ from java directly May 06 09:18:03 no. May 06 09:18:26 you write something like private native void N_someFunc(); May 06 09:18:36 then you implement N_someFunc() which takes your c++ class and calls that method for you May 06 09:18:51 and it doesn't have to be void, it can return something if you like, even a java object May 06 09:18:59 where N_someFunc is a C++ function May 06 09:19:08 not a java method May 06 09:19:09 no, it is a method defined for you by javah May 06 09:19:27 you implement it by taking the object pointer you stored away in N_init and then calling a method on it May 06 09:19:29 oh okay I think i'm getting it now. maybe. May 06 09:20:07 this would be easier if oyu have ever done a C interface to a C++ library May 06 09:20:32 yeah, it would. :( May 06 09:20:38 because the problems are almost exactly the same: I got these C++ classes and thingys but C can't call them, now what? So you define methods just like I outlined above that take the C++ object from some pointer and then call these methods May 06 09:21:10 this is what you have to do if you want to expose a C++ class via a shared library for instance May 06 09:21:14 when i use the android issue tracker, is that gerrit ? May 06 09:21:46 why the hell can't i narrow bugs down by package May 06 09:21:49 g00s: nah, it's a patch review system May 06 09:21:54 hm, ok May 06 09:21:59 the android bug tracker is something else, don't know what May 06 09:22:43 alankila: do you understand Java's date , time , and calendar classes pretty well ? May 06 09:23:02 not familiar with a time class. Date and Calendar, I guess well enough May 06 09:24:33 Date represents a point of time and is fundamentally just 64-bit currentTimeMillis underneath afaik. Calendar represents something more vague, such as specific integer triplet for date, month and year. May 06 09:24:56 allright, well … i think i'm doing something fundamentally wrong. May 06 09:25:14 i have my phone set to Easter Standard Time, which is GMT-4 May 06 09:25:19 *Eastern May 06 09:25:32 Calendar is also tremendously poorly designed given how you have to use it, for instance it tracks which fields you have accessed via Calendar#set() and works out what moment of time it is from the fields you have set May 06 09:25:56 but when i run this piece of code, i get 6:00, not 5:00 May 06 09:25:57 http://pastebin.com/tBSMHBQM May 06 09:27:35 g00s: sounds like it might be some daylight savings related issue May 06 09:27:45 yeah - i'm pretty sure it is ... May 06 09:28:01 but, i thought SimpleDateFormat, using TimeZone, took care of that :( May 06 09:28:16 fucking TimzeZone, SimpleTimeZone, dateFormat, SimpleDateFormat May 06 09:28:49 print the getTime() result in UTC May 06 09:28:52 is that the right time you want? May 06 09:29:07 nah, i want the result in EDT :) May 06 09:29:09 maybe simpledateformat just formats it wrong somehow... or maybe calendar's result is not what you expect May 06 09:29:13 halve the problem May 06 09:29:16 figure out which one of them is wrong May 06 09:29:32 of, if i set the timezone is clearly very different May 06 09:29:43 so its in the right timezone, by using the default May 06 09:29:55 oh wells May 06 09:30:18 what does jan_1_2000.get(Calendar.HOURS) gets ... or whatever the 24-hour format was May 06 09:30:28 * alankila tries to remember, always have to look this one up May 06 09:30:42 well, calendar is always the local time May 06 09:30:47 date is always UTC May 06 09:30:57 Date, rather. May 06 09:31:32 alankila, I used to fantasize about being able to access Windows .dlls from dos (in order to drive 3d gfx cards)... this was beginning to seem about as impossible. May 06 09:32:22 java.util.GregorianCalendar[time=1336082400000,areFieldsSet=true,lenient=true,zone=org.apache.harmony.luni.internal.util.ZoneInfo["EST",mRawOffset=-18000000,mUseDst=true],firstDayOfWeek=1,minimalDaysInFirstWeek=4,ERA==1,YEAR==2012,MONTH==4,WEEK_OF_YEAR==18,WEEK_OF_MONTH==1,DAY_OF_MONTH==3,DAY_OF_YEAR==124,DAY_OF_WEEK==5,DAY_OF_WEEK_IN_MONTH==1,AM_PM==1,HOUR==6,HOUR_OF_DAY=18,MINUTE==0,SECOND==0,MILLISECOND==0,ZONE_OFFSET==-18000000,DST_OF May 06 09:32:23 ==3600000] May 06 09:32:32 g00s: it seems to me that your integer constant is 4506 days + 17 hours May 06 09:32:43 someday we will be free of the scourge known as "daylight savings time" :D May 06 09:32:56 ah yes, HOUR_OF_DAY. May 06 09:33:33 it's probably adjusted by the Calendar because it passes the daylight savings time and that interval is actually represented by 6 PM rather than 5 PM, assuming it works correctly May 06 09:34:24 this is where my head explodes May 06 09:35:00 if I remember correctly in DST you always move the clocks "towards" summer May 06 09:35:09 so at some night 3 PM becomes 4 PM instead and you have missed an hour May 06 09:35:22 alankila: Sweet mnemonic. May 06 09:35:25 so therefore that interval is not represented by hour 17 or 18 ... to account for this missing hour May 06 09:35:32 I am constantly screwing up time-zone stuff, that will help me. May 06 09:35:36 err ... represent not by hour 17 but by 18 May 06 09:36:00 g00s: did you get it? this is how it should be May 06 09:36:32 alankila: ok, i'm thinking. thanks for explaining May 06 09:36:53 I have a little issue with sleeping a thread every second and then writing some data to a file, without the sleep line it works fine, but with the time it just writes an empty file. Does anyone have any ideas? Heres the code: http://pastebin.com/BUbMCcQ0 May 06 09:37:26 It seems like such a simple issue, but I just can't figure it out... May 06 09:38:09 jonathank89: Can you show more of it? E.g. the part with the sleep? May 06 09:38:24 And the implementation of write2sdcard(). May 06 09:38:37 As it is, I don't see much more than what you described in English. =) May 06 09:38:42 g00s: if this bothers you, you can always perform the calculation in the UTC timezone, then make a new Calendar in right timezone and copy the ymd hms fields over it May 06 09:39:04 g00s: a kludge, but it will work without the DST issue coming up here May 06 09:39:23 alankila: yeah, thanks for that idea. the device which gives me the data does not compensate for dst :| May 06 09:39:32 and it doesn't give tz May 06 09:39:38 and it has a custom epoch May 06 09:39:42 ugh, dumbasses ! May 06 09:39:44 my god May 06 09:40:06 rking: I screwed up the pastebin paste, heres the actually code: http://pastebin.com/EHinkNhL May 06 09:40:41 rking: I also tried using Thread.sleep(1000) and it does the same thing. May 06 09:40:59 jonathank89: And 'record' is changed externally? May 06 09:41:22 rking: yeah, it's changed when a button is pressed. May 06 09:41:58 jonathank89: Do you reach all the lines you think you do? E.g, put Log lines in. May 06 09:42:53 rking: I followed the logs till it reached the write2sdcard method and the data string is correct. May 06 09:43:05 rking: correct being it has data in it. May 06 09:43:38 And you see maybe a couple prints from within the loop, then you press the button, then you see the one outside the loop by the write2sdcard() method? May 06 09:43:54 holy fuck. http://ga.water.usgs.gov/edu/2010/gallery/global-water-volume.html May 06 09:44:11 i thought the tomato plants would have contributed more water May 06 09:44:13 g00s: Nice. May 06 09:44:44 rking: it goes into the write2sdcard() method just fine, seems to populate those values just fine. May 06 09:45:19 rking: does it matter that i'm running the startRecord() method from a thread? May 06 09:45:45 jonathank89: I'm not too sure. May 06 09:45:58 jonathank89: No other thread is messing with the file, is it? May 06 09:46:28 rking: nope May 06 09:47:35 rking: the file that it writes to is created and filled with that data, so it should be the only thread doing anything with it. May 06 09:47:36 g00s: I have thought about the issue much further and recommend doing the calendar calculation in UTC, and printing in UTC also May 06 09:47:57 this way you have least amount of nonsense to the code. Fundamentally the device just acts like it was, you know, tracking UTC with funny epoch May 06 09:48:15 just set the epoch such that you get the hour correctly May 06 09:48:31 it might be 00:00 in some timezone, but it could be something else in UTC May 06 09:48:42 alankila: yeah, thats what i started doing. thanks for your help, i really appreciate it May 06 09:49:09 jonathank89: I'm not good enough with this stuff (yet) to tell you any real clues. May 06 09:49:48 jonathank89: Somehow or another, get a version that works. E.g., start a new project and only put write2sdcard() and startRecord() in it plus something to call startRecord() and to trigger 'record' to become false. May 06 09:50:03 Then if that works, you have to figure out what is different between the two program.s May 06 09:50:16 If it doesn't work, then you've made a simpler case that people can look at and help you understand. May 06 09:50:54 rking: Yeah I'm sure i'll figure it out, thanks for your help. It's just weird that it works fine without the sleep line... May 06 09:51:19 jonathank89: It is definitely weird. When you do figure it out, if you want to ping me with the explanation, I'd like to know. May 06 09:51:35 rking: sure np May 06 09:57:08 oh gawd... plz tell me the Greens aren't going there. May 06 09:57:31 There is one and one-half quintillion tons of water on the Earth... and that's just the oceans. May 06 09:57:56 correction: one and one-quarter quintillion tons. May 06 09:58:52 "But it is the freshwater resources, such as the water in streams, rivers, lakes, and groundwater that provide people (and all life) with most of the water they need everyday to live." May 06 09:59:24 yeah, those sharks and jellyfish and deep-sea creatures that can't get to freshwater resources... the poor things just have to do w/o water I guess. May 06 09:59:31 either that or they're not "life". May 06 10:12:15 HEY LADIES May 06 10:12:29 WHO WANTS TO MAKE OUT May 06 10:12:52 *universe palm* May 06 10:13:09 ONE AT A TIME May 06 10:13:56 newest git binaries for mac are out; this changed something with merge commits May 06 10:13:58 ok, so my master plan is to take this knockoff of draw something and make some other drawing related games May 06 10:14:34 like, out of the gate, I want this thing to crush draw something May 06 10:14:39 in the most humiliating way possible May 06 10:14:51 the thing is though, that I am just not all that creative May 06 10:15:20 my first idea was to target niche markets May 06 10:15:30 like autistic kids or heroin addicts May 06 10:15:54 but as it turns out, these people don't spend much money on apps May 06 10:16:15 hey May 06 10:16:20 so like, maybe something that focuses on yachts May 06 10:16:23 and things you find on a yacht May 06 10:16:23 i'm a heroin addict May 06 10:16:34 we're all addicts May 06 10:16:35 i just injected half an hour ago. it feels good May 06 10:17:04 you should take subutex May 06 10:17:15 its all the fun without any of that good feeling May 06 10:17:46 but back to me getting rich May 06 10:21:17 TOO LATE, WE SAW YOUR HOST May 06 10:21:33 * rking runs nmap May 06 10:22:13 everyone, forget these other hosts May 06 10:22:19 focus all your hacking on the guy who changed his May 06 10:22:26 Yes. May 06 10:23:02 Won't ping. =\ May 06 10:23:40 no forwarded ports May 06 10:23:41 Oh, are they revresed? May 06 10:23:49 he is either extremely secure, or he is 12 May 06 10:40:17 amazon 1-click ... May 06 10:40:20 is pulling me ... May 06 10:40:23 to buy ... May 06 10:40:27 gaaaah May 06 10:46:22 #JustClickNext May 06 10:50:33 A Method has nothing to do with references right? May 06 10:50:48 wait May 06 10:50:49 nvm May 06 10:51:44 4am coding May 06 10:51:52 not thinking straight May 06 10:52:51 the git uninstaller on mac always fucks up the 'forgetting' of the boms May 06 10:53:01 (of the previous installation) May 06 10:53:19 have to do that manually, but it probably doesn't matter May 06 11:09:08 Hey guys, having a little problem with notifications... I have a service to recieve push notifications and vibrate when it recieves them as well put it in the status bar... just dunno how to get it to stop. I have it set to launch an intent and in that intent I have it set to cancel the vibrate but it doesn't. Any ideas? May 06 12:21:44 hihihihihihihihihi May 06 12:21:48 i neeed help May 06 12:22:00 i've downloaded Blur_Version.2.1.5.MB200.T-Mobile.en.US May 06 12:22:27 but i want to make be able to update it through Flash zip from SD May 06 12:22:30 how!!! May 06 12:25:08 #android-root May 06 12:31:21 Anyone remember where the utility method for converting a dimension string into a pixel value is? E.g. "20dp" -> int May 06 12:34:41 @Jakey_Cloud everyone is asleep May 06 12:35:02 http://www.infoworld.com/d/mobile-technology/the-end-of-android-we-know-it-192070 May 06 12:38:12 skfax: Google does: http://developer.android.com/guide/practices/screens_support.html#dips-pels May 06 12:39:11 Storm2010: when will they wake up!!!!!!!!!! May 06 12:39:35 Jakey_Cloud: idk May 06 12:39:57 they fall asleep every time they see more than one exclamation mark in a row :P May 06 12:40:10 ok! May 06 12:40:15 Zider: May 06 12:42:01 SimonVT: u think thats true? May 06 12:42:13 What? May 06 12:43:51 no i don't think it will ever be true May 06 12:43:55 and fuck ifags May 06 12:44:07 so I wrote a stupid class on top of bytearray which allows a client to read data from the bytearray via the read() methods while it's still being downloaded. May 06 12:44:12 galaxy S3 was a little dissappointed May 06 12:44:24 oh im sorry Simon i meant ocx May 06 12:44:24 the read() simply sleeps if the data requested hasn't yet arrived May 06 12:44:51 Jakey_Cloud: you're in the wrong channel here, mate... May 06 12:45:20 I was wondering if the java standard api already has something like this May 06 12:45:35 SimonVT: Cheers. But I was sure that there was a convenience method somewhere that could convert any string "10mm", "10dp", "10pt" etc into a pixel value.. doesn't seem to be part of android.util at least May 06 12:45:46 the implementation certainly wasn't long and I have other requirements, such as the ability to seek back to beginning of file and read it again. So I wrote in top of ByteArrayInputStream May 06 12:45:52 bye May 06 12:45:56 skfax: If they're defined as dimensions in xml you can May 06 12:46:03 alankila: isn't that what a buffered reader is, in general? May 06 12:46:22 well, Reader itself implies byte to char conversion in java May 06 12:46:37 at least that's part of the api common to these reader-named things May 06 12:46:47 SimonVT: Yeah, but I mean doing it programatically from a string value + DisplayMetrics. Which should be possible May 06 12:47:32 Hi all May 06 12:48:36 any idea wat error (-4, -4) is? May 06 12:48:50 skfax: Yeah, I doubt it. Nothing I have heard of at least May 06 12:49:27 I mean, I doubt there's an utility class for it May 06 12:52:16 hi guys! Is the WebView on ICS f*cked up? May 06 12:52:16 http://code.google.com/p/android/issues/detail?id=21177 May 06 12:52:47 Anyone knows a solution ? May 06 12:53:28 SimonVT: http://developer.android.com/reference/android/util/TypedValue.html#coerceToString() TypedValue can handle the conversions + convert to a string format.. But does not parse strings to a dimension value. Maybe they don't want people doing it / didn't see the need May 06 12:58:35 skfax: But typedvalue reads the value after it has been compiled. They most likely do some tricks during compilation, so it isn't just string parsing May 06 12:59:12 After it's parsed it has a value and a type, so it's simply return the value as well as a # or whatever type it is May 06 12:59:45 SimonVT: Example here on converting a dip value to px: http://stackoverflow.com/a/2406790 May 06 13:00:25 Which is the same as you linked the first time; multiplying by displayMetrics.density to do the conversion May 06 13:01:29 Just adding some string parsing to that is what I want, so you could give the method "10dp" and get the resulting pixel value May 06 13:02:23 ocx: Just read "Proof Android is not open source" from the same author. Not really insightful at all, and really not true. May 06 13:03:02 Yeah, you'll probably have to do the string parsing yourself May 06 13:03:12 Parse it to a value and a type, then use that May 06 13:03:17 Yep May 06 13:13:55 Hey guys! How would I do getWindow().setFlags() outside the onCreate() function? For example, by a webserver May 06 13:14:15 a webserver? May 06 13:14:35 My device runs a webserver, so I can disable/enable the screen remotely May 06 13:15:53 Because now, I get "CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views." May 06 13:18:21 WeeJeWel: A Handler might be what you are looking for. When you create it on the GUI thread you can later post messages to it from another thread such that it executes code on the GUI thread. http://developer.android.com/reference/android/os/Handler.html May 06 13:19:19 Hello May 06 13:20:11 How come this isn't working: c.drawText(Character.toString(letter), (float) x, (float) y, paint); <- paint is a Paint with textsize 32 and color black May 06 13:20:27 System.out.println((Character.toString(letter)); works May 06 13:22:15 mad1231999: What are the values of x and y? May 06 13:22:40 skfax: It is a bunch of objects, so they are different from object to object May 06 13:25:43 mad1231999: Try clearing the canvas with c.drawColor(Color.WHITE), then draw a single character with x=50, y=50, with a textSize of 10. That should give you some more information May 06 13:27:21 The text works May 06 13:27:39 The first time, or after modifying it? May 06 13:28:10 After May 06 13:28:12 skfax May 06 13:29:10 Ohhh. . . May 06 13:29:19 It draws the text behind the Objects May 06 13:29:24 That's easy to fix May 06 13:37:20 Is there any way I can get the width of a character(the width when drawn)? May 06 13:38:47 mad1231999: http://developer.android.com/reference/android/graphics/Paint.html#measureText(java.lang.String) May 06 13:42:39 would someone know how to properly use http://developer.android.com/guide/topics/resources/string-resource.html#Plurals .. looks like "few" is ignored and "other" is used instead. which is wrong. May 06 13:44:02 do i need to "enable" something? May 06 13:44:24 Seems it depends on locale how few is treated May 06 13:45:18 SimonVT: so is my locale defined wrong? or i'm using it wrong? it's "sl" SLOVENE/SLOVENIAN ? May 06 13:45:46 it is May 06 13:46:04 language sl is Slovenian, country si is Slovenia May 06 13:46:29 so maybe you need sl_SI instead? May 06 13:46:32 sam: yes, it's sl_SI (as english is en_UK) May 06 13:46:38 hmm May 06 13:46:43 i use values-sl May 06 13:46:47 oh May 06 13:47:18 Dunno, did you check if sl is indeed Slovenian? May 06 13:47:30 SimonVT: yes, android text and app text is slovenian :) May 06 13:47:37 but it seems to use english plurals? May 06 13:47:52 when I want to check what a language code is, I go to xx.wikipedia.org :) May 06 13:48:02 sam: yeah :) May 06 13:48:26 values-sl plural just uses "one" and "other" ?! May 06 13:48:31 but I know Slovenian, that's the land of my ancestors May 06 13:48:41 sam: oh, glad to hear that :) May 06 13:49:13 my grandfather was from Tržič May 06 13:50:04 sam: cool, have you been there? :) May 06 13:50:49 yeah, I've traveled the north of Slovenia a few times, staying in Selo (near Bled) most of the time May 06 13:51:15 Well, if some numbers requires special treatment, and Android doesn't support that, file a bug May 06 13:51:46 SimonVT: there's no point in reporting any bug if it's only fixed "upstream" May 06 13:52:04 Yeah, no point in fixing any bug ever May 06 13:52:18 SimonVT: android never gets "updated". May 06 13:55:23 Sorry, but that's a shitty attitude May 06 14:00:13 However, I've found that only "one" and "other" actually work (despite the others being used in the android source!). http://stackoverflow.com/questions/3715014/android-pluralization-not-working-need-help May 06 14:00:29 miha, relying on those locales is pretty tricky anyway - there's boatload of people with misconfigured locales all around Slovenia May 06 14:01:20 Mavrik: no, not really. most want Slovenian text in android. if they want English, i handle that as well. May 06 14:01:54 problem is for "hour".. it is 1 ura, 2 uri, 3 ure, 4 ure, 5 ur, 10 ur.. 12 ur... 24 ur May 06 14:02:18 miha, yeah, that's true - however there's alot of people with phones set to Slovak, Czech and other locals May 06 14:02:30 which will cause you problems and complaints May 06 14:02:40 16:01 < CrazyLemon> http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/2.3.3_r1/packages/apps/Calendar/res/values-sl/strings.xml May 06 14:02:45 I just rolled my own helper method for that however May 06 14:02:47 here only "one" and "other" is used as well May 06 14:05:24 look i wish to have Spinner with: 1 ura, 2 uri, 3 ure, 4 ure, 5 ur, 10 ur.. 12 ur... 24 ur .. it'd look weird with ure: 1, ure: 2, ure: 3 May 06 14:05:29 :( May 06 14:05:58 i can hack it myself for Slovenian... until i need to use some other localization May 06 14:08:23 so i guess i'll just pass all values as seperate string's and choose right myself? May 06 14:10:18 Nice to see a good XDA post on SG3 vs One X. There was way too much internet rage over SG3 on announcement. ( http://forum.xda-developers.com/showpost.php?p=25693754&postcount=108 ) May 06 14:11:52 Yop. May 06 14:18:59 * Hiraghm dislikes AMOLED May 06 15:28:39 i want to run a service in the background - can anyone point me to a good tutorial step by step May 06 15:30:05 there is a fine one in the dev guides section of d.android.com May 06 15:30:25 also, I'll clear this up for you now: a service doesn't "run", it just sits there May 06 15:30:44 amoxibos: perhaps http://developer.android.com/reference/android/app/Service.html#RemoteMessengerServiceSample May 06 15:30:47 it runs onCreate when created, onStart when started, and any background work that "runs" is going to hav to be your own thread. May 06 15:31:01 s/onStart/onStartCommand/ May 06 15:32:59 Argh, ActionBarCompat looks kinda stupid on below-android4-devices. May 06 15:33:09 Is this normal? I think it isnt May 06 15:34:00 this is what it looks like: http://dl.dropbox.com/u/6559846/__a.PNG May 06 15:34:13 ugly May 06 15:34:17 exactly :) May 06 15:34:21 sherlock looks good :) May 06 15:34:33 also on android 1.6? May 06 15:34:37 ugly is actually an understatement for that pic May 06 15:34:53 complain at google, not at me^^ May 06 15:34:56 i haven't tried it that low, but I don't see why it would look any different than it does on 2.x if it is compability May 06 15:35:03 compatible* May 06 15:37:57 seems compat thingy is just for API 11 May 06 15:38:03 and above May 06 15:38:24 If you design something like a compatibilitylayer, then please a complete next time! thanks *g* May 06 15:39:11 I'm doing my first attempt at multicore programming. If I do a for() loop and inside the only thing is a new Thread(New Runnable()); Will that iterate through the loop on multiple cores? May 06 15:40:00 NatureTM: as noob, i'd think each thread uses at most 1 core. so for should be on same core. May 06 15:40:08 threads might use different cores May 06 15:40:54 hey readme i figured it out! May 06 15:41:21 NatureTM: No, this is also not an android question May 06 15:42:08 ok, good point, thanks May 06 15:42:19 there's nothing parallel inside single thread. May 06 15:42:22 so 1 core. May 06 15:47:07 *crickets* May 06 15:52:44 I derive my activity from SherlockActivity but no actionbar appears May 06 15:56:59 can i use a menu resource in ActionBarSherlock? May 06 16:03:05 I'm trying to make an app that uses the camera to auto take photos every x seconds. Right now I've got it working by the click of the button. When I try to implement an auto-takephoto while a certain toggle is checked, it just doesn't seem to work as in to completely retrieve the photo. It just takes x photos and only the last one is saved. Here's what I call when toggle is on code: http://pastebin.com/mU1SM1B3 May 06 16:14:28 I'm trying to make an app that uses the camera to auto take photos every x seconds. Right now I've got it working by the click of the button. When I try to implement an auto-takephoto while a certain toggle is checked, it just doesn't seem to work as in to completely retrieve the photo. It just takes x photos and only the last one is saved. Here's what I call when toggle is on code: http://pastebin.com/mU1SM1B3 May 06 16:16:15 xemi: if only the last one is saved, perhaps its overwriting the file? May 06 16:21:24 This is seriously annoying me, I cant get abs to not throw me a 100 errors May 06 16:22:46 brx_ thanks bro, that was the problem and it never occured to me. :-) May 06 16:22:58 hihi May 06 16:24:43 PrivateAlpha: start by right clicking on abs project and yours and under java compiler setting compliance level to 1.6 May 06 16:25:43 Is it possible to use classes from the android.jar outside of the emulator - I have written some classes that use JSONParser and I would like to be able to test them with junit May 06 16:26:08 NatureTM: whether your thread will be run on multiple cores is an implementation detail of the JVM (dalvik in this case) and I have no idea. May 06 16:26:19 if you really want to know you should dig into the dalvik source May 06 16:26:25 readme: did that, still a bunch of errors :/ May 06 16:26:33 PrivateAlpha: which ones do you have now May 06 16:27:20 xemi: you probably have to get rid of Thread.sleep. You probably need to let android to process the UI thread in the meantime May 06 16:27:22 readme: what do you refer to as "ones" May 06 16:28:14 The "errors" May 06 16:28:20 xemi: so structure your program as sequence of callbacks and use some handler 'run a Runnable after N millisecons' method to schedule the work May 06 16:29:55 readme: http://pastebin.com/2hbKfASw them May 06 16:30:19 Hi! I have an application with tabs and this is where I create them. When I change the screen orientation from vertical to horizontal (widescreen), tabs disappear and change to a drop-down menu. Is there any way I can prevent this behaviour and keep the tabs like the YouTube app? http://pastebin.ca/2144877 May 06 16:30:34 PrivateAlpha: those look like the kinds of errors that occur when the compiler compliance level is set to < 1.6 May 06 16:30:54 "Must override a supertype method" -- it's because in 1.5 @Override doesn't work when implementing an interface. Y May 06 16:30:58 but does in 1.6 May 06 16:31:13 >.> it says its set to 1.6 :/ May 06 16:31:19 try setting both, building clean May 06 16:31:27 you can also clear the errors in the problems view May 06 16:31:56 check your targetSdkVersion May 06 16:32:00 it should be 15 in both projects May 06 16:32:12 set minSdkVersion to your lowest supported API (probably 7 or 8) May 06 16:33:20 readme: Thanks, I think it was just eclipse being stupid May 06 16:34:36 I have my own rituals I go through when eclipse misbehaves May 06 16:34:58 worst one is restarting eclipse. I hate that May 06 16:35:26 You make eclipse sound like naughty mistress >.> May 06 16:37:47 readme, are you busy? May 06 16:37:56 assume i am always busy May 06 16:38:04 i will answer a question if you ask one and I know the answer May 06 16:38:46 Well I've been thinking about what you said and how I should combine all my activities into one and just change the "page" by setContentView, and I was just wondering would that really be a more efficient way. May 06 16:38:57 yeah, of course it would May 06 16:38:59 I mean, I'd have a onclick and a onLongClick switch and case of over 100 cases. May 06 16:39:01 but I think you should use fragments May 06 16:39:08 that's not a big deal May 06 16:39:10 Fragments is for 3.0+ I thought May 06 16:39:20 you can use the support library May 06 16:39:35 Are Fragments are to use? What makes them so good? May 06 16:39:37 comparing an integer 100 times is very cheap. May 06 16:40:21 there is plenty of philosophy info here http://developer.android.com/guide/topics/fundamentals/fragments.html May 06 16:40:30 What if I choose to add more sounds, and eventually have 200 buttons, or 300? May 06 16:40:37 even comparing an integer 10000 times is cheap May 06 16:40:39 Would that still be easy for the android device to handle. May 06 16:40:46 Gotcha, just wasn't sure. May 06 16:40:57 T-Dub|DlolPics: you can use Map May 06 16:41:15 you can even have a map for each page if you want May 06 16:41:31 a "page" should definitely be a Fragment May 06 16:41:37 if you can put the effort in. May 06 16:41:43 Well I don't know what I want to use. This is my first application and I don't know much. May 06 16:41:49 I knew how to start a new activity so I went with that. May 06 16:41:58 if you want to become good at android dev use a fragment May 06 16:42:06 if you don't , oh well. good luck :) May 06 16:42:33 Oh wow. Looks like fragments are specifically for multiple pages haha May 06 16:42:39 Hey, all.. I have a need to create an app that has 6 audio tracks in it.. then in the future create additional apps (or add-ons) that have 6 audio tracks in them each that the original app can access... is there a way to do this? (note this app will be in the samsung store NOT the play store so play api is not an option) May 06 16:42:39 do you have your project in some sort of version control May 06 16:42:41 like git May 06 16:42:48 No, just eclipse. May 06 16:42:49 that way if you mess it up when you try to implement fragments, you can at least revert May 06 16:42:53 at least copy your project May 06 16:42:58 I was thinking content providers but is there a way that the original app can have access to content providers of apps that don't exist yet? May 06 16:43:00 before you attempt to integrate fragments May 06 16:43:03 Alright, I'll make a backup. May 06 16:44:27 thanks in advance for any advise.. I'm just trying to figure out where to start and if it's even possible.. if not each app will just have to be free-standing and the client will need to understand May 06 16:52:56 this may be stupid but the OS setup we have i think is wrong and needs to be be changed, can you run more than one adb instance? the problem we have is we have a mac which allows consecutive logins, it's not virtualised so the network interface is shared. This to me is problematic and ive seen weird behaviour with ADT May 06 16:53:47 even the fact we're sharing an adb instance which allows a user to see another's emulator seems dodgy May 06 17:47:42 Does anyone know how the layout preview in ADT works? Does it use XSLT? May 06 17:48:48 readme: it doesn't use XSLT May 06 17:48:58 readme: it runs the Android framework to display the layout May 06 17:49:14 ah ok.. I want a powertool. Im thinking of taking a crack at making a basic previewer in xslt May 06 17:49:30 that sounds like a bad idea :) May 06 17:49:42 there's a layoutlib.jar you can use to render previews May 06 17:49:48 oh nice May 06 17:49:56 I'll try that, thanks May 06 17:50:00 Hi guys May 06 17:50:42 I just got an app I wrote half a year ago finally uploaded to GooglePlay, wanted to share it with you all. https://play.google.com/store/apps/details?id=Erowid.MantasCode May 06 17:51:55 can I use any language with an arm or C backend to develop apps for android? May 06 17:52:07 Mantas322: thats a bit controversial, wouldnt be suprised if it gets taken down lol May 06 17:52:16 really? May 06 17:52:27 Boscop: to develop an "app" you've got to at least write code that runs on dalvik in some way. May 06 17:52:39 you can call into C with the NDK through JNI. May 06 17:52:44 its just a site that documents the complex relationships between psychoactives and humans May 06 17:53:19 it teaches you how to get high and which ones mash you up the most May 06 17:53:29 readme, I've read somewhere that with the new NDK no java code has to be written anymore May 06 17:53:37 Should I throw an exception or return null in my ContentProvider when given corrupt parameters for a query? May 06 17:53:45 Boscop: oh, maybe my knowledge is outdated May 06 17:54:25 http://openhandsetmagazine.com/2007/11/running-c-native-applications-on-android-the-final-point/ May 06 17:55:14 new NDK? May 06 17:55:16 http://metachris.org/2011/01/android-ndk-updates-no-more-java-required/ May 06 17:55:48 Boscop: I would be curious of how easy it is to do things like send intents and stuff from pure C++ May 06 17:55:54 without ever calling into java May 06 17:56:26 =O activity in pure c May 06 17:56:41 disturbing May 06 17:56:57 not bad May 06 17:57:15 I'm using AsyncTask to start a thread which takes pictures every second, indefinately. In the doInBackground, where pictures are taken, I've added publishProgress(i); (i - represents the number of the picture taken). How can I now get this value in my main UI Activity and use it somehow to show what picture number I'm at, in a live fashion? May 06 17:58:04 Do I have to implement onProgressUpdate on my main UI activity or how does it work? May 06 17:58:34 o.m.f.g. May 06 17:58:42 that's scary May 06 17:58:45 xemi: AsyncTask.onPostExecute() is run on the UI thread when the task is complete. Update your GUI from there May 06 17:59:05 and very very tempting May 06 17:59:26 Boscop: NativeActivity is a java class :) May 06 17:59:33 so my point stands May 06 17:59:58 I want to avoid java as much as possible May 06 18:00:15 :O May 06 18:00:19 For good reasons or petty ones? May 06 18:00:28 for very good reasons May 06 18:01:52 i would much rather write a game in C than java May 06 18:01:59 skfax: but I cannot use findViewById() inside the AsyncTask to actually access, and modify UI elements, since it doesn't extend Activity May 06 18:02:17 readme, same here, but I'd rather compile to C than write in it directly May 06 18:02:29 what are you compiling down to C? May 06 18:03:07 :O May 06 18:03:12 No cow?! May 06 18:03:32 xemi: make async an inner class of activity or pass the view to the constructor of asyntask(i think) May 06 18:03:40 * Hiraghm just wants to access his mesh loading C++ code from java, that's all May 06 18:03:56 readme, my systems language. I decided compiling to C will be more flexible and portable than using LLVM May 06 18:06:19 I read that for long running tasks that shouldn't be interrupted I should delegate them to a service. Now is it possible to talk to a service with a decent java interface? (ie: not just the intent's extras). May 06 18:07:14 ronyu: You can use Binding: http://developer.android.com/guide/topics/fundamentals/bound-services.html May 06 18:08:03 Which is faster? RMI or serialization over wifi? May 06 18:08:35 It's basically for mouse commands. May 06 18:09:37 skfax: that's the only way to talk to a service beside intent ? I'll read on that. May 06 18:12:26 Is there a #channel for abs? May 06 18:12:51 this is basically it. May 06 18:15:47 dlaroche: specialized protocol May 06 18:15:52 RMI will be horrible May 06 18:15:59 Anyone knows if android does or plans to limit apps like cateapp, that are hidden unless you dial a certain code? May 06 18:16:04 (and unsupported by Android, iirc) May 06 18:16:08 s/android/play store May 06 18:16:19 s/limit/forbid May 06 18:16:26 Heh ok well to start using abs in a project I can just change Activity to SherlockActivity? May 06 18:16:33 dlaroche: Java serialization is also pretty slow, iirc May 06 18:16:39 brx_: I'm trying the inner class solution. If aTakePictures is inner class of takePicture, what does new takePictures().execute(mCamera) translate to I'm getting confused ;-) May 06 18:16:44 Because when I do that my app breaks May 06 18:17:01 PrivateAlpha: http://actionbarsherlock.com/usage.html May 06 18:17:35 xemi: Can you pastebin some of the code? May 06 18:19:55 skfax: http://pastebin.com/2acNVXxe, I've added notes at the bottom. May 06 18:23:13 xemi: Well at the bottom it would be "new aTakePictures().execute()" May 06 18:23:36 xemi: But you should add locking at some point. And you should really use the Android naming convention. May 06 18:24:03 How do you set the background image (or the android:src="drawable") of an ImageView in java? May 06 18:24:24 I've tried everything that makes sense to me, but most of the methods give me an error May 06 18:24:36 T-Dub|DlolPics, where is your image located? May 06 18:24:39 is it a png ? May 06 18:24:45 In the drawables, it's a png May 06 18:24:45 android:src != background image May 06 18:24:47 Yeah May 06 18:24:55 T-Dub|DlolPics: setImageResource(R.drawable.my_image) May 06 18:24:58 Oh May 06 18:25:04 I was looking at background stuff :s. May 06 18:25:05 Thanks. May 06 18:25:05 What about http://developer.android.com/reference/android/widget/ImageView.html#setImageResource%28int%29 May 06 18:25:13 ah to slow :D May 06 18:25:18 setBackgroundResource for a background May 06 18:25:20 skfax: using "new aTakePictures().execute()" it doesn't recognize aTakePictures() since it's an inner class of takePictures() May 06 18:25:29 xemi: Make it static May 06 18:25:31 Or use a textview and do setBackgroundResource ,) May 06 18:25:35 And NEVER new an activity May 06 18:26:21 It's an AsyncTask, and it's easier if it's non-static since then you can access the parent Activity elements directly May 06 18:27:08 Except if a configuration change happens, then it's useless May 06 18:27:35 Anyone knows if android/play store does or plans to forbid apps like cateapp, that are hidden unless you dial a certain code? May 06 18:29:06 huh May 06 18:29:22 that is very sketchy May 06 18:31:05 and useful May 06 18:31:48 xemi: So the toggleButton is not part of the "takePictures" activity? May 06 18:31:57 looks like they are making good money :) May 06 18:37:08 skfax, no, it's part of the main ui activity. All I'm trying to do is be able to use findViewById inside the AsyncTask class. But findViewById cannot be used if my AsyncTask doesn't extend Activity. So I've tried putting the AsyncTask class as an inner class of one that extends Activity. But now from my main UI Activity I can't figure out how to call takePictures.aTakePictures().execute(); May 06 18:37:52 aTakePictures being the inner class of takePicture, the first one extends Async the other one extends Activity. May 06 18:38:04 Any android app developers (that made apps for play store) in here? May 06 18:38:12 not me May 06 18:38:14 no time yet May 06 18:38:38 sunbeam: I am since last month May 06 18:38:40 sunbeam: only ios devs in here May 06 18:39:18 sunbeam: this place has a lot of talented people in it May 06 18:39:19 xemi: The design sounds a bit odd. Why do you have the two activities like that? May 06 18:39:48 xemi: I think you need to learn about "scope" .. Just by extending Activity, you do not get access to the view of a completely difference Activity May 06 18:40:06 If your AsyncTask has to call findViewById on your main activity, it needs a reference to it May 06 18:40:20 i told him that already! :> May 06 18:40:28 skfax: I'd value any suggestion on how to be able to make live changes on my main UI, inside an AsyncTask worker May 06 18:41:12 xemi: What does your main activity look like, what is its purpose? Same thing for your takepicture activity; what does it look like? May 06 18:41:57 xemi: publishProgress() May 06 18:42:23 xemi pass your view to the async constructor, then in pre exec/postexec/onProgupdt handle the view May 06 18:42:26 override onProgressUpdate May 06 18:42:33 I have a bunch of sounds named sound_1,sound_2,sound_3 etc. I'm trying to load my sounds into an array using a for loop rather than typing out the same thing 100 times. Anyone know how to make a reference by using a for loop? This is the LOGIC I'm referring to: http://pastebin.com/M4MDA8DZ Obviously that doesn't work, can anyone think of a way I could do this? May 06 18:42:36 it runs on the UI thread and it is for making intermittent changes to the UI. May 06 18:43:22 T-Dub|DlolPics: it can be done with reflection May 06 18:43:29 T-Dub|DlolPics: http://developer.android.com/reference/android/content/res/Resources.html#getIdentifier(java.lang.String,%20java.lang.String,%20java.lang.String) May 06 18:43:38 you can reflect the resources, iterate all the sound_* prefixed things, then cache them all in a hashmap May 06 18:43:39 brx_: lol May 06 18:44:03 sunbeam: sry couldnt help myself May 06 18:44:33 i don't like ios so much personally May 06 18:44:36 SimonVT's answer sounds easier though :) May 06 18:46:13 In some blogs people were saying reflection is slow, so would it more efficient if I just toughed it out and manually typed it all out? May 06 18:46:27 joel135: can i pm? May 06 18:46:34 T-Dub|DlolPics: think critically May 06 18:46:40 T-Dub|DlolPics: some blogs said xyz is not a good reason May 06 18:46:40 readme thnx for the help yesterday May 06 18:46:43 np May 06 18:46:49 T-Dub|DlolPics: Shouldn't matter much if you just do it once, when constructing your activity etc May 06 18:46:57 sunbeam: ok, if it's off-topic May 06 18:46:58 That's why I asked rather than assuming the blog was correct. May 06 18:46:58 do it in a static initializer, even May 06 18:47:05 so it only happens when the class loads May 06 18:47:16 i finally solved it btw and took your advice about starting over May 06 18:47:35 I was thinking about just loading 10 at a time, depending on what "page" the user was on. May 06 18:47:36 T-Dub|DlolPics: well, I guess asking us is currently a good substitute for critical thinking, but I hope you will start experimenting to test assumptions like that May 06 18:47:45 readme: Don't you need a context / resource reference? May 06 18:47:51 an experiment is always more reliable than a on off opinion May 06 18:47:59 skfax: nah, the R resource ids are all known at compile time May 06 18:48:10 you'll need the context to actually get the resource May 06 18:48:12 but not to get the id May 06 18:48:14 T-Dub|DlolPics: It will likely take the order of milliseconds. Development time matters much more May 06 18:48:27 Well I don't really know how to test that. I mean obviously I could empliment both, but wouldn't the speed difference just be milliseconds if that? May 06 18:48:37 you can test it with traceview May 06 18:48:44 yeah i meant to do the reflection thingie, since the getIdentifier depends upon Resources May 06 18:48:47 you can measure how much CPU time different operations take May 06 18:49:19 Woah that's cool. Didn't know of that readme. May 06 18:49:53 T-Dub|DlolPics: The reflection method is also much better suited for future changes, so you don't need to update any hardcoding when you add/remove files etc May 06 18:50:27 great point May 06 18:50:33 you don't want stale strings in your code May 06 18:50:40 that aren't detected as erroneous by the compiler May 06 18:50:44 reflection gets you that error check May 06 18:51:15 test May 06 18:51:17 really? May 06 18:51:20 no May 06 18:51:23 that's all it took? May 06 18:51:27 I thought I was banned here? May 06 18:51:38 not all bans are perma May 06 18:51:49 readme, I wasn't banned >.> May 06 18:51:52 haha May 06 18:52:13 ops Dany0 ban evasion :P May 06 18:52:14 I had internet issues so I got reconnected, so XChat chose my alternative nick (sapoznik) and I couldn't send to this channel May 06 18:52:46 happens to me all the time May 06 18:53:05 still, xchat ftw May 06 18:53:32 No, Pidgin FTW May 06 18:53:48 pidgin with irc? never tried that May 06 18:54:07 Opera + built-in IRC support ftw May 06 18:54:31 skfax: pidgin is still better ;) May 06 18:54:39 hehe May 06 18:54:47 it's all preference and need of featureset ^.^ May 06 18:54:58 cant imagine how pidgin looks with irc May 06 18:56:42 Its still a bird full of awesomeness May 06 19:00:06 * t0mless dislikes the pidgin IRC May 06 19:00:13 but I like pidgin for IM services May 06 19:00:35 also, Dany0 that message about being banned is worded wrong May 06 19:00:51 you're "banned" because #android-dev doesn't allow non-registered users to talk May 06 19:00:59 but it won't let you change your nick May 06 19:01:26 irssi > * May 06 19:01:27 you should register your alternate nickname May 06 19:01:43 you can even tie it to your primary nick May 06 19:01:56 other option is to just part/change-nick/join May 06 19:02:10 or you can: /msg nickserv ghost NICKNAME PASSWORD May 06 19:02:29 That will force the previous session to quit May 06 19:03:08 right, but by the time he's connected with his secondary, realizes he's been DC'd and parts, that nick will probably be kicked offline May 06 19:03:12 or dont use an alternate nick, thats what i did May 06 19:03:16 but yea, ghost is helpful May 06 19:03:28 or you can get a client that will do ALL of that stuff for you May 06 19:03:37 when I connect I automatically ghost, set nickname, identify May 06 19:03:51 yea, mine does that too May 06 19:05:02 can u use masks on this network, never looked into that May 06 19:05:09 yea May 06 19:05:16 you can ask for one May 06 19:05:32 you can decide what it is though May 06 19:05:35 command or via email or smt? May 06 19:05:36 can't* May 06 19:05:47 brx_ passing the textview to the async and then modifying values to the textview inside onProgressUpdate produces a force close :-( May 06 19:05:59 I think I'm giving up for the night ^^ May 06 19:06:01 is it null xemi? May 06 19:06:24 whats the error xemi? May 06 19:06:40 http://freenode.net/faq.shtml#cloaks brx_ May 06 19:06:48 thanks t0mless May 06 19:07:31 xemi logat ftw May 06 19:07:45 brx_: this is the error http://pastebin.com/AHQ0CBgc May 06 19:08:00 uncaught exception? uhm May 06 19:08:03 ok NPE May 06 19:08:07 null May 06 19:08:21 ah, yes May 06 19:09:13 so instantiate the view first to get a constructed object(if thats the correct terminology) May 06 19:09:22 brx_: I passed the TextView to the async constructor and manipulated that textview in onPrUPD May 06 19:10:50 in the parent activity try to instantiate the tv May 06 19:11:25 get a handle on the tv, then pass that initialized textview, i think that will work for you May 06 19:11:38 test it by making the tv invisible in onPreExecute May 06 19:13:52 xemi: nothing do do with being inside onProgressUpdate.. it's just null. May 06 19:14:11 pay attention to the order you are doing things in May 06 19:14:29 you are likely calling the async task before you get a reference to the textview May 06 19:15:48 he will have TextView tv in activity 1...and he is passing that i reckon May 06 19:15:51 this is how I instanciate the tv in the parent class, before using it by passing it to the async class constructor: final TextView tv = (TextView) findViewById(id.textView2); May 06 19:16:29 I mean in the main activity class which calls then the async class. May 06 19:16:34 hi all, I would like to display a list of images (very small) with some text metadata. These images are downloaded from the web. Can anyone suggest a good way of doing this? I am thinking of using a content provider, but not sure how I should handle the images. My current thoughts is to write a custom content provider storing the metadata along with the photo uri. And the use Android mediastore to se May 06 19:16:35 parate store a (uri,photos). I want to some how then bind the data from the content provider with a listview. Am I thinking a long the right lines? Thanks May 06 19:16:46 not R.id.textView2 ? May 06 19:16:59 ^ that May 06 19:17:00 and May 06 19:17:07 are you doing it before you do setContentView()? May 06 19:17:20 ahh thats a thought May 06 19:17:54 seanjean718 you are thinking along the right thought :) May 06 19:18:11 seanjean718 are the images going to change and need to be refreshed from the web? May 06 19:18:20 t0mless: I'm doing it after I do the setContentView() May 06 19:18:30 I've also adjusted to R. prefix May 06 19:18:46 xemi: did u try to make the tv invisible in onPreExec? May 06 19:18:52 not sure how id.textview2 even compiled May 06 19:19:15 t0mless, thanks! The images will change less than the metadata. I'm pulling tweets from twitter. May 06 19:19:43 brx_: I'm not sure what you mean, I'm not implementing onpreexec May 06 19:19:51 t0mless, the images will be profile pics ?. so I want to store them separately from the tweets because a user can tweet many more times without having their profile photos change. May 06 19:20:20 just sayin, thats how i would test the reference to your tv May 06 19:20:35 I would change the text in it as a test. May 06 19:21:06 t0mless, the only thing is I'm not so sure how to use Mediastore to store images. Are there any sample code for that? The other thing I'm stuck on is binding to listview. Should I be customizing the SimpleCursorAdapter? May 06 19:21:24 cant see what his problem might be May 06 19:21:50 you will probably want to implement your own cursor adapter to handle the images May 06 19:21:57 and just use a Cache for the profile pics May 06 19:22:13 scrwe the mediastore May 06 19:22:17 screw* May 06 19:22:18 how do i make application exit on home button? i don't want it to "multitask" May 06 19:22:25 t0mless, what do you mean by cache? in memory cache? why not use the mediastore? May 06 19:22:30 rimad BOO to you sir. May 06 19:22:58 seanjean718 Mediastore is more for images/media you want to store for a long time and share with others May 06 19:23:14 seanjean718 just cache your images and update them periodically May 06 19:23:31 t0mless, the idea is to share the downloaded tweets with other apps via a contentprovider May 06 19:23:35 either on the sdcard or your local data dir May 06 19:23:57 mother of God in the constructor the async I made a mistake I used tv=this.tv instead of this.tv=tv May 06 19:24:11 I think if you put them in the mediastore then they'll show up in like Gallery and apps like that May 06 19:24:12 self-pwnt May 06 19:24:22 t0mless, oh... May 06 19:24:25 seanjean718 you can still share the cached images with a contentprovider May 06 19:24:29 t0mless, i know :/ May 06 19:24:29 I'm having trouble getting getIdentifier to work. Any suggestions? http://pastebin.com/CkFR2eQz All values returning are 0 May 06 19:24:32 thanks for the help guys I'm off for a bear my head is craving for it May 06 19:24:36 have a great night! May 06 19:24:39 beer* May 06 19:24:44 t0mless, how would I share the cached images with the contentprovider? May 06 19:24:45 for some reason it just says "application stopped" when coming back to it..no time to debug it now. May 06 19:24:46 caio May 06 19:24:50 xemi: Good luck with beers :o May 06 19:25:04 bears* :D May 06 19:25:05 t0mless, is it possible to have more than one table with a content provider? May 06 19:25:14 seanjean718 you just... do it May 06 19:25:15 seanjean718: Yes May 06 19:25:22 you can do whatever you want with your content provider May 06 19:25:35 you don't have to back it with SQL May 06 19:26:43 t0mless, I see. Thanks May 06 19:29:19 T-Dub|DlolPics: The syntax seems to be: getResources().getIdentifier("nameOfDrawable", "drawable", getPackageName()); May 06 19:29:34 But drawable is for drawables? May 06 19:29:37 Yes May 06 19:29:39 what happens if i reopen application? i can't find any info on this. May 06 19:29:44 I'm trying to get a sound. I tried null and "raw" May 06 19:29:47 Either didn't work. May 06 19:29:53 it opens fine the first time, if i leave it and open again it stops for some reason... May 06 19:30:03 T-Dub|DlolPics: What is the resources type? Which resource folder is it in? May 06 19:30:09 raw May 06 19:30:11 ah, raw May 06 19:31:13 T-Dub|DlolPics: "raw" should work. Try removing ".ogg" May 06 19:31:23 Alright. May 06 19:31:35 I tried with no .ogg before, but I can't recall if it was null or "raw" May 06 19:32:19 Which is faster? RMI or serialized objects containing mouse movement data? May 06 19:32:44 Hey I think it worked. The value isn't the same that's in R.java though. Is that normal? May 06 19:32:57 I assumed it would return the R.java value. May 06 19:33:36 you need the .ogg file extension, but they go in the raw folder under res May 06 19:34:01 You then can reference them with R.raw.? May 06 19:34:14 you may need to "clean" the project after adding the ogg files May 06 19:34:50 also, your ogg files can NOT contain any spaces in the filename! May 06 19:35:20 t0mless, thanks for telling me May 06 19:36:24 When adding a value to an array can you skip the 0 index? And just go straight to array[1] = blah May 06 19:36:47 yes May 06 19:37:01 Hmm May 06 19:37:02 array[0] will just be empty or null May 06 19:37:21 or are you wanting to change the index of the array? May 06 19:37:43 "starting index" May 06 19:37:58 I'm just trying to add a value to an array, but I started at array[1] = blah rather than 0, and I'm getting a null pointer exception May 06 19:38:18 yes, if you try to read array[0] you will get this error May 06 19:38:27 I'm not reading array 0 May 06 19:38:36 pastebin May 06 19:39:41 I get an error on line 2: http://pastebin.com/Zz7VAB40 May 06 19:39:58 T-Dub|DlolPics: You need to instantiate the array first May 06 19:40:07 If I change rawSound[i] to like int whatever = blah, it works just fine. So it's the fact it is a array or something. May 06 19:40:32 Oh fail, I just declared the variable not instantiate it. May 06 19:40:34 Lol thanks. May 06 19:40:35 hmmm....u sure your not going paste the array length? May 06 19:40:43 T-Dub|DlolPics: rawSound = new int[13+1]; If you wish to index from 1 and not 0 May 06 19:41:22 Hm, I'm trying to create a geoUriString in strings.xml like this: "google.streetview:cbll=46.813812,-71.207378&cbp=1,99.56,,1,-5.27&mz=21" <- but somehow eclipse complains that it's bad xml. and wants to add ; as delimiter after cbp (which of course doesn't work). what am I missing? May 06 19:42:07 Mattias: You need to escape your " symbols inside the string, or replace them with HTML codes May 06 19:42:11 you have two ,, May 06 19:42:22 cbp=1,99.56,,1,-5.27 May 06 19:42:37 not sure though May 06 19:42:37 skfax: ah ok, I just assumed this would work since it's a pure copy paste from a mobiletuts tutorial :P May 06 19:42:47 and no comments has complained O.o May 06 19:43:20 Thank you skfax and dlaroche. May 06 19:43:32 anytime May 06 19:44:21 skfax: how do I escape the &? May 06 19:45:10 & is the HTML code for it. Just reading up on http://developer.android.com/guide/topics/resources/string-resource.html#FormattingAndStyling now, seems like you can use " at the start and end of the string May 06 19:47:21 skfax: ah, so they used "" in the tutorial so they didn't have to escape &, but for some reason it doesn't work for me.. odd May 06 19:47:31 anyways, escaping worked :) May 06 19:47:35 or rather, using the html code May 06 19:47:40 Can I detect both a MotionEvent.ACTION_MOVE and a KeyEvent.ACTION_DOWN at the same time?? May 06 19:48:03 using the same OnTouchListener? May 06 20:08:29 Since 3.2, Android can act as a USB host, and apps can use this through android.hardware.usb. But can apps use a /device/ USB interface? I don't think 'accessory' mode is the same as device mode. For example, could I make an app appear as a native Alsa Midi port to a Linux host? May 06 20:09:03 JamesJRH: afaik no May 06 20:09:37 :-( May 06 20:10:19 Hmm... well is there some sort of accessory mode 'converter' for Linux? May 06 20:11:16 That acts as a kind of serial proxy. May 06 20:13:09 p_l: How does USB storage work then? Or tethering? May 06 20:13:27 JamesJRH: kernel-mode driver May 06 20:13:28 Can it be done with root? May 06 20:13:37 JamesJRH: can the device? yes. can android w/out rooting? no May 06 20:13:48 if you root and write a driver, you probably can be a usb device May 06 20:14:16 dragorn: you have better chances using a microcontroller to talk USB MIDI on one side and talk with device on the other side May 06 20:14:17 dragorn: I have root, that's no problem. Driver... no idea. May 06 20:14:32 probably in the 'usb gadget' class May 06 20:14:44 p_l: I have considered this. May 06 20:14:48 p_l: not sure what he's trying to do May 06 20:15:08 JamesJRH: if you just want to make a midi device out of your phone, you could do it over bluetooth May 06 20:15:18 p_l: http://createdigitalmusic.com/2011/05/android-adds-usb-host-mode-open-hardware-development-with-arduino/ May 06 20:15:30 just write whatever bridge code you need on linux to read the midi from bluetooth May 06 20:15:38 p_l: But it seems unnecessary. May 06 20:16:30 readme: No, I can do it over WiFi anyway. I'm looking for something more reliable and lower latency. May 06 20:16:40 JamesJRH: depends what exactly you want to do May 06 20:16:48 point to point bluetooth would be a lot faster and more practical than wifi. May 06 20:16:52 I could envision a device which acts as a usb device to two hosts and talks a basic protocol between them, but you'd have to design it yourself May 06 20:16:54 easier to setup, too May 06 20:17:03 bluetooth would not be faster than wifi May 06 20:17:17 JamesJRH: two USB-MIDI interfaces could be connected to each other, and then you could access the MIDI stuff directly from android app May 06 20:17:23 dragorn: even if there's a router? May 06 20:17:42 anyhow if you threw two cheap-ass microcontrollers on a board that were capable of doing usb client you could serial between them May 06 20:18:09 i've had good luck with the lpc1343 lately and it's dirt cheap at $4.50 a chip or so May 06 20:18:34 dragorn, p_l: Not all devices have USB host support (including mine). May 06 20:19:01 JamesJRH: then why are you asking about usb host or rooting? Not everyone has a rooted device, either. You're left with BT and wifi. May 06 20:19:36 readme: BT is pretty low bandwidth and the latency isn't amazing either May 06 20:20:02 If I wrote a USB device-mode driver, does that mean kernel recompilation? May 06 20:20:04 Anyone know a guy that hangs out here that has a Nexus One whose contract ends this month? May 06 20:20:14 I lost contact with the guy, no idea on his name whatsoever May 06 20:20:18 JamesJRH: yes May 06 20:21:41 Could it not be done with the NDK? May 06 20:22:49 no. you have to write a kernel module May 06 20:22:58 and one which overrides the existing behavior May 06 20:32:55 How do you specify the location the SDK manager uses to download to? May 06 20:33:15 it goes in the sdk directory May 06 20:33:21 under platforms or extras May 06 20:33:23 or tools May 06 20:33:26 or platform-tools May 06 20:33:32 depending on what it is you're downloading May 06 20:33:44 You can't specify the path? May 06 20:33:48 Nope May 06 20:34:11 how do you check if an internet file exists (url: http://XXX/file.xx )? I was wondering wether I should try to open the file,but I feel there should be a more efficient way.. May 06 20:34:37 you can specify the path of your sdk directory May 06 20:34:39 thegrinch1: why do you need to? May 06 20:34:47 thegrinch1: There's a HEAD request. =\ May 06 20:35:23 Yeah I want to specify the SDK path the manager uses May 06 20:35:23 I'd like to check if a file is available..simply.. May 06 20:35:43 I figured there was some environment variable it used May 06 20:36:00 thegrinch1: you have to request it May 06 20:36:12 thegrinch1, some kind of http HEADER request, giving you filesize or some May 06 20:36:18 also, don't think of http://xxx/file.xxx as a file. think of it as a uri May 06 20:36:36 thegrinch1: you almost certainly don't want to do that May 06 20:36:52 possibly initating a transfer than aborting it, though that doesnt seems good practice May 06 20:37:06 In file I'd like to store files in a webserver and retrieve them.. May 06 20:37:27 nmulcahey So you install the SDK to whatever path you want May 06 20:37:35 nmulcahey and the sdk manager uses that path May 06 20:38:19 Why wouldn't I want to do that? May 06 20:38:46 depends on file size whether it really matters May 06 20:43:26 Trying to give space between buttons in RelativeLayout but it does not work. please see http://pastebin.com/K7db9YfZ May 06 20:44:17 I was thinking of using an HttpURLConnection and get an inputstream to the file to get my files.Now I'd like to check if file exists before creating the stream... May 06 20:45:39 I think dark3n just suggested you try a HEAD request May 06 20:45:41 did you try that? May 06 20:46:23 I know nearly nothing about HTTP... May 06 20:46:34 well then you know what to start learning :) May 06 20:46:50 can someone look into my code ? May 06 20:46:59 the RFC is the last resort for precise information if the API docs fail you May 06 20:47:22 here's one: http://developer.android.com/reference/org/apache/http/client/methods/HttpHead.html May 06 20:47:30 that works with the HttpClient, of course. May 06 20:47:38 jaami don't put the + in your toRightOf ids May 06 20:47:45 + implies you want to create a new ID May 06 20:48:15 but you already created it when you did android:id="+@id/..." May 06 20:48:24 what's the use?I intend to use HTTP as a tunnel... May 06 20:48:57 do you know what HEAD does? May 06 20:49:16 yep...get MIME type,etc... May 06 20:49:25 so why do you think it won't be useful to you? May 06 20:49:41 t0mless: Thank you. are you taking about these IDs @+id/bRefresh , @+id/bInvite? May 06 20:49:41 but I just need to know if the file I need is available... May 06 20:50:02 don't care about infos...Just there or not... May 06 20:50:30 if it's there i CAN OPEN THE STREAM;;; May 06 20:50:41 sorry for the case... May 06 20:50:44 thegrinch1: use the HTTP status code May 06 20:50:50 if it's a 200 OK, then it's probably there May 06 20:51:02 jaami yes, you're declaring them twice. May 06 20:51:53 thegrinch1: if you're looking before you fetch, you might have a ToC/ToU problem May 06 20:52:19 im so sorry, i rerally dont get it. where i am declare them second time? please explain because im newb May 06 20:52:25 what is ToC/ToU May 06 20:53:05 time of check/time of use May 06 20:53:14 ah, yeah. May 06 20:53:18 good point. May 06 20:53:36 in english for anyone else who missed it: the file could change between your requests. May 06 20:53:45 my files are just resources...no html...just bitmap/audio/videos May 06 20:53:54 thegrinch1: just GET the file and if it fails, bleh May 06 20:54:04 jaami you're declaring them with android:id="+@id/bBack", but you REFERENCE it with android:toRightOf="@id/bBack" <-- NO + Sign May 06 20:54:16 er @+id not +@id May 06 20:54:32 but if I GET them,i will launch a download... May 06 20:54:52 t0mless: got it this time. Thank you. May 06 20:55:11 so obviously the files are not on your own server, because if they were you could design some protocol that allows you to reliably retrieve them. so you must deal with reality and accept the problems May 06 20:55:25 you can either try the HEAD solution and get potentially false info May 06 20:55:32 or the GET solution, and launch a download every time. May 06 20:56:01 doesn't the download manager let you get files from webservers, and handle errors? May 06 20:56:01 thegrinch1: okay, why do you need to know if they exist May 06 20:56:25 t0mless: cool! May 06 20:56:36 It was more of a question May 06 20:56:43 well, I just opened the doc May 06 20:56:47 I know you can tell it to go get a file and it will call a pending intent when it's done May 06 20:57:02 or make a notification with the pending intent? May 06 20:57:08 not sure what it does in terms of error handling May 06 20:57:37 it looks like a good solution May 06 20:57:44 XMPPwocky...that's a good point...In fact I'd like to check if a file is in my cache or available... May 06 20:58:04 file might not be used May 06 20:58:17 thegrinch1: so then, what about HEAD does not fit that description? May 06 20:58:39 I'l check head and try to wonder how it works...Thanks May 06 20:58:50 it's prone to errors it's only good for a guess. May 06 20:59:08 like XMPPwocky was trying to tell you, just because the file exists one second, doesn't mean some dude didn't delete it on you. May 06 20:59:19 does anyone know what the biggest image hosting company is that has an android app? twitpic? May 06 20:59:29 so you want to just find out if an image exists May 06 20:59:33 *file May 06 20:59:39 without using it in any way May 06 21:02:25 I'll check it...Thanks... May 06 21:04:29 Another stoopid question:How do you enable opengl 2.0 in the emulator?I enabled GPU support, but the configurationInfo.getGlEsVersion() just retyurn 0.0.... May 06 21:05:12 thegrinch1: might just be a bug May 06 21:05:22 try to run an app with hw acceleration on May 06 21:05:27 if it works, you have GLES 2 May 06 21:05:52 I've heard someone else having that issue May 06 21:06:07 there might already be a bug filed on b.android.com May 06 21:06:18 I've seen this bug filed yes May 06 21:06:42 Hello from france romain...which app is available to test? May 06 21:07:18 thegrinch1: any app May 06 21:07:26 go to settings and turn on Force GPU rendering in the dev section May 06 21:09:40 I have an eclipse project targeted to ICS, with a lower minSDK… i can run the project in an ICS emulator, but how can i run it on my SGSII?? May 06 21:10:41 Install it and run it? May 06 21:11:00 its a new app, so trying to set it up from the beginning with ICS support, but to develop for my gingerbread device… eclipse wont let me choose my device when i run it? May 06 21:11:16 cheekoli: your run configuration is probably set to automatic May 06 21:12:45 Is there any way to get the text value of a button? Like Button.getText(); kind of thing? May 06 21:12:55 T-Dub|DlolPics: ...exactly that. May 06 21:13:03 did you not even try this before asking us? May 06 21:13:05 I looked and didn't find that. May 06 21:13:11 I did, there wasn't a getText/getString May 06 21:13:18 there is a getText() method, however. May 06 21:13:39 I see getTextColor May 06 21:13:48 ... May 06 21:13:56 It's giving me an error, sec let me restart eclipse. May 06 21:14:04 readme, its set to manual… i get a popup asking me which device to run on, but it doesnt show my device.. i have antther project targeted to 2.3.3 and it runs fine on the device, so its not adb May 06 21:15:01 Why would it show up after I restart eclipse? May 06 21:15:03 Thank you jasta. May 06 21:16:41 I launched my app with "Force GPU Rendering" enabled and "enable GPU" in emulator settings.On activity start I collect the configurationInfo which tells me the GLversion is 0.0... May 06 21:17:52 that's a bug in the emulator May 06 21:18:09 it says "select a device compatible with target Android 4.0.3".. i wouldnt expect my device to be on that list... May 06 21:18:33 just install it manually with adb May 06 21:18:43 eclipse is probably filterring it because of your targetAPI May 06 21:18:52 because eclipse is stupid May 06 21:19:13 adb -s install -r path/to/your/apk May 06 21:19:23 thats stupid, you cant do it with eclipse? May 06 21:19:32 eclipse is stupid May 06 21:19:55 cheekoli: is your device in adb devices if you run it? May 06 21:20:15 ANother weird thing: I have a device with ICS (chinese tablet Window N50). It doesn't appear when I want to debug with the latest adb 1.0.29. When I launch adb 1.0.26, it appears. May 06 21:21:16 "chinese tablet" as if any tablet wasn't made in china. hahaha. May 06 21:21:24 heh May 06 21:21:28 taiwan != china May 06 21:21:29 guys, I have a listiview, on the 'onItemClickListener' I'm showing up a "CustomDialog". I need to get back a value from the Dialog, do you guys knows a way? May 06 21:21:40 When I launch the gingerbread firmware,the same tablet appears with adb 1.0.29 May 06 21:22:08 definitely a bug with adb May 06 21:23:09 And eclipse do not filter devices,it just indicate the firmware is lower.. May 06 21:26:06 Hey guys, I'm having a problem trying to compile SdkController in SDK Tools r19. Basically both the main.xml and sensors.xml layouts are missing their corresponding strings. When I look in values/strings.xml I don't see any of the strings either. I've Googled around and can't find any others with this issue so I am perplexed. May 06 21:26:33 I've run the Android SDK Manager and my version of SDK Tools r19 is up to date. May 06 21:26:55 no idea for the GLES2.0 return 0.0 or the missing devices? May 06 21:29:20 what's sdkcontroller May 06 21:29:22 can i execute asynctask again if i cancel it? May 06 21:29:30 rimad, no, create it again May 06 21:29:32 says in documentation that it can not be executed twice.. May 06 21:29:36 alright, thanks May 06 21:29:48 the documentation is how it must behave May 06 21:29:53 pfn: sdkcontroller is the app in SDK Tools that allows you to tether a real device and forward sensors/multi touch events May 06 21:30:04 I need it to test multitouch in my application. May 06 21:30:27 I see... never heard of it May 06 21:30:53 It is relatively new I believe as before you couldn't test multitouch or sensors in the emulator at all. May 06 21:31:23 Missing strings seems like an issue everyone would encounter though which is why I am so mystified about the problem. May 06 21:32:09 no one's using the tool probably May 06 21:32:17 in any case, I just built it successfully May 06 21:32:36 you probably changed the files without knowing or something May 06 21:32:36 What do you see in values/strings.xml? May 06 21:32:43 a bunch of strings May 06 21:32:44 duh May 06 21:32:48 hmm weird May 06 21:32:55 I guess I will just reinstall SDK Tool sr19 May 06 21:33:10 yeah, you probably nuked it without knowing May 06 21:33:27 pfn: thanks for checking for me May 06 21:35:21 pfn: how did you import the project into eclipse exactly? I'm wondering if that is how it got overwritten May 06 21:35:30 I don't use eclipse May 06 21:36:30 no idea about passing data between activity and dialogs? May 06 21:37:34 Hanarkis: first result for 'android pass data between activity and dialog' http://stackoverflow.com/questions/4279787/how-can-i-pass-values-between-a-dialog-and-an-activity May 06 21:40:23 readme: I'll check, thx May 06 21:41:30 Elmoe I was also able to build it just fine :) May 06 21:44:12 t0mless: yeah a reinstall of the sdk tools restored it, I think the eclipse import somehow overwrote the strings the first time May 06 21:44:15 got it working now, thanks guys May 06 21:47:11 how do you switch from one Activity to another? May 06 21:47:35 startActivity() is throwing errors for me May 06 21:47:35 startActivity() ? May 06 21:47:41 you're doing it wrong May 06 21:47:45 illegal state May 06 21:47:53 what's the stacktrace May 06 21:49:13 I could take a screenshot - it all looks like jibberish to me except the first line May 06 21:49:25 copy and paste to pastebin May 06 21:49:28 I called startActivity() in onCreate of another method May 06 21:49:39 method = Activity May 06 21:49:44 also pastebin that onCreate code May 06 21:49:49 which I suppose doesn't make sense May 06 21:49:57 not really, no May 06 21:50:03 ugh this code is so ugly May 06 21:50:14 pstebin the entirety of the logged exception May 06 21:50:20 including context of 10 lines before and after May 06 21:50:25 a frankenstien of copy and pasted examples. I'm embarrassed May 06 21:50:52 start with the exception, we can probably figure it out from that May 06 21:51:30 k hold on May 06 21:52:29 Hello world! May 06 21:52:48 throw new NeedsCommaException("Grammar police!"); May 06 21:52:56 Hello, world! May 06 21:53:36 http://pastebin.com/ucVxAsgz May 06 21:54:58 i've gotta eat, so I'll be back May 06 21:55:29 RustyShackleford, the message is straightforward May 06 21:55:29 it told you the problem right here: System services not available to Activities before onCreate() May 06 21:55:41 * pfn sighs at the lack of any reading whatsoever May 06 21:56:04 Hi. I got a problem. Just created my first android application using MOTODEV and exported a apk with minimum android version 2.1. My HTC Desire has 2.3.3 installed and when i try to run the apk on it the installer shows up but finishes with "Application not installed." The APK is signed etc. Any ideas? May 06 21:58:34 hello again. i'm awake again with a fresh brain from the closet May 06 21:58:50 Nachtwind look at logcat for your device May 06 21:58:55 would someone be kind enough to walk me through what they are explaining in this page? http://developer.android.com/guide/topics/fundamentals/fragments.html#EventCallbacks May 06 21:59:16 t0mless: will try May 06 21:59:16 I don't understand what they are *accomplishing* by creating an interface, or what part the activity plays in this May 06 21:59:25 Nachtwind probably have debug version installed and trying to install with release key May 06 21:59:29 which will throw an error May 06 21:59:45 hm, how can i check that? May 06 21:59:51 logcat May 06 21:59:53 i tried a release key - that is right May 06 21:59:54 will tell you the error May 06 22:00:22 if the version you have installed is signed with a debug key, you have to uninstall it to install the new one May 06 22:02:42 has no certificates at entry main...main.xml; ignoring May 06 22:03:07 thats the only thing related to my app i could find May 06 22:05:16 try installing it with adb then May 06 22:05:20 that should make the error clear May 06 22:05:32 hm, ok May 06 22:11:11 Hi there, anyone know if you need to have an android phone unlocked to use it as a developer phone? May 06 22:11:27 no May 06 22:12:01 So I can just get any ATT android phone and use it as a dev phone? May 06 22:12:23 yes May 06 22:12:41 you will want one that can be rooted, so do your research. May 06 22:13:08 they do not need to be unlocked or rooted to do development May 06 22:13:22 I use a non-rooted, original ROM, Galaxy Y. May 06 22:13:22 it's nice if you're so inclined, but unnecessary May 06 22:13:59 Hm... I see thanks guys. May 06 22:14:04 I'm new to Android dev, May 06 22:14:09 and was looking at getting the HTC One X. May 06 22:14:19 I just heard a lot about unlocking etc, and got really confused. May 06 22:14:42 if you want to tweak your phone, then you'll want something that's rootable and hackable May 06 22:14:44 if i could only get 1 phone, i would get a current or previously current nexus; if i could afford more, then 1 from each OEM that was a best seller May 06 22:14:45 if you don't care May 06 22:14:47 it's unnecessary May 06 22:15:11 (each oems, so you test on different skins, etc) May 06 22:17:49 nice May 06 22:17:58 that's cool then. May 06 22:18:13 I was just worried if I got a HTC one X I couldn't use it with the SDK. May 06 22:18:14 heh May 06 22:18:16 hehe* May 06 22:21:36 i got one x :P May 06 22:31:17 general help needed for mirc. is there easy way to jumpp to the last line where other someone my id in his message? May 06 22:32:35 i have to scroll up to see who sent msg to me if there is any May 06 22:32:59 Do you usually implement a constructor for classes that extend Activity? May 06 22:33:18 RustyShackleford: no May 06 22:34:16 so what's going on there? Is the constructor called by onCreate()? May 06 22:37:31 Anyone using Ubuntu 12.04? May 06 22:37:36 RustyShackleford: the constructor is called by the framework, don't worry about it May 06 22:37:51 as a rule of thumb, do nothing before onCreate unless you know what you're doing. May 06 22:38:20 nothing that requires an application context, anyway. May 06 22:39:04 well that might have been my error from earlier. I was calling a constructor for a class that extends Activity May 06 22:39:48 hello May 06 22:43:45 Sorry if I'm in the wrong place here for asking this... I never been in touch with Android so I would like to try it out without buying a device. Can you guys tell me if it would be possible to set up an android SDK so I can look through the environment? May 06 22:44:35 yes, read -> d.android.com May 06 22:44:38 hey RustyShackleford May 06 22:44:42 hey readme May 06 22:44:45 hi Napalm May 06 22:45:36 SDK comes with an emulator, nick20, I have a device, but I dev in the emulator (don't ask me why). Take a look at d.android.com as readme said. May 06 22:46:58 so I could set up an emulator and configure a clean android OS with ... lets say some mail configurations and stuff? Hanarkis May 06 22:49:22 Yeah, you can configure a virtual device with a particular Android version, you can edit the configuration too, aswell as RAM, SD card, etc. May 06 22:53:57 can someone explain to me the meaning of a callback function and what it accomplishes? Wikipedia, android resources, and other links are not clear to me May 06 22:55:53 hesperaux: "don't call us, we'll call you" May 06 22:56:18 .. May 06 22:56:42 hesperaux: you're basically telling some class that it can run your code later when it needs to inform you of something. May 06 22:57:11 hmm May 06 22:57:46 hesperaux: u can think a callback is a notification... some type of "call me when you're done" May 06 22:57:58 alright... I'm going to look for a tutorial how to set this emulator stuff up... I have no idea what to do after I openend the "SDK Manager" exe... May 06 22:58:06 hesperaux: objects have methods and data. that means if you give me your object, that I can call your method. May 06 22:58:26 its amazing to read a world renowned expert in photography talk about histograms and sensors, and fuck things up May 06 22:58:27 obviously callbacks work without oop too, but it's easy to understand like that. May 06 22:58:57 nick20: good luck :) May 06 22:59:08 <`teh1> i need to send utf-16 c2dm messages to my phones, because they are localized in other languages May 06 22:59:13 <`teh1> any ideas on how to do that? May 06 22:59:30 <`teh1> they are stored in the utf-8 database, so of course they need to be converted somewhere, somehow May 06 22:59:31 <`teh1> :P May 06 22:59:36 I'm getting an out of memory error trying to decode a bitmap file, but I'm using the subsampling option and doubling the subsampling value with each error caught, but it always generates the error. Help? May 06 22:59:37 readme, how is that different from inheritance, or just being within the scope of an object's methods of interest? May 06 22:59:57 hesperaux: it's has-a May 06 23:00:01 inheritance is is-a May 06 23:00:06 Hanarkis: thanks, are you being sarcastic? lol May 06 23:00:18 I "have a" string, so I can call it's length method to see how many characters are in it. May 06 23:00:21 its* May 06 23:00:21 Hanarkis: (is it hard?) May 06 23:00:34 nick20: no, I'm really wishing you good luck and lots of fun, as I have :D May 06 23:00:36 <`teh1> anyone? May 06 23:00:46 http://pastebin.com/EhLrJBgL May 06 23:01:08 readme, so if i define a callback function in an activity, that function could be made available (by itself) to a fragment loaded by the activity, along with that original function's scope? May 06 23:01:26 nick20: It's a pleasure to play with eclipse and android development, after a week of Delphi shit. :P May 06 23:01:30 if you passed the whole activity instance to the fragment with 'this', then the Fragement would "have-a" activity. May 06 23:01:40 Fragment* May 06 23:01:57 Hanarkis: haha, Delphi... yeah... I feel you ^^ May 06 23:02:22 readme, passing an Activity to the fragment wouldn't be useful though, would it? I could just call getActivity() in the fragment for that, right? May 06 23:02:34 right, I'd use getActivity() May 06 23:02:51 using getActivity().anything() seems like a way to implement callbacks then...is that true? May 06 23:03:59 uh, I guess it depends on what you're doing. May 06 23:04:13 when I implement callbacks I usually define an interface if it's of any sort of importance. May 06 23:04:19 <`teh1> meh May 06 23:04:43 readme, ah. I would really like to understand that. What are the May 06 23:04:45 meh May 06 23:04:50 hesperaux: say you had a class May 06 23:04:53 what are the benefits of implementing an interface instead? May 06 23:05:09 and you needed the users of the class to know how they can give you an object that it can use, to call back May 06 23:05:20 you define an interface and tell the users of your class to implement it May 06 23:05:28 so that your class knows how to call the "callback" May 06 23:06:17 you use Buttons, right? May 06 23:06:23 yep May 06 23:06:29 what do you do to get an event from a button? May 06 23:06:57 you set a listener class and override the interface's methods in the listener May 06 23:07:01 that's a callback. May 06 23:07:07 i always wondered what the mechanics of that were though May 06 23:07:16 i.e. why is it actually called. what calls it? May 06 23:07:47 the button keeps a reference to the instance of your listener class May 06 23:08:00 then when you press the button, it calls mListenerInstance.onClick() May 06 23:08:06 everything else is just a black box. May 06 23:08:35 if (mCallback != null) mCallback.call(); May 06 23:09:02 fyi in case anyone was looking into my question I decoded using a FileInputStream instead and it worked perfect. May 06 23:09:34 readme, there is still something i'm missing. i can't figure out what it is. grrr May 06 23:09:41 what's AVD? May 06 23:09:50 nick20: Android Virtual Device May 06 23:10:01 ah ... obvious, thy May 06 23:10:03 ah ... obvious, thx May 06 23:11:12 i've g2g. i'll bbl to keep figuring this out. thanks readme May 06 23:11:34 hesperaux: i suggest you try to write the callback version of fizz-buzz May 06 23:12:08 make a class that counts from 1..n and calls fizz() when it's %3, buzz when %5, or both when its %3 & %5 May 06 23:37:21 what is a recommended SD card size when I want to test the android OS on the emulator May 06 23:37:37 configuring mails, downloading apps, and stuff May 06 23:39:09 1GB ? May 06 23:39:49 nick20: my real device have 2GB. my AVD have 0 Mb :P May 06 23:40:34 Hanarkis: i gave it 50mb and shot a picture with camera, it said the SD card is full lol May 06 23:40:36 nick20: you honestly just need as much space as you.. well need really. if you are downloading mails that are just plain text, I cant imagine more than a couple hundred megs would be needed May 06 23:40:50 Would any of you know how bluetooth devices with OLED displays are updated? I'd like to add in the "display caller id / caller info" to my app but there's absolutely no documentation or other results that I can find on Google. I can't even find out if it's a proprietary thing or if they use an already existing bluetooth function May 06 23:41:21 k thanks for advice. The next question is: how can I pass a internet connection through? :-S May 06 23:42:00 nick20: what? I don't undestood your question... proxies? May 06 23:42:34 Hanarkis no, how do I access internet inside the emulator May 06 23:42:41 He wants his Emulator to have access to theinernet May 06 23:43:02 Hmm... It's "automagic" I think.... Here is at least. May 06 23:43:23 (I love this word "automagic") May 06 23:43:52 Open a Browser in you AVD and try to browse some site. May 06 23:43:59 u mean it should already work? May 06 23:44:04 nick20: Yeah May 06 23:44:26 oh, kk, let me try it out. I just have to clear up my C drive as I only had 100 MB left, lol May 06 23:44:41 If the host machine is already connected, I think it should work. May 06 23:45:04 k. I was thinking about virtual LAN devices like in vmware May 06 23:45:24 but nevermind, I'll try it as I set it up again. May 06 23:45:54 nick20: this is slightyl different.. your not virtualizing, your emulating May 06 23:46:26 okay... I dont seem to understand the difference between those two things May 06 23:47:30 so, on an x86 platform, if you want to run arm stuff you have to "emulate" the ARM instructions in order to drive it. its done completely different than with Virtualization that uses a hypervisor May 06 23:47:36 I dont believe emulators use a hypervisor May 06 23:47:46 they do now! May 06 23:47:52 oh do they? May 06 23:48:01 the new x86 images May 06 23:48:06 well, duh. May 06 23:48:09 that's not emulation May 06 23:48:11 :P thats different though! May 06 23:48:15 right May 06 23:48:23 uses VT-x on intel chips May 06 23:48:28 doesn't work on my AMD chip :( May 06 23:48:35 It cant leverage AMD-V? May 06 23:48:39 apparently not May 06 23:48:45 Mucho Lame May 06 23:48:52 the images were developed by Intel so.... May 06 23:49:01 Why does it need VT-X anyway? I thought that was for 64bit emulator May 06 23:49:05 err, virtualization May 06 23:49:18 * t0mless shrugs May 06 23:49:40 android-sdk\add-ons\addon-intel_atom_x86_system_image-intel_corporation-10 May 06 23:49:43 and check the release notes May 06 23:49:48 yeah I know that one :P I use that May 06 23:50:03 t0mless: I tried the x86 images, it was... painfull and crashy, don't be sad :P May 06 23:50:04 Ill have to look.. maybe its doing some goofy things to get around requiring a hypervisor, which is why it needs VT-X May 06 23:50:15 I prefer the x86 to ARM, boots much faster and I had no issues May 06 23:50:51 errrr May 06 23:50:52 I mean May 06 23:51:03 android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager May 06 23:51:16 Ahh.. that makes sense then May 06 23:51:38 which is required to use if you want GPU emulation May 06 23:51:44 Well thats ok, everyone knows people dont use AMD pcs to program :P May 06 23:51:46 and it doesn't support AMD-V May 06 23:51:55 :( May 06 23:52:00 jk, but seriously May 06 23:52:25 Arent the majority of AMD chips now APU's? May 06 23:52:43 yup May 06 23:53:04 Yeah, I cant imagine intel would want AMD's API's so their image works on their APUs May 06 23:54:00 Guys, I'm tired, will play some world of warcraft, have a nice day. :) May 06 23:55:19 kk May 06 23:55:20 another question. should it work smooth or is it laggy for you guys too, when going through android menus? (it may be caused at my side because of low space) May 06 23:55:37 Most likely it is gonna be laggy May 06 23:55:49 nick20: about the performance..... I have a better result in my linux. May 06 23:55:58 You arent getting goodies like Hardware GPU Acceleration May 06 23:55:59 kk May 06 23:56:19 plus, like I said, unless its an x86 image, you are emulating, and emulation takes aperformance hit May 06 23:56:19 what does "whipe user data" do? May 06 23:56:32 makes magical unicorns spring rainbows from ur bum May 06 23:56:42 uhasuhsahuahusa May 06 23:56:46 alright o.O May 06 23:57:03 It does what it says it does, it wipes user data o_o; May 06 23:57:26 are preferences included in userdata? May 06 23:57:32 nick20: it erase the user data, it will be like a fresh instalation (I think) May 06 23:57:43 Hanarkis: thanks May 06 23:59:45 I think my explanation was better May 07 00:00:04 the unicorn thing? Yeah May 07 00:00:30 Ohh u broke my heart :( I'm thinking that my explanation was perfect. May 07 00:00:38 WRONG May 07 00:00:51 Hanarkis: don't be worried :P May 07 00:00:58 wiped May 07 00:01:05 my heart was wiped May 07 00:01:07 bye bye :D May 07 00:06:12 hi there people. does anyone in here know of a way to disable just the speaker? May 07 00:06:51 i'm building a dock connector (reverse engineering an undocumented dock port on a phone) and figured out the audio, but they're on the same lines as the headphone jack. i need to disable the phone's speaker May 07 00:09:49 wow there's 625 people in here and no conversations going? May 07 00:10:13 too busy coding May 07 00:10:17 or playing games May 07 00:10:27 lvnr00tddrd: I blame always-on Internet connections. May 07 00:11:08 56k reunite May 07 00:11:27 lol May 07 00:11:57 I come in here expecting to find experts, I find the electronic shadows of experts May 07 00:11:59 lol May 07 00:13:18 well i have a topic: why does android make it so difficult to theme alert dialogs? May 07 00:13:56 Troll answer: because its not apple! ok now that thats out of the way May 07 00:14:44 cooldman224: I'm not sure, but I have heard (and agree) that alerting is a dubious design choice. May 07 00:15:02 hmm, should I buy some zynga? May 07 00:15:10 I dont find alert dialogs to be difficult to use in general, but ive never made my own custom theme for 1 May 07 00:15:22 I can't believe that it's that complicated just to toggle the external speaker May 07 00:15:30 there must be some app somewhere that does it May 07 00:15:35 just haven't found it :( May 07 00:15:56 lvnr00tddrd: this channel is for application development May 07 00:15:59 try #android May 07 00:16:42 oh, I see. You did mention you were building something. May 07 00:17:08 I think you will have better luck with this kind of question in #android-root or xda May 07 00:17:28 lvnr00tddrd: it really depends on what the API's expose, I dunno how deep the sound apis go May 07 00:22:29 well i know that the speaker can be turned off because it's not a hardware thing. there were some bugs that complained that even when headphoens were plugged in the speaker stayed on May 07 00:23:17 lvnr00tddrd: Considering Android is aware of devices when they are pluged in.. this dock connector, its USB right? May 07 00:23:43 Yo yo dudes. May 07 00:23:59 Quick question about github. May 07 00:24:00 i'm not sure, that's one of the other things i'm working on May 07 00:24:05 Is there a good way to merge just one file? May 07 00:24:05 the dock is completely undocumented May 07 00:24:10 and there's no accessories for it in the USA May 07 00:24:22 though there's a keyboard for it in germany but they don't ship to USA May 07 00:24:23 I've got some work I did a super long time ago that never got implemented in the master. May 07 00:24:35 Now I want to merge just those files. May 07 00:24:53 RMapZero: sounds like you want #git? May 07 00:25:02 drpenguin: Oh good point. May 07 00:25:04 Thanks. May 07 00:28:26 drpenguin: dock connector is usually custom pinout sent over mico-usb May 07 00:28:31 *microusb May 07 00:28:55 p_l: i was asking lvnr00tddrd, im not the guy making it :P May 07 00:29:08 p_l: that's what I thought. I figured there'd be a USB port in it somewhere, but it appears not May 07 00:29:10 lvnr00tddrd: you probably need to find the correct impedance level for "docked" instead of "headset" mode May 07 00:29:50 that's the usual method, iirc May 07 00:30:06 p_1 it's a software switch of some kind because the volume changes directly with the "media volume" setting. it's not line out; it's definitely on the same line as the headphones May 07 00:30:23 a switching chip checks impedance on one of the pins, and routes pinouts apropriately May 07 00:31:06 that's the usual, I believe May 07 00:31:09 that would make sense, but there's an infinite number of pin combinations and resistances May 07 00:32:21 lvnr00tddrd: I recommend checking kernel sources for your device. If the driver doesn't have sources (doubtful - most drivers for that are too deep in platform config to avoid GPL, iirc) you can try finding the levels May 07 00:32:33 the chips are usually common May 07 00:33:19 phone uses a MediaTek MT6573 May 07 00:33:24 haven't been able to find a datasheet May 07 00:33:45 except on one forum that doesn't let me see attachments until I have five posts May 07 00:35:10 lvnr00tddrd: I'd recommend going through phone vendor's pages, try and find sources (the kernel sources *have* to be published) May 07 00:40:20 hmm May 07 00:40:34 this is annoying that such a simple thing as "turn on and off the external speaker" isn't natively available May 07 00:41:23 eh oh well. how about this. is there a tool in android (that can be invoked from a terminal emulator) that lists available and in use ports? May 07 00:41:39 maybe if i can figure out what type of ports it has available I can know closer what to look for May 07 00:42:38 may want to revise your question, in the OS world, ports dont mean what you mean May 07 00:50:24 Hi May 07 00:50:34 I'm just looking for some quick help. I'm trying to use something of the Worker data type in Eclipse, but it's not auto-importing the required library. I looked online and it seems I need javax.swing.SwingWorker ? May 07 00:50:52 I have problems connecting my tablet to my pc in debugging mode May 07 00:50:59 it doesnt appear in adb devices May 07 00:52:00 I already turned USB debugging on my device May 07 00:52:03 Anyone publish on the amazon appstore? Any idea how long approval takes? May 07 00:55:08 Drakonite: weeks May 07 00:55:32 I still haven't got a sale there, though. however, I've not worked much on my app since publishing or padded the reviews there May 07 00:55:40 20 sales on play, 0 amazon May 07 00:55:52 "weeks" being 2,3,4, 12 ? May 07 00:55:59 should be 2 tops May 07 00:56:39 anybody run into the problem of the camera preview being distorted on some devices ? :( May 07 00:59:57 kwazi: you mean what is being displayed on the screen before taking a picture? May 07 01:00:09 drpenguin: yes exactly May 07 01:00:22 kwazi: do we know that the Camera of the device is not broken? May 07 01:00:46 yep, works fine in the camera app May 07 01:01:28 I should maybe describe it more.. its distorted in the sense that the picture is stretched May 07 01:01:28 kwazi: then try to simplify your camera app as much as possible until the effect goes away, then try to locate the problematic section of code May 07 01:01:53 kwazi: thats a different story, what are the screen types of the devices where it is stretched? May 07 01:02:15 screen type? This is a Galaxy Nexus (xhdpi) May 07 01:02:29 is that one where it is stretched? May 07 01:02:41 yea May 07 01:02:51 does it stretch on other devices with xhdpi? May 07 01:03:16 don't have any other xhdpi devices unfortunately, just hdpi May 07 01:03:45 what constitutes xhdpi? I got a new phone with a big screen, maybe I can test for you May 07 01:04:27 well the high resolution screen at a small size. Its a 1280x720 screen on 4.65" May 07 01:04:47 and unfortunately, it's a project for work under a bunch of NDAs so I can't share. But thanks for the offer May 07 01:05:29 kwazi: well you need to find anoher xhdpi device.. my betis that you didnt program the app to handle xhdpi resolutions properly May 07 01:06:59 hmm May 07 01:07:01 Anyone know how to use the Worker data type in Android? May 07 01:07:27 my bet was the camera preview size, but maybe I should try another xhdpi May 07 01:07:49 kwazi: right, the size, meaning it isnt programmed for xhdpi.. which is what I said May 07 01:07:54 TDhoot: "Worker" data type? May 07 01:09:07 drpenguin from the top answer here: http://stackoverflow.com/questions/3357477/is-asynctask-really-conceptually-flawed-or-am-i-just-missing-something May 07 01:09:41 TDhoot: theres no such thing as a "Worker Data Type" May 07 01:10:07 Sorry, then. Just the Worker they're using there? May 07 01:10:10 that's just a regular async task May 07 01:10:14 That "Worker" is just the name of a class that extends AsyncTask, generally, the name Worker is used for "worker threads", or a thread that does work May 07 01:10:24 the only extra feature there is they keep a reference to the activity May 07 01:10:52 and they keep the reference fresh too, so it's the correct instance May 07 01:11:05 Hmm, ok. Thanks drpenguin and readme May 07 01:16:50 can I define a listview in an xml file, then add items later? May 07 01:17:15 also, is the presence of a main.xml necessary? May 07 01:18:51 RustyShackleford, you pretty much always do it that way May 07 01:19:12 can someone give me a basic overview what the directories and files in /sys/devices/platform/ and /sys/bus/platform do? May 07 01:19:21 an adapter can provide views to the list for you from some source of data, like an array or a database May 07 01:19:40 hmm.. Android doesnt use Udev.. I guess android is using sysfs? if so, lookup sysfs lvnr00tddrd May 07 01:19:55 lvnr00tddrd, if it's anything like linux, those are files that show or accept data from/to a driver May 07 01:20:07 drpenguin, not necessarily May 07 01:20:19 even systems with udev will have things in /sys/ May 07 01:20:27 depends on the kernel May 07 01:20:38 hesperaux: I dont know :P like I said, right I know, because udev supercedes sysfs, but I am not sure what Android uses May 07 01:20:58 indeed May 07 01:21:15 Either way, if you lookup sysfs or udev, you should get the info you need May 07 01:21:17 * hesperaux yanks out his beard with thoughtful complacency May 07 01:24:44 ergh i'm so far out of my league on this :( May 07 01:25:35 i don't have a clue what allt his stuff in here is for :( May 07 01:25:43 all I want is to turn the damn speaker on and off May 07 01:42:16 Would any of you know how bluetooth devices with OLED displays are updated? I'd like to add in the "display caller id / caller info" to my app but there's absolutely no documentation or other results that I can find on Google. I can't even find out if it's a proprietary thing or if they use an already existing bluetooth function May 07 01:42:59 depends on device May 07 01:43:34 The bluetooth device or the phone/tablet? May 07 01:43:59 BT headsets/speakerphones that support showing caller id etc. use probably some headset-related protocol May 07 01:44:21 LycaonX: what's your app? May 07 01:44:26 as for the AOSP side, download dialer sources : May 07 01:44:28 *:D May 07 01:45:03 The dialer source is easy to get, it's the OLED stuff I can't find any info on :) May 07 01:45:26 LycaonX: well, all you'd be interested is the protocol to speak over BT May 07 01:45:43 readme: Just an audio player that also shows the song info on the OLED. Nabbed a Sony M@600 the other day May 07 01:45:50 oh nice May 07 01:45:53 I've got a liveview here May 07 01:46:21 p_l: I know that, my question pertained more to what the protocol would be ;p May 07 01:46:23 the protocols will be proprietary and vary by device if it is supported. you will have to consult the manufacturers docs. May 07 01:46:35 or try to reverse engineer it, your choice :| May 07 01:47:03 That's actually a good point. I'm good at REing protocols. Is there actually some kind of BT sniffing application? <.< May 07 01:47:18 they exist but there are none I can recommend May 07 01:48:21 Eh, it's enough to know they exist. Thanks for bringing it up, would have taken a while for that to click May 07 01:51:00 do you have such a headset now that shows caller id? May 07 01:54:27 LycaonX, you're working on headset/speakerphone stuff? May 07 02:02:28 is there a better source of time information than System.currentTimeMillis, and a more accurate sleep than Thread.sleep? May 07 02:04:46 calamari: I would think System.nanoTime is more accurate than System.currentTimeMillis, in regards to sleeps.. I doubt it May 07 02:06:11 drpenguin: thanks! May 07 02:09:21 calamari: there are other items that do "sleeps" in the sense that they wiill wait x time before executing, one of them is the Timer/TimerTask class ( I never remember the right name), ScheduledThreadPoolExecutor also has something if I remember right May 07 02:13:13 drpenguin: thanks again nanoTime fixed me right up May 07 02:13:30 <`teh1> anyone know how to send utf-16 c2dm messages? May 07 02:13:39 calamari: you are quite welcome May 07 02:13:49 http://www.pcmag.com/article2/0,2817,2403831,00.asp May 07 02:14:45 THAT, looks cool g00s, I saw that a while ago when TI was debuting Ubuntu and Android on their OMAP chips May 07 02:16:23 all the bugs of android and ubuntu one one device, horay ! i think it might create a black hole May 07 02:16:31 ugh i can't believe how frustrating it is that there's NO INFORMATION on this anywhere on the internet May 07 02:16:59 <`teh1> scratch what im saying May 07 02:17:15 <`teh1> does anyone know why the fuck android doesnt properly parse accent characters in utf-8? May 07 02:17:28 it shouldn't be so damn complicated to simply intercept all audio and play it through the damn headphones May 07 02:17:29 :( May 07 02:17:30 do I need to set a strong pointer to null after I'm done with it? May 07 02:17:57 my assumption is yes May 07 02:18:46 can anyone point me to a tutorial on hwo to write android apps? All I need is a simple app that just turns on and off the phone's built-in speaker May 07 02:20:47 developer.android.com May 07 02:22:12 that's far from simple May 07 02:22:13 lol May 07 02:22:38 <`teh1> ayone know why c2dm messages with special characters like ú show up as a character? May 07 02:22:45 <`teh1> t0mless: ? =D May 07 02:23:13 the server must not support UTF May 07 02:23:15 but I don't knw May 07 02:23:17 know May 07 02:24:33 try sending the ascii code May 07 02:24:41 or whetever it's called May 07 02:24:57 could also send it as html entity encoded May 07 02:25:24 <`teh1> thanks t0mless May 07 02:56:44 How do you determine if GL_NEAREST_MIPMAP_LINEAR is supported or not? **** ENDING LOGGING AT Mon May 07 02:59:59 2012