**** BEGIN LOGGING AT Sat Apr 02 02:59:58 2016 Apr 02 03:00:51 CedricBeust are you reading anything good ? Apr 02 03:03:02 * g00s reading "Small Data; Tiny clues that uncover huge trends" Apr 02 03:15:35 http://imgur.com/ZsWVE3q struggling with accentcolor now... green or blue or none? Apr 02 03:18:59 * jug6ernaut likes the green Apr 02 03:19:05 * jug6ernaut likes green tho Apr 02 03:19:07 so Apr 02 03:24:38 thx jug6ernaut, well i asked somewhere else too, none said blue atm Apr 02 03:39:26 yeah i think blue on grey is harder to read Apr 02 04:40:41 wow, Toshiba major recall (battery) Apr 02 04:40:59 40 models over 2011-2016 Apr 02 04:45:02 Which is the best channel to discuss building kernels? Apr 02 05:24:41 westj: either here or android-root. for actually developing them probably here.. Apr 02 06:27:52 @teasp00n, they told me in #android-root that no-one knows in that channel... Apr 02 06:28:14 GUess it's back to guesswork and voodoo Apr 02 08:23:12 So I built launcher3 about a week ago (haven't been able to play with it too much since) and I noticed that for some reason when i power off my phone and back on, my desktop icons reverts to the default Apr 02 08:23:24 all my shortcuts disappear Apr 02 08:23:31 anyone have any idea about what could be causing this? Apr 02 08:38:39 this is a job for... #android (or #android-root) Apr 02 08:56:29 ah ok thanks Apr 02 10:28:34 hi, why i am getting null object from: Apr 02 10:28:48 EditText e= (EditText) myStolenBikesFragmentAdapter.getItem(vp.getCurrentItem()).getView().findViewById(R.id.stolen_detail_bike_licence_plate_edit); Apr 02 10:28:55 anybody know ? Apr 02 10:29:16 everything should be ok Apr 02 10:29:27 but is not Apr 02 10:29:57 Attempt to invoke virtual method 'android.view.View android.support.v4.app.FragmentActivity.findViewById(int)' on a null object reference Apr 02 10:33:57 freelancerbob: you cant call getItem on a FragmentAdapter for a view pager.. you'll get back a new fragment Apr 02 10:34:22 freelancerbob: you need to get the fragment back using its magical tag name Apr 02 10:34:30 freelancerbob: then it'll have a view Apr 02 10:36:55 where i set tag? Apr 02 10:43:26 Napalm: how i can call fragment back using its magicaltag name ? Apr 02 10:47:14 freelancerbob: open your adapter in AS Apr 02 10:47:17 freelancerbob Apr 02 10:47:36 : then ctrl+click/cmd+click on the class you extend Apr 02 10:47:50 should be FragmentPagerAdapter or FragmentStatePagerAdapter Apr 02 10:47:51 right? Apr 02 10:48:00 which one you using? Apr 02 10:48:56 Napalm: FragmentStatePagerAdapter Apr 02 10:49:10 ok so your looking at the source code of FragmentStatePagerAdapter? Apr 02 10:49:11 Noobish question, I guess, but... If I'm using Android SDK Build-tools 23, do I need to have SDK platform 23 installed? Thanks in advance. Apr 02 10:49:27 Napalm: yes Apr 02 10:49:41 look at instantiateItem Apr 02 10:49:58 see how it constructs the fragment tag name and tries to locate the current one and reuse it Apr 02 10:50:02 well thats how you want to do it Apr 02 10:50:37 mFragmentManager.findFragmentByTag("android:switcher:" + viewPager.getId() + ":" + viewPager.getCurrentItem()); Apr 02 10:50:41 see? Apr 02 10:52:02 Colt: no you dont Apr 02 10:52:13 freelancerbob: ? Apr 02 10:53:01 i don't have there: mFragmentManager.findFragmentByTag("android:switcher:" + viewPager.getId() + ":" + viewPager.getCurrentItem()); Apr 02 10:54:06 omh Apr 02 10:54:07 omg Apr 02 10:55:01 are you using the FragmentStatePagerAdapter from the support library? look at the top of its source.. the package Apr 02 10:55:25 if so.. you'll want to do getSupportFragmentManager().findFragmentByTag("android:switcher:" + viewPager.getId() + ":" + viewPager.getCurrentItem()); if your in the Activity Apr 02 10:55:41 if not.. then just do getFragmentManager().findFragmentByTag("android:switcher:" + viewPager.getId() + ":" + viewPager.getCurrentItem()); Apr 02 10:55:49 and ofc, viewPager is your view pager Apr 02 10:56:45 let me try Apr 02 10:58:50 Napalm: Fragment f=getFragmentManager().findFragmentByTag("android:switcher:" + vp.getId() + ":" + vp.getCurrentItem()); EditText a= (EditText) f.getView().findViewWithTag(R.id.stolen_detail_bike_licence_plate_edit); Apr 02 10:58:56 i tried Apr 02 10:59:18 f.getView().findViewWithId(R.id.stolen_detail_bike_licence_plate_edit); Apr 02 10:59:20 not tag Apr 02 11:05:36 Napalm: still same java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.app.Fragment.getView()' on a null object reference Apr 02 11:05:55 yes because no fragment came back Apr 02 11:06:01 your using the wrong fragment manager Apr 02 11:06:03 as i said Apr 02 11:06:10 getSupportFragmentManager() Apr 02 11:07:07 i tried it Apr 02 11:07:18 when are you doing this? Apr 02 11:07:22 during onCreate? Apr 02 11:07:34 nope Apr 02 11:07:58 freelancerbob: well when? Apr 02 11:08:22 onOptionsItemSelected Apr 02 11:08:38 right and the fragment doesnt exist Apr 02 11:08:50 how many pages do you have in your viewpager? Apr 02 11:09:03 you might want to check this out for reference https://github.com/xxv/android-lifecycle Apr 02 11:09:28 Napalm: 4 Apr 02 11:10:12 freelancerbob: switch to a FragmentPagerAdapter instead of FragmentStatePagerAdapter Apr 02 11:10:44 then call viewPager.setOffscreenPageLimit(4); where you setup your views Apr 02 11:10:49 this will keep the fragments around Apr 02 11:11:33 yes i call Apr 02 11:11:51 but switch out the type of adapter you extend Apr 02 11:16:08 Napalm: fyi: i need to call getFragmentManager().findFragmentByTag in onOptionsItemSelected because i need check all filled edittexts in my currentitem in view pager Apr 02 11:16:58 i have next icon in my toolbar. If edittexts are not filled then you can't go next Apr 02 11:26:58 Napalm:it is working now. Excellent thanks Apr 02 11:27:36 Napalm: why it was not work with FragmenStatePagerAdapter ? Apr 02 11:28:05 freelancerbob: thats the whole point of State version.. it doesnt keep the fragments around. Apr 02 11:28:11 freelancerbob: think ebook reader Apr 02 11:28:19 you dont want 500+ pages around Apr 02 11:28:37 freelancerbob: so it just saves the state bundles for each fragment Apr 02 11:32:27 Napalm: thanks Apr 02 11:38:20 Hi, using GSON, how do I parse a datetime string field into long timestamp? Apr 02 11:40:57 astroduck: GsonBuilder has a function setDateTimeFormat Apr 02 11:41:13 same format used by SimpleDateFormat Apr 02 11:41:17 https://developer.android.com/reference/java/text/SimpleDateFormat.html Apr 02 11:41:32 astroduck: then just make your fields Date objects Apr 02 11:41:40 thats java.util.Date not sql Apr 02 11:42:55 Napalm: I know that, its already parsing it into Date object, but I want timestamp in long Apr 02 11:43:33 astroduck: Date object has that.. do getTime(); Apr 02 11:44:34 Napalm: so GSON can't directly save it as long in my model, I'll always have to do getTime()? Apr 02 11:45:37 astroduck: it can. if you write your own derserializer.. it uses the type to know how to parse it.. a long is a number.. your date string is not a number Apr 02 11:46:53 Napalm: can I specify a deserializer for a specific key, not a type? Apr 02 11:47:18 astroduck: did you read the instructions? https://github.com/google/gson/blob/master/UserGuide.md Apr 02 11:49:07 Hello, can is somebody able to help me out? Apr 02 11:50:21 astroduck: you could write a typeadapter that registers for long and then in the deserializer you check to see if the JsonElement passed in is a as string.. if it is.. then try a date decode.. else return getAsLong() Apr 02 11:50:43 ?? Apr 02 11:50:55 Jude999: dont ask to ask.. just ask.. and see Apr 02 11:51:06 Napalm: Ok, I'll try it Apr 02 11:51:28 Okay I use App Inventor, you might be able to answer my question though. Apr 02 11:51:47 See ---> https://groups.google.com/forum/#!category-topic/mitappinventortest/specific-programming-issue/upMDewqjpQA Apr 02 11:52:00 My latest question is on there. thx. Apr 02 11:55:27 So??? anybody able to help? Apr 02 11:57:14 Are you here to help othere CedricBeust ? Apr 02 11:57:34 Not just to help, to serve Apr 02 11:57:56 Okay, are you able to serve me. Apr 02 11:58:04 haha Apr 02 11:58:14 lol :) Apr 02 11:58:48 CedricBeust: Okay I use App Inventor, you might be able to answer my question though. Apr 02 11:58:48 See ---> https://groups.google.com/forum/#!category-topic/mitappinventortest/specific-programming-issue/upMDe... Apr 02 11:58:48 My latest question is on there. thx. Apr 02 11:59:19 Invalid link Apr 02 11:59:25 besides, I know nothing about App Inventor Apr 02 12:00:01 Try this https://groups.google.com/forum/#!category-topic/mitappinventortest/specific-programming-issue/upMDewqjpQA Apr 02 12:00:54 My latest question is at the bottom, it takes awhile for help on the forum and they do not have a irc chat :( CedricBeust Apr 02 12:03:47 Well, this is a android dev channel so you might know a bit! CedricBeust Apr 02 12:04:09 Like I said, I know nothing about App Inventor (had never heard of it actually) Apr 02 12:04:30 Oh. Apr 02 12:04:57 * Jude999 is said :( lol Apr 02 12:05:10 * Jude999 is SAD :( Apr 02 12:05:31 oh well, I understand. Apr 02 12:05:54 any other channels that might help? Apr 02 12:06:12 CedricBeust Apr 02 12:12:33 Okay CedricBeust, you don't have recommendations ? Apr 02 12:13:13 No Apr 02 12:13:54 Why use this environment for children Apr 02 12:14:33 K. Nobody on the #android chat is even responding. Apr 02 12:14:38 ktwo: ?? Apr 02 12:15:48 Yes was wondering about that, why use this App Inventor thing instead of straight Android development? Apr 02 12:16:47 App Inventor is easier then straight forward development. Apr 02 12:17:00 Obviously not... Apr 02 12:17:11 no?? Apr 02 12:17:32 Well you seem to be stuck on something extremely basic (that would be trivial in regular Android development) Apr 02 12:18:03 anyway... Apr 02 12:21:39 not worry.... thanks. bye. Apr 02 12:54:34 Hi, I copied over a android app project and compiled it Apr 02 12:55:27 It is called androvdr. It crashed on one of my phones so I tried to fix that. Apr 02 12:55:53 While the initial crash is fixed it now crashes on both phones at some specific action. Apr 02 12:56:03 code is here: https://github.com/ege1/androvdr Apr 02 12:56:24 what does the crash say Apr 02 12:56:50 and error message is: android.view.View android.widget.LinearLayout.findViewById(int)' on a null object reference Apr 02 12:57:58 the mView = (LinearLayout) mActivity.findViewById(R.id.epgsdata_main); returns null Apr 02 12:58:14 which may be the issue. Apr 02 12:58:40 But I do not have a clue as I'm not a developer... Apr 02 13:10:30 ege: Find the layout file (XML file) and make sure it contains a view with an id "epgsdata_main". Apr 02 13:12:14 CedricBeust: Thanks for your answer. It seams to be a "fragmented" view. Apr 02 13:12:51 And the LinearLayout part has android:id="@+id/epgsdata_main" Apr 02 13:13:40 It's a fragment, these are still in layout files. Apr 02 13:13:55 It also doesn't complain at compile time, just "in use" Apr 02 13:14:41 Yes, you are right. I found it, but it does at least contain that id; that's what you meant, right? Apr 02 13:22:42 Hello Apr 02 13:22:47 Anyone have any experience with google cloud here? Apr 02 13:23:21 is it a good solution for a simple web server to host php script files and so on? Apr 02 13:29:04 The strange thing is it must have worked before and I only changed acra debugger because it was still trying to use google docs Apr 02 13:35:57 Hi. I want to create something like this: http://imgur.com/tFpRGOI where you can scroll vertically down among the images. I'll be fetching the images from a server with Picasso. Can anyone recommend the best/easiest way of accomplishing this? I've been looking at GridView but it seems complicated and strange. Apr 02 13:54:01 anyone? Apr 02 14:54:20 Hello everyone, can i send a BroadCast receiver from a class to a fragment in android. I am fetching Adress and Location, I just want to display it in a textview once i get the Address Apr 02 14:56:08 yes, but wouldnt broadcastReceiver a bit overkill Apr 02 14:56:56 I am new into Android development Apr 02 14:57:47 I have a service that’s going to fetch the GPS coordinate and the Address.. I have lost track on the Fragment since i started the service Apr 02 14:58:15 Since i don’t have a reference to it, i don’t think i can use callback for it Apr 02 14:58:27 Is there a better way i can implement it?? Apr 02 14:58:54 ok you could use load broadcastreceiver to activity and activity would tell the fragment Apr 02 14:59:19 yes Apr 02 15:01:08 From what i have read about that.. I have to extend BroadCastReceiver and overide onReceive method… The problem is, It works if i startAction from Activity Apr 02 15:02:20 so? Apr 02 15:02:21 But i can’t figure out how to start the Broadcast from another class and receive it on Activity since Activity is already extending AppCompatActivity Apr 02 15:03:16 use anonymous class Apr 02 15:03:34 actually you could do that in fragment and use getContent().registerReceiver there Apr 02 15:04:42 ok Apr 02 15:04:54 ah getContext().. Apr 02 15:05:08 I have the service in my Manifest file Apr 02 15:05:12 as android:name=".service.FetchAddressIntentService" Apr 02 15:05:14 android:exported="false"/> Apr 02 15:05:14 Apr 02 15:06:10 I have a class AddressReceiver extends BroadcastReceiver Apr 02 15:06:27 and i Have the onReceive() in the class Apr 02 15:07:04 How do i put the onReceive in an Activty? Apr 02 15:07:40 umm Apr 02 15:07:45 you dont Apr 02 15:07:58 read on java anonymous class Apr 02 15:08:39 spykins: https://developer.android.com/reference/android/content/ContextWrapper.html#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter) Apr 02 15:08:56 remember to also unregister Apr 02 15:08:59 or bad things happen Apr 02 15:13:00 I will remember that Apr 02 15:13:08 Thanks for pointing that out… lol Apr 02 15:14:24 Napalm: THis link is talking about ContexWrapper Apr 02 15:14:39 same thing Apr 02 15:14:48 Activity extends a ContextWrapper Apr 02 15:15:04 I get Apr 02 15:15:33 but the problem is that i want to send a broadcast message from a class to a Fragment Apr 02 15:15:42 and? Apr 02 15:15:59 The fragment already extends Fragment…. so i can’t extend BoradcastReceiver Apr 02 15:16:03 omg Apr 02 15:16:05 seriously? Apr 02 15:16:08 Yes Apr 02 15:16:10 eeyup Apr 02 15:16:34 spykins: listen.. register your receiver in your Activity.. and then your Activity can call a function you make on your Fragment when it receives the broadcast Apr 02 15:17:30 Canvas is based in a Bitmap object, Texture objects are limited in size (lets say 2048x2048), how do you handle custome views that display content that's bigger than the Texture limitation ? Apr 02 15:18:28 viran: scale up? or software render (yuck!, especially for large images).. or use multiple textures. Apr 02 15:18:57 If I have a task that is currently running on UI thread, but I notice that it causes a slight blockage in the UI when it runs, does it make sense to make a nested Runnable class, and do the work in there, then call a callback in the activity from the runnable when done Apr 02 15:19:38 rendering, I though about not using a custom view at all and just create bitmaps in advance and put them all in a\ recycler view Apr 02 15:19:47 drose379: thats essentially AsyncTask? Apr 02 15:19:59 Hm pretty much Ashiren Apr 02 15:20:42 if it can be asynchrounous then go for it Apr 02 15:20:45 Ashiren: I chose to use Runnable instead of AsyncTask because it doesnt return anything Apr 02 15:21:09 viran: using a RecyclerView with your own layout is pretty much a custom view.. either way.. its moer work to display a simple image.. its your choice. Apr 02 15:21:23 It takes a Location object and parses it down into a postal code, then calls a method in the activity which uses the code Apr 02 15:21:33 I guess processing Location to postalCode takes a sec Apr 02 15:21:33 then use some executor and put Runnables there Apr 02 15:21:36 viran: is this a photo viewing app? what is the point to this image display? if its not epic'ly needed then i wouldnt bother Apr 02 15:21:55 What do you mean executer Ashiren Apr 02 15:21:55 viran: just max out your image to the max-tex size and then let ImageView scale up Apr 02 15:23:07 drose379: read on ExecutorService ie. ExecutorService.newCachedThreadPool() Apr 02 15:23:16 you put Runnables there and they run in background Apr 02 15:23:55 Napalm: it's basicly a TextView that displays math equations (with all the math symbols), so I just draw what I need on a bitmap and then draw it on the view's canvas. The issus is the content can easily become very long, going over the bitmap limit in width Apr 02 15:23:56 Ok, any reason it would be better then having a Runnable nested class in the Activity (if this is the only activity that will need to have the task done) Apr 02 15:23:58 drose379: hold up.. you call a method in the the result back to the Activity Apr 02 15:24:03 ugh Apr 02 15:24:11 Yes why Apr 02 15:24:14 drose379: hold up.. you call a method in the Activity after? Apr 02 15:24:26 and that does what with the postalCode? Apr 02 15:24:34 this sounds like your using the Geocoder Apr 02 15:24:38 I am Napalm Apr 02 15:24:48 Whats wrong w geocoder Apr 02 15:24:54 its not on every device Apr 02 15:25:10 Doesnt it come with the sdk Apr 02 15:25:16 you'll get the Service unavaliable error Apr 02 15:25:23 I get that on emulators Apr 02 15:25:38 Thats really it though, but I've only tried on a few devices I geuss Apr 02 15:25:41 i have seen several devices report with that issue Apr 02 15:25:49 Any other way to go from Location -> Postal code? Apr 02 15:25:55 places api Apr 02 15:26:07 if your already using Google Play Services then its a simple addition Apr 02 15:26:07 Blegh dont wanna connect to an API just for this Apr 02 15:26:18 drose379: thats what geocoder does Apr 02 15:26:19 lol Apr 02 15:26:21 Lol Apr 02 15:26:31 I didnt know that, Ok, ill look into it Apr 02 15:26:34 your device doesnt store all the postal codes for the entire world Apr 02 15:26:36 Thanks for the heads up though Apr 02 15:26:38 Rigfht Apr 02 15:26:45 not to mention all possible addresses Apr 02 15:26:57 thats why you defo do not want to do it on the UI thread Apr 02 15:27:01 But wait, what were you saying about calling a callback method in the activity from the runnable? Apr 02 15:27:12 yes Apr 02 15:27:22 if your doing that.. then whats the point of your runnable? Apr 02 15:27:29 use an AsyncTask.. Apr 02 15:27:32 Can I progammatically put a shortcut for an http website on the homescreen? Apr 02 15:27:35 or.. do what i do for geocoding Apr 02 15:27:40 use an intentservice and receiver Apr 02 15:27:49 its what the SDK suggests and works great Apr 02 15:27:50 All the same idea Napalm Apr 02 15:28:27 well no.. if you post a runnable off the ui thread.. your callback to the Activity is off the ui thread Apr 02 15:28:28 Oh, I guess I dont have to pass an instance of the activity into this runnable Apr 02 15:28:40 drose379: it does Apr 02 15:28:42 its implicit Apr 02 15:28:47 Its not a static class Apr 02 15:28:54 So I still have access to the activities methods Apr 02 15:29:12 drose379: all anonymous classes contain a reference to their parent class Apr 02 15:29:16 Yes Apr 02 15:29:21 Well, this is not anonymous Apr 02 15:29:25 Its nested Apr 02 15:29:31 ? Apr 02 15:29:36 yes, Apr 02 15:29:38 same deal Apr 02 15:29:41 Right Apr 02 15:29:46 Anyway, ok question Apr 02 15:29:50 but, thats my point.. now you have a leak Apr 02 15:29:55 How? Apr 02 15:30:16 your inner class references an Activity that poentially doesnt exist anymore Apr 02 15:30:31 So I _could_ have a leak Apr 02 15:30:52 yes... so two big scenarios that happen here Apr 02 15:31:50 What are they? Apr 02 15:32:01 1. you send off your Runnable to do some work and bad network-connection/slow-server means it takes say 30 seconds (more common than you think).. now the user switches away from your Activity.. like manually or get get a phone call Apr 02 15:32:31 2. your operation completes and now calls back to an Activity that has been finished. the object remains with references to all the resources (hence the leak) Apr 02 15:32:39 well these are steps Apr 02 15:33:07 3. now a. you crash because you try accessing things that dont exist Apr 02 15:33:32 Can't I? Apr 02 15:33:42 But wouldnt the nested Runnable class finish with the activity? Apr 02 15:33:45 Or no? Apr 02 15:33:47 no Apr 02 15:33:55 Ok, so EventBus would be great here Apr 02 15:33:56 its not related to the external running Apr 02 15:33:59 no Apr 02 15:34:09 Why Apr 02 15:34:16 EventBus is stupid Apr 02 15:34:18 lol Apr 02 15:34:24 Same as local broadcast manager Apr 02 15:34:36 yes and no Apr 02 15:34:39 it would work Apr 02 15:34:53 But...? Apr 02 15:35:10 but for operations that have essentially two-way communication are now not events Apr 02 15:35:22 What do you mean? Apr 02 15:35:51 well its no longer .. this event occured.. but now heres your result Apr 02 15:36:04 And you mean that is incorrect use of EventBus? Apr 02 15:36:05 ij Apr 02 15:36:09 yes Apr 02 15:36:10 ij? Apr 02 15:36:13 Oh Apr 02 15:36:16 ok, let me give you an example Apr 02 15:36:22 No I get it Apr 02 15:36:37 Would this qualify for LocalBroadcastManager then? Apr 02 15:36:41 1. you start Activity A and do a background operation.. and now wait for that to complete.. with no way to cancel it or refer to it. Apr 02 15:36:49 ok Apr 02 15:37:01 2. you now start Activity B and it has registered for the same callbacks as A. B receives the result for activity A Apr 02 15:37:06 RIght Apr 02 15:37:07 now you have to hold state in your events Apr 02 15:37:11 who sent what Apr 02 15:37:15 .. its no longer events Apr 02 15:37:20 I see Apr 02 15:37:26 Hmm Apr 02 15:37:38 What about passing a callback to the Runnable through the constructor Apr 02 15:37:55 Make a ZipCallback interface, activity implements, pass it to the Runnable Apr 02 15:37:58 https://developer.android.com/training/location/display-address.html Apr 02 15:38:00 did you read this? Apr 02 15:38:06 No I didnt Apr 02 15:38:12 it tells you how to do it Apr 02 15:38:22 Well this kind of goes for any async task Apr 02 15:38:32 So im trying to figure out how to do it the right way Apr 02 15:38:44 drose379: here's the examples src https://github.com/googlesamples/android-play-location/tree/master/LocationAddress/app/src/main/java/com/google/android/gms/location/sample/locationaddress Apr 02 15:38:54 this is how to do it Apr 02 15:38:56 Napalm: what if I passed a callback to the Runnable? Apr 02 15:39:04 ok Apr 02 15:39:05 And the activity closed Apr 02 15:39:11 then same deal Apr 02 15:39:13 The callback would be null Apr 02 15:39:16 the callback is the activity Apr 02 15:39:26 you would have to have a way to keep a reference to your background task Apr 02 15:39:31 and then null out the callback Apr 02 15:39:33 lol, somebody trying to beat the lolcycle :) Apr 02 15:39:38 yea Apr 02 15:39:44 lolcycle? Apr 02 15:39:47 lol Apr 02 15:39:52 only way to win, is to not play the game :D Apr 02 15:40:28 Napalm: ok so in the runnable, before using the callback I passed in, just check if its null first Apr 02 15:40:35 drose379 yes a malicious AI that stymies all efforts for simple code Apr 02 15:41:02 I think thatd work, checking if callback is null Apr 02 15:41:19 drose379: and provide a method to reset the runnable Apr 02 15:41:21 reset the callback Apr 02 15:41:22 * Apr 02 15:41:37 What do you mean, like in onResume I would need to give a new callback? Apr 02 15:41:57 Since its technically a new instance of the activity? Apr 02 15:42:40 drose379: https://github.com/slightfoot/android-asynctask-correctly/blob/master/AsyncTaskCorrectly/src/com/demondevelopers/asynctaskcorrectly/MainActivity.java Apr 02 15:42:46 i did that for someone else in the channel .. ages ago Apr 02 15:42:53 2013 Apr 02 15:42:56 Thank you I will read Apr 02 15:42:57 fuck me Apr 02 15:43:02 im old Apr 02 15:43:02 But was what I said correct? Apr 02 15:43:29 read the codes Apr 02 15:43:32 Ok ok Apr 02 15:43:34 Thanks again Apr 02 15:43:36 Been great Apr 02 15:43:38 it applies the same to a Runnable Apr 02 15:43:44 Coool Apr 02 15:43:46 Thanks Apr 02 15:43:51 ps. its old Apr 02 15:43:57 getLastNonConfigurationInstance is no longer supported Apr 02 15:43:59 Napalm those brackets tho :| Apr 02 15:44:31 jug6ernaut: functions always start with brackets on next line... easier to see a function vs. logic Apr 02 15:44:38 got that from C/C++ but meh Apr 02 15:44:50 They make us do that at school Apr 02 15:45:24 drose379 better than GNU style https://en.wikipedia.org/wiki/Indent_style#GNU_style Apr 02 15:45:35 drose379: if your using AppCompat.. then use getLastCustomNonConfigurationInstance and onRetainCustomNonConfigurationInstance instead Apr 02 15:45:46 Ok, thanks Apr 02 15:45:59 BTW do you guys ever use Binary search trees? Apr 02 15:46:01 drose379: its because the support library uses getLastNonConfigurationInstance to hold the fragment manager and loader manager Apr 02 15:46:08 and your custom object Apr 02 15:47:10 man idk what Jack was doing, just killed java process using 18GB's fram... Apr 02 15:47:13 ram* Apr 02 15:47:41 jug6ernaut: i know your problem Apr 02 15:47:59 Hello @Napalm I want to try LocalBroadcastManager Apr 02 15:48:02 * jug6ernaut waits for it Apr 02 15:48:18 Napalm: Have you used LocalBroadcastManager before? Apr 02 15:48:19 jug6ernaut: do you have a gradle.properties in your ~/.gradle? if so does it have org.gradle.jvmargs Apr 02 15:48:31 hmm Apr 02 15:48:34 let me check Apr 02 15:48:35 spykins: read the docs.. it has plenty of examples Apr 02 15:48:47 Ok Apr 02 15:48:54 Thanks Apr 02 15:49:15 Napalm only has a property enabling the daemon Apr 02 15:49:32 ah Apr 02 15:49:40 you can set your jvm args for memory Apr 02 15:50:05 jug6ernaut: i seem to remember what your talking about mentioned in the Android Dev Summit 2015 videos on the tools Apr 02 15:50:31 i'm kinda nervous about j/j, will keep using the oracle stuff for time being ;) Apr 02 15:50:41 jug6ernaut: check them out. https://www.youtube.com/playlist?list=PLWz5rJ2EKKc_Tt7q77qwyKRgytF1RzRx8 Apr 02 15:50:47 g00s y Apr 02 15:50:49 at least given all our tools, javac isn't broken :P Apr 02 15:51:00 the only thing that works :D Apr 02 15:51:49 if the quality of j/j ~= gradle plugin, AS we're fucked Apr 02 15:52:31 i will admin i am kinda suprised that 2.0 went rc Apr 02 15:53:46 i do welcome j/j how ever. If anything just to eliminate the years of dexing time for libaries Apr 02 15:54:09 jug6ernaut so far the benchmark is 2x slower than oracle Apr 02 15:54:23 i guess they have some tuning to do Apr 02 15:54:43 do you find it to work faster ? Apr 02 15:55:13 i'd have to image by now javac is very mature and optimized Apr 02 15:55:14 i havent used it extensively, all of my projects of any real size require annotation processors Apr 02 15:55:18 so no j/j Apr 02 15:55:21 ah Apr 02 15:56:05 & yeah it is, as such for our current process the javac porton of the process is extremely small Apr 02 15:56:10 its almost all in the dex Apr 02 15:58:25 i really wish that jack did lambda inlining though, just dumping in anonymous inner functions makes sense...but still disappointing Apr 02 15:58:53 Napalm ive seen most of them i think Apr 02 15:59:09 jug6ernaut does it do inlining for N also ? Apr 02 15:59:27 i mean, does it do inlining for N, maybe not for previous for backward compat Apr 02 15:59:34 for n it compiles to true lambda's, so inlining isnt necessary afaik Apr 02 16:00:08 that sounds like one good reason to use kotlin, if you use lots of lambdas Apr 02 16:00:40 yeah :\ Apr 02 16:00:46 g00s: https://developer.android.com/preview/j8-jack.html Apr 02 16:01:17 jug6ernaut: says "The Android N bases its implementation of lambda expressions on anonymous classes. " Apr 02 16:01:28 so its backwards compat Apr 02 16:01:34 I tried using a callback and Im getting cyclic inheritance.. Apr 02 16:02:02 drose379: you static perhaps? Apr 02 16:02:05 you need Apr 02 16:02:18 I tried making the nested class static and no didnt change Apr 02 16:02:20 Napalm i knew it did that for < 23, but it sounds like it does it for 23+? Apr 02 16:03:00 jug6ernaut: it'll be for 23+ also Apr 02 16:03:13 :\ Apr 02 16:03:44 jug6ernaut: i mean.. i think "true" lambda's as in whats in Java 8 are done with anon classes anyway.. same byte-code.. all that "we want backwards compat and on all platform" stuff Apr 02 16:04:27 This makes no sense Apr 02 16:04:35 No idea why its cyclic inheritance Apr 02 16:04:49 drose379: see my PM Apr 02 16:17:14 funny that my old android phone supports native phone recording while my nexus 5 don't Apr 02 16:37:58 "native phone recording"? Apr 02 16:43:39 Mavrik: http://www.droidviews.com/enable-native-call-recording-galaxy-s5-note-3-note-4/ Apr 02 16:48:48 Trying to have two imageviews filling the screen width equally in a linearlayout: http://pastebin.com/4wk11unv Not sure how to handle the layout_width of the images to achieve this? The idea is to have 2 images on each row in the scrollView with a small margin in between them. Apr 02 16:51:29 Bernzel_: on each imageview use layout_weight = 1 Apr 02 16:51:33 and set width on each to 0dp Apr 02 16:58:30 perfect, thanks orbyt_ Apr 02 17:05:56 we're doomed http://digg.com/video/drone-chainsaw-wtf Apr 02 17:06:08 i am getting null here: Location location = locationManager.getLastKnownLocation(provider); Apr 02 17:06:29 from code here Apr 02 17:06:30 http://www.vogella.com/tutorials/AndroidLocationAPI/article.html Apr 02 17:11:27 freelancerbob, and? Apr 02 17:27:48 orbyt_: you experienced with Picasso ? I need to download and attach 12 different images from backend into my scrollview. Is there some compact method for downloading all 12 images at once? Or should I just make 12 different instances of .load etc? Apr 02 17:33:17 Bernzel_: is there a reason you want to download all the images at once? Apr 02 17:33:41 Bernzel_: as in, display them all at once? or is this purely a performance thing Apr 02 17:33:47 Napalm: well, the images are appearing in a gallery. So I would like them to be loaded and visible as quickly as possible. Apr 02 17:34:24 Bernzel_: then just call .load().into(imageView) as each image comes in it will be displayed Apr 02 17:34:50 Copy that Napalm Apr 02 17:35:11 Bernzel_: why arent you using a recyclerview Apr 02 17:35:14 Bernzel_: you probably want to add .centerCrop().fit() so as to not waste memory Apr 02 17:35:27 orbyt_: he probably is? Apr 02 17:35:33 no hes using a scrollview Apr 02 17:35:44 orbyt_: I'm still novice. I don't even know what a RecyclerView is. Apr 02 17:36:26 I copied an abandonded project and tried to compile/use it. I managed to migrate the project from eclipse to android studio and compile it. But at one point the app crashes. Apr 02 17:36:50 I debugged it down to this Apr 02 17:37:01 mView = (LinearLayout) mActivity.findViewById(R.id.epgsdata_main); returns Apr 02 17:37:22 After this mView equals null Apr 02 17:37:57 And the call of the view leads to a crash later on Apr 02 17:38:19 I don't have a clue how to find the route cause of this. Apr 02 17:39:02 ege: post your code where .findViewById() is called Apr 02 17:39:06 as well as your layout Apr 02 17:39:44 Code is here: https://github.com/ege1/androvdr or shall I paste parts of it into channel? Apr 02 17:39:50 Files are: Apr 02 17:39:53 ege: its simple, the view doesnt exist at the time when you called findViewById. which means you have not inflated/added your view Apr 02 17:40:05 ege Apr 02 17:40:06 no Apr 02 17:40:07 dont paste Apr 02 17:40:14 use hastebin.com or something Apr 02 17:40:19 www.hastebin.com Apr 02 17:41:47 Napalm: Thats what my search also suggested. But for me it looks like it is. Apr 02 17:42:44 i see your problenm Apr 02 17:42:58 ege: https://github.com/ege1/androvdr/blob/master/app/src/main/java/de/androvdr/fragments/EpgsdataFragment.java Apr 02 17:43:18 move everything in onActivityCreated to onViewCreated Apr 02 17:43:30 Ah, you are faster than me, was about to paste exactly that link Apr 02 17:43:52 be sure to call the super onViewCreated Apr 02 17:44:04 all your fragments should be like that Apr 02 17:44:21 code that plays with the view should come after onCreateView Apr 02 17:44:26 see https://github.com/xxv/android-lifecycle Apr 02 17:44:46 OK, let me see if I get that. Apr 02 17:44:53 ege: also, replace your mActivity.findViewById with view.findViewById Apr 02 17:45:02 view is a parameter to onViewCreated Apr 02 17:48:24 OK, what do you mean by "move everything in onActivityCreated to onViewCreated" Apr 02 17:48:40 So I rename onActivityCreated to onvViewCreated? Apr 02 17:49:01 Napalm: Or where can I find the onViewCreated? Apr 02 17:49:22 override it Apr 02 17:49:27 its part of Fragment Apr 02 17:50:26 ege: if your using Android studio just start typing it.. onViewCre and it should auto complete Apr 02 17:50:44 ege: https://developer.android.com/reference/android/support/v4/app/Fragment.html#onViewCreated(android.view.View, android.os.Bundle) Apr 02 17:51:34 hello guys, I would like to wrap one of my android applications(of which I don't have the source code) with a `tool` that checks that if another application is running then it will continue running, otherwise it will exit; what should I look into? Apr 02 17:52:04 Napalm: OK, the shif-shift thing. I'm working the first time with adnroid studio though. Thanks Apr 02 17:55:23 Napalm: something like this perhaps? http://pastebin.com/5vXGRw1K Apr 02 17:55:56 WTF Apr 02 17:56:01 you cant be serious? Apr 02 17:57:15 Bernzel_: have you never heard of arrays? Apr 02 17:59:55 Bernzel_: hello? Apr 02 18:06:31 OK Napalm, I think now I got you. So the "public void onActivityCreated(Bundle savedInstanceState) {" Apr 02 18:07:11 stays the same, but the "super.onViewCreated(savedInstanceState);" needs to be changed, while I still have to figure out how... Apr 02 18:07:18 Is that right so far? Apr 02 18:08:22 Bernzel_: this is better, http://pastebin.com/M1ArqMT0 Apr 02 18:09:12 Bernzel_: it would be even better if your UserFileMapping class stored its urls in an array. then all of that creating url arrays is not needed. Apr 02 18:09:30 erm? Apr 02 18:09:34 ege: no Apr 02 18:10:04 :( Apr 02 18:12:39 ege: http://pastebin.com/et4ML3ft Apr 02 18:13:02 lines 57,58 and 69 have changed Apr 02 18:16:00 Hi good folx.I have one issue.My company is developing an app that has following flow : When user first opens the app, it communicates with SDK (that other company wrote for us, that we can change on request) to verify this use with one piece of information (let's say it's phone number). SDK then communicates with "Server 1" to get the response if user is allowed to proceed.. If the response Apr 02 18:16:00 is success, app will allow user to use its all features and options and continue communication with "Main server" without any authentication check (because it counts that user is authenticated by SDK communicating with Server 1)..**So the main problem is:** What if "hacker" decompiled this app (reverse engineered it) and altered the code and made flow not to communicate with SDK and to Apr 02 18:16:00 allow user to proceed and use the app and communicate with main server ? I thought of all well known solutions for me (im fullstack dev, not android dev) like secured token that is send on first time when app is communicating with sdk (and then with server1) but all this falls down if hacker can completly avoid communication with skd.. Any thoughts or advices ? Apr 02 18:16:08 OK, Napalm, at least the line 69 I managed to do myself ;-) Apr 02 18:16:10 holy fuck is my thouhts Apr 02 18:16:15 thoughts Apr 02 18:16:16 Thanks! Apr 02 18:17:18 Laynee my thought is that you indeed have an issue Apr 02 18:17:44 there's essentially no authentication, and as a result, there's no authentication (...) Apr 02 18:18:10 well the purpose of skd and first server is to authenticate Apr 02 18:18:16 and hacker can avoid this Apr 02 18:18:23 then it doesn't authenticate Apr 02 18:19:08 so there is no way to prevent hacker to avoid communicating with sdk? Apr 02 18:19:13 Laynee: you have two options Apr 02 18:19:53 1. alter the sdk to use a token. like JWT or oAuth and then send that to the 3rd party server for them to use to authenticate to yours. Apr 02 18:20:09 2. proxy all app data traffic through your server Apr 02 18:20:14 over HTTPS :| Apr 02 18:20:24 you control the front-door then Apr 02 18:20:35 hey Chainfire, long time no speak Apr 02 18:20:57 ok wait one second.. if hacker decompiles app can he avoid all the communication and just procceed forward ? Apr 02 18:21:09 Laynee as I understand what you wrote, you are asking "server 1" if this user is OK, then the APP acknowledges this, and "server main" then gives up all it's data Apr 02 18:21:30 ye Apr 02 18:21:34 in other words, server main is completely unprotected, and trusts random socket input Apr 02 18:21:49 don't trust input Apr 02 18:22:08 never trust input lol Apr 02 18:22:18 Napalm: can you explain "alter the sdk to use a token" Apr 02 18:22:19 lol Apr 02 18:22:31 if hacker can avoid communicating with sdk at all, what is use of that Apr 02 18:22:34 Napalm aye its been a while Apr 02 18:22:42 Laynee we don't know what your app does Apr 02 18:23:04 Laynee: yes.. the sdk-provider, should give you a token.. and then the "main server" can verify that token over SSL with the sdk-provider; Apr 02 18:23:06 but hacker doesn't even need to use your app at all, from what I'm hearing. he could just tap into your server and get whatever he wnats ? Apr 02 18:23:16 omg. i just ended by sentance with ; Apr 02 18:23:19 too much code Apr 02 18:23:32 *sentence Apr 02 18:24:35 Laynee: got me? Apr 02 18:24:38 ok i got it all.. Apr 02 18:24:54 its bit confusing because im not developing an app im just arguing with one of the android devs Apr 02 18:25:00 of how we can solve this :) Apr 02 18:25:08 Laynee this isnt about developing an app Apr 02 18:25:13 and im not even responsible for server1 or main server, Apr 02 18:25:24 i know it is idiotic to provide data without any trust or promise Apr 02 18:26:02 i know all about anti csrf tokens Apr 02 18:26:14 ive developed that flows like thousand of times in my career Apr 02 18:26:28 and i told them to implement something similar Apr 02 18:26:39 hmm, attempting to unlink /dev/null reboots a galaxy nexus Apr 02 18:26:53 Napalm when you said token, you ment on something like anti csrf ? Apr 02 18:26:59 yes Apr 02 18:27:09 u still have a galaxy nexus lying around lol Apr 02 18:27:13 JWT is a known spec Apr 02 18:27:51 ye i knew.. thats the first thing that came on my mind also... but they are claiming (the android devs) that it cant help Apr 02 18:28:03 becuase hacker can cut the communication with sdk and continue on Apr 02 18:28:05 ok Laynee Apr 02 18:28:10 i can tell you what they are hooked up on Apr 02 18:28:19 two things Apr 02 18:29:15 sec Apr 02 18:29:19 perhaps 1 Apr 02 18:29:20 lol Apr 02 18:29:52 if you are unable to protect client side, usually you move part of it on the server side, problem is if you do not have always access to server Apr 02 18:30:10 anyways, just thinking you could also use the app signing key as part of the authentication.. since if someone decompiled and altered it.. they couldnt recompile it with the same key Apr 02 18:30:10 auth, sign, verify, crypt and decrypt everything Apr 02 18:30:35 adq always assume the client is compromised Apr 02 18:30:37 they could hook in memory then Napalm Apr 02 18:30:37 ok and how to benefit of app signing key ? to send it with each request to "main server" Apr 02 18:31:04 adq: yea.. true.. i was just discounting it. Apr 02 18:31:06 imagine this ... you know Viber .. imagine you have viber app that is communicating with its main server.. you dont have authentication in viber, you just confirm that your phone number is the one you provide and you receive sms back and authenticate.. then after that, no auth is needed... imagine that you decompile viber app and cut off sending sms stuff (that represents SDK in my case) Apr 02 18:31:06 and just proceed on (im not saying you can do this with viber, im just trying to visualize things for you).. Apr 02 18:32:27 Laynee: and that explain why both the sms-sdk provider and the main-server are both at fault Apr 02 18:32:30 well Apr 02 18:32:44 depends on what the sms provider does .. Apr 02 18:32:47 but anyway Apr 02 18:33:04 the main-server should have at least some authentication token Apr 02 18:33:16 even if its just one you get for the api Apr 02 18:33:20 to identify its clients Apr 02 18:33:35 otherwise you'll have no way to block specific clients Apr 02 18:33:49 (most mobile connections get proxied) Apr 02 18:52:19 it's a bit difficult to find out what commands is gradlew actually doing, isn't it? Apr 02 18:53:06 no, it prints them all out lol Apr 02 18:53:43 I can't see what the command is to produce the apk, though Apr 02 18:55:16 my build spits commands until some target where all the jars are packed together, and then passes through some targets apparently doing nothing, but where the apk should be made Apr 02 19:03:53 Hi Apr 02 19:04:54 I want to develop an app that reads the meetings from the outlook calendar of a meeting room and display on a mobile device. Is it possible with android or do I need to use a windows device? Apr 02 19:05:40 rudolf_: where is the outlook calendar of the meeting room stored? Apr 02 19:05:48 rudolf_: i assume on an exchange server? Apr 02 19:05:55 yeah Apr 02 19:06:19 And we can all see its calendar Apr 02 19:06:41 I mean from the internal network. Apr 02 19:06:54 rudolf_: https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations Apr 02 19:06:57 in short.. yes Apr 02 19:07:42 So these can be used with android also. Apr 02 19:07:49 with anything Apr 02 19:08:09 All right..I will go through it. Apr 02 19:08:31 Napalm: Will it be easier to do this on a windows mobile or will it take the same effort? Apr 02 19:08:37 same Apr 02 19:09:01 although i dont see why you need a custom app? Apr 02 19:09:09 doesnt outlook app show you the calendar? Apr 02 19:10:45 rudolf_: https://play.google.com/store/apps/details?id=com.microsoft.office.outlook Apr 02 19:10:49 Napalm: It does but doing this has some advantages in my office. For example many times it happens that people book a room but don't go in it. Or sometimes we need a room for just 5 minutes. Apr 02 19:11:08 In that case, I can add some custom options in the app and make it slightly better Apr 02 19:11:15 that sounds like the beeb Apr 02 19:11:16 lol Apr 02 19:11:38 Hehe Apr 02 19:12:39 Napalm: You won't believe there is a company based on this stuff. They have a device which does all this. Apr 02 19:13:30 rudolf_: yea i know. beeb got them installed whilst I was working there.. touch screen tablets on posts next to each meeting room door Apr 02 19:14:12 Yea...it is evoko room manager. Apr 02 19:15:20 They provide nice custom options. It will be cool if I develop something like that. My HR will be happy :P Apr 02 19:20:54 hi! Apr 02 19:21:50 happy Caturday Apr 02 19:23:40 Napalm still happy with the android binding library ? Apr 02 19:23:45 was going to give it a try Apr 02 19:24:30 yes really happy Apr 02 19:24:44 one of its best features is it updates the views always on the UI thread Apr 02 19:24:58 saves a lot of hassle Apr 02 19:25:11 does it slow down builds at all ? Apr 02 19:25:16 nope Apr 02 19:25:21 ok cool Apr 02 19:25:23 what lib^ Apr 02 19:25:34 orbyt_: https://developer.android.com/tools/data-binding/guide.html Apr 02 19:26:15 Can anyone help me with an issue on android? I have this system error on W/System.err: Caused by: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. Apr 02 19:26:15 I have the complete list here: http://hastebin.com/icatarumun.avrasm Apr 02 19:26:18 oh though you were talking about a third part lib Apr 02 19:26:22 thought* Apr 02 19:26:43 party* ffs my spelling Apr 02 19:27:43 cyberspace009: the device does not contain the public CA cert to authenticate against Apr 02 19:27:51 Napalm i saw this the other day http://stfalcon.com/en/blog/post/faster-android-apps-with-databinding Apr 02 19:27:57 but you probably know all of it Apr 02 19:27:58 cyberspace009: save the CA cert for the url and pin it in the app Apr 02 19:28:56 Napalm: ok, I'll look into that. I have the cert saved in res/raw folder but I guess that is not how it is done? Apr 02 19:29:55 cyberspace009: https://square.github.io/okhttp/2.x/okhttp/com/squareup/okhttp/CertificatePinner.html Apr 02 19:30:54 cyberspace009: actually perhaps it wasnt cert pinning i was thinking of.... anyhow.. read this https://github.com/square/okhttp/wiki/HTTPS Apr 02 19:31:12 https://github.com/square/okhttp/blob/master/samples/guide/src/main/java/okhttp3/recipes/CustomTrust.java Apr 02 19:31:13 thats the one Apr 02 19:32:03 g00s: looks like the article covers the big points Apr 02 19:34:07 hello guys :)... I got a problem - I am assigning a custom ArrayAdapter to a ListView. Inside getView I am creating an inflatedView by using LayoutInflater.from(context).inflate(R.id.listitem_row, parent, false). Everything shows up as expected. But how do I add onItemClick to the ListView? Apr 02 19:35:02 I already tried listView.setOnItemClickListener and implemented onItemClick, but the Log.d-message inside that one never shows up Apr 02 19:35:03 Napalm: thanks! I'll look into this Apr 02 19:36:04 divStar: your listitem_row probably contains a focusable view like EditText Apr 02 19:36:29 divStar: i suggest you simply use a RecyclerView.. much nicer and simple Apr 02 19:39:15 http://pastebin.com/uL4SUtY4 Apr 02 19:39:22 ah - hm.. maybe Apr 02 19:49:26 anyone that is developing android apps with python? Apr 02 19:49:43 Alina-malina: are you insane? Apr 02 19:49:49 O_O Apr 02 19:49:54 * Napalm sorry, but someone had to say it Apr 02 19:49:56 Napalm, what? Apr 02 19:50:17 what is wrong with what i said? Apr 02 19:50:59 apparently it's possible, Napalm ( https://ep2013.europython.eu/conference/talks/developing-android-apps-completely-in-python ) Apr 02 19:51:17 divStar: yea, its probably your RatingBar.. try removing it from the layout temporarily.. if the item rows are clickable then.. theres a fix for it Apr 02 19:51:36 no - I went RecyclerView now, Napalm - thanks for the pointer Apr 02 19:52:00 yw Apr 02 19:52:02 not entirely sure how it'll all play nicely together, but I bet it will somehow :) Apr 02 19:56:15 it may be possible to eek out some contraption in Python Apr 02 19:57:18 but not a good fit Apr 02 19:59:53 Any idea why will a company disable quick charge in its device when it is supported by the chipset/processor? Apr 02 20:00:08 yea, they are dicks Apr 02 20:00:24 also, probably some battery issues with heat whilst charging Apr 02 20:00:25 rudolf_ just a guess, the engineers may have decided device would overheat Apr 02 20:00:28 SD650 supports quick charge 3.0 but still it is disabled by Xiaomi in note 3 Apr 02 20:00:31 Hm Apr 02 20:01:01 Toshiba just had a huge ass recall of devices with melting batteries :) Apr 02 20:01:16 like 2011-2016 , 100k devices Apr 02 20:01:20 rudolf_: batterys have C ratings on their possible charge and discharge rates Apr 02 20:01:20 Overheating might be the reason. The stupid MIUI heats the mobile even when not on charging. Apr 02 20:02:06 rudolf_: i bet their "cheaper" battery doesnt support the charging rate, if you charge too quickly the battery can "explode"... catch fire Apr 02 20:02:14 That's interesting lol Apr 02 20:02:37 Napalm: The developers are ready to build custom kernels to enable quick charging 3.0 :D Apr 02 20:02:49 "the developrs"? Apr 02 20:02:54 lol, terrorists ? Apr 02 20:03:16 Lol Apr 02 20:03:47 and . that would be a great reason for voiding warranty if not left as stock ;) Apr 02 20:03:59 And I recently saw a kernel allowing upto 3000mA of current during charginf Apr 02 20:04:02 charging* Apr 02 20:04:21 g00s: The good thing is that Xiaomi does not void warranty on root. Apr 02 20:04:44 So people can come back to stock to claim warranty. Apr 02 20:04:57 rudolf_: i cant wait for this to happen in peoples pockets https://youtu.be/ixIOEPnsgbI?t=26s Apr 02 20:05:15 :| Apr 02 20:05:17 That sound lol Apr 02 20:05:39 but seriously, its bad news when a lithium fire happens aboard aircraft, probably everybody in the cabin is exposed to HF Apr 02 20:05:51 Napalm that was a Napalm :P Apr 02 20:05:58 since the air is recirculated Apr 02 20:06:29 g00s: But lithium batteries were not used in aeroplanes until recently, right? Apr 02 20:07:25 not sure who is using what now, i think boeing had some problems and elon had to give them a hand Apr 02 20:07:32 but, just from a passenger's phone or laptop Apr 02 20:07:55 Airbus is planning to use it...still pending certification I think Apr 02 20:07:58 i would't be surprised if sometime down the road everybody got cancer or something in such event Apr 02 20:12:32 New way of starting fire in an aircraft will be installing a custom kernel with no charging current check and charging the phone using a power bank lol Apr 02 20:13:39 Hi. I have a rooted Galaxy S4. I keep getting spam calls from one particular number. Is there a way I can have it be automatically answered and play some super obnoxious recording on loop to the caller? Are there any API or technical troubles with this? I know recording calls is a pain by itself. Apr 02 20:14:02 lol...tasker does not have anything for this? Apr 02 20:14:36 Btw why not simply block it? Apr 02 20:14:42 Not sure. Never used Tasker. I want to play a super annoying recording for them on repeat. Apr 02 20:14:55 Because this is more fun. Apr 02 20:15:56 Try tasker...I am not sure but it might have something...some call receive event. Apr 02 20:18:57 rudolf_, I'm guessing there isn't an action to play an audio file into a call on Tasker. Let me try to find some docs. Apr 02 20:19:52 I think we can play a media file in background when a particular caller calls. Apr 02 20:20:19 And I just saw that selective auto answer is there. Apr 02 20:22:49 rudolf_, I'd prefer to not have it play anything out of the speaker. I only want them to hear it when they call me. Apr 02 20:24:50 How do I read a file from the assets directory in a junit? Apr 02 20:25:15 I'm new to android and java in general so not quite sure how to do it. Stackoverflow results weren't helping either :/ Apr 02 20:25:52 LinnLonnn: Ah...that would be difficult. I don't know if it is possible at all. Apr 02 20:26:30 rudolf_, hmm. I'm happy with S4-only hacks. Apr 02 20:29:17 I might get a window phone just for its ability to record phone call natively Apr 02 20:45:45 hm weird.. I adjusted the ListView I had to a RecyclerView, but it still does not accept any clicks/touches... I don't really want to remove that rating bar :/ Apr 02 20:46:27 oh wait.. no setOnItemClickListener added lol... sorry .. false alarm I guess Apr 02 20:46:43 is it normal that for header text in navigation drawer, I get different text on preview in android studio and diff text on emulator? Apr 02 20:48:00 StephenS, doesn't sound too normal Apr 02 20:48:07 hmm, how to debug? Apr 02 20:48:13 StephenS, What's the difference in text? Apr 02 20:48:41 well on emulator, I get NavDrawer, which is the name of my main java class, and on preview in android-studio I get the normal name of my app Apr 02 20:48:59 bleh Apr 02 20:49:05 I just saw manifest file, its messed up therw Apr 02 20:49:10 dunno why though :P Apr 02 20:49:50 anyway, how can I edit background of navigation drawer, currently its all white :O Apr 02 20:50:26 android:background="#00CC66" Apr 02 20:50:32 ^ Apr 02 20:50:33 hey now its an aweful green Apr 02 20:51:46 but yeah, in your layout for the nav drawer, set the nav drawer's android:background="whatever_color_youd_like" Apr 02 20:58:14 how do you handle versioning? Apr 02 20:58:25 versionName/versionCode/revisionCode Apr 02 20:58:44 I want to go with a semantic versioning scheme Apr 02 20:59:24 versionCode/versionName/patch Apr 02 21:00:18 RustyShackleford, follow semantic versioning when you update your app Apr 02 21:00:39 RustyShackleford, in your manifest you can use android:versionCode and android:versionName to specify your version Apr 02 21:00:52 the code should increment, the name should follow semantic versioning Apr 02 21:00:59 yes I understand that Apr 02 21:01:04 oh the manifest part Apr 02 21:01:17 http://pastebin.com/iU90Dezk Apr 02 21:01:20 how do you pick versionCode? Just increment an integer? Apr 02 21:01:28 that's up to you. Apr 02 21:01:29 or maybe the date? 20160402 Apr 02 21:02:25 date's not terrible, but keep in mind that the versionCode is limited to values below 2147483647 Apr 02 21:02:48 so if you just increment each time you update, and rely on the string for what's actually happening, you might be better off Apr 02 21:03:55 although it would take...a lot of version changes to hit that value even if using the date Apr 02 21:05:35 at any rate, if you start out with 1 as your version code, you can keep a "count" of different versions Apr 02 21:05:47 which is mildly useful, or at the very least interesting Apr 02 21:06:36 so like version 1.4.12 could be versionCode=37 Apr 02 21:07:06 which helps you keep track in your head how many times you've changed your app enough to call it a new version Apr 02 21:09:00 RustyShackleford: just increment the versionCode and then custom write your versionName in your gradle to include all the finer details Apr 02 21:18:07 http://stackoverflow.com/questions/9357668/how-to-store-image-in-sqlite-database Apr 02 21:18:41 byte[] data = getBitmapAsByteArray(img); // this is a function ------- can someone explain this line to me, he says it's a function but shouldn't it be like class.functionname Apr 02 21:21:21 i'm working on a project for school where i decided to let the person use select an image from their camera phone directory, but i'm having trouble figuring out how to get the image into a database Apr 02 21:22:41 oh what a sec i see he has that method defined below lol Apr 02 21:33:54 Napalm: so wait, is there a gradle task that can handle this for me? Apr 02 21:34:11 increment 0.1.0 to 0.2.0 and it will handle versionCode for me? Apr 02 21:34:23 also, do you set revisionCode too? Apr 02 21:56:04 Does anybody here know where I can get / buy some good dynamic backgrounds for my app login page? Apr 02 21:56:30 Maybe a pattern, maybe a video background actually Apr 02 22:11:24 it is possible send info from fragment to activity atribute ? Apr 02 22:12:59 i have atribute in acivity, for example public String s; and i want call it from fragment getActivity.s="test" . It is possible ? Apr 02 22:13:35 freelancerbob no Apr 02 22:14:01 well, lol, you could do ((MyActivity)getActivity()).s="test" Apr 02 22:14:17 but thats pretty crappy, hope you don't do it :D Apr 02 22:17:11 why it's crappy ? Apr 02 22:18:03 what is better workaround ? Apr 02 22:29:49 " and i should ask this in android-dev..." Did Laynee ever get an answer? Apr 02 22:30:43 I'm curious about something. Some applications seem to prefer specific SU's. Apr 02 22:31:01 Same with stuff like BusyBox. Apr 02 22:31:18 I'm wondering what the main differences are between various SU providers. Apr 02 22:31:47 And do I need to worry about this when writing root apps? Apr 02 23:01:46 Hello all! I'm trying to figure out what the best way is to fetch some data from a few different endpoints in Android. Say I have three Activities, that each get their data from a different endpoint, should I use three AsyncTasks, or better use three IntentServices, or even a single Service or Thread? Thanks for any help :) Apr 02 23:03:42 does the data from the endpoints depend on each other in whatever way? Or could it be displayed entirely independent from each other? Apr 02 23:05:09 Independently. Say one is a list of announcements, and another is a list of users. Both would need to be stored in an sqlite database, and then update the appropriate view. Apr 02 23:05:46 well.. it also depends on how many requests you might have going on at the same time Apr 02 23:06:50 I for instance implemented some AsyncTask classes in order to download an image and read it into a Bitmap file , which I then display in a given WeakRefrence in onPostExecute Apr 02 23:07:18 It needs to do about one request per activity Apr 02 23:07:27 I feel like this is good for AsyncTask Apr 02 23:07:51 yeah.. from what I have heard and read, one should use AsynTask for such relatively short asynchroneous things Apr 02 23:08:04 Thanks :) Apr 02 23:08:16 asyntasks Apr 02 23:08:17 I've been Googling and searching SO, but opinions seem to be divided Apr 02 23:08:17 but if you had something that takes a longer time going on (e.g. encoding a video), I'd probably go for a real thread or possibly a threadpool Apr 02 23:08:18 * jug6ernaut shutters Apr 02 23:09:15 You might want to look into this, syndarion : http://developer.android.com/training/multiple-threads/run-code.html Apr 02 23:09:27 for if you decide to not use AsyncTask Apr 02 23:10:01 Would you say my situation isn't ok for AsyncTask? Apr 02 23:10:44 I would say it is, but I believe someone else might say it isn't, because AsyncTasks are a bit ugly in some regards and perhaps not as straight-forward as a Runnable Apr 02 23:11:06 I'll go with the AsyncTask for now, but I'll keep Runnable in mind Apr 02 23:11:15 if all u need to do is it 1 end point per activity Apr 02 23:11:20 asynctask should be fine Apr 02 23:11:41 cheers! *afks* Apr 02 23:11:44 but if u have to hit more, or do anything more complicated there are better but heavier options Apr 02 23:12:54 AsyncTask.onPostExecute(result) runs on the UI thread, which means it keeps a reference to the activity Apr 02 23:12:54 For now it's one endpoint per activity. What are the heavier options, in case I need to hit more in the future? Apr 02 23:13:13 so if the device is rotated during your fetch, the activity is leaked Apr 02 23:13:38 pgs, So you say don't use AsyncTask? Apr 02 23:13:45 ans you may be trying to display your result on an activity that is no longer displayed Apr 02 23:14:02 It would store the data in an sqlite db Apr 02 23:14:27 yeah, just use a thread Apr 02 23:14:36 A regular Thread? Apr 02 23:15:01 thread, runnable, intent service, ... Apr 02 23:15:18 does the UI need to be updated? Apr 02 23:16:13 Yes it does need updating. When the Activity starts, it should check with an endpoint to see if there's new data, and pull it in if there is, saving it to the DB. Then update the UI. Apr 02 23:17:09 pgs, got anything where I can read about context leaks Apr 02 23:17:24 and other common pitfalls Apr 02 23:17:31 leakcanary Apr 02 23:17:54 thanks jug6ernaut Apr 02 23:18:03 leakcanary is good Apr 02 23:18:47 And another question is, say I use an IntentService, should I create one per endpoint, or are there better ways? Apr 02 23:20:45 let me ask u this, if ur call is in progress and ur activity closes Apr 02 23:20:52 what would u want to happen Apr 02 23:21:09 I'd still like the DB to be updated Apr 02 23:22:30 IntentService with localbroadcast or EventBus would probably work well Apr 02 23:23:11 Thanks! :) Apr 02 23:23:43 And would it be okay to create one FetchService, and based on the parameter it gets, it does the right request? Apr 02 23:23:57 as someone above pointed out tho, just make sure you account for when your activity is closed. Dont try and update it after ondestroy/onpause etc have been called Apr 02 23:24:04 It'd be quite a long method Apr 02 23:24:19 i would probably make them separate Apr 02 23:24:26 Thought so Apr 02 23:25:15 hey, I have a valid JSON, I just validated it, however on JSONObject in java I get an exception, how come? Here is json: [{ "success": true, "msg": "Showing all info" )] Apr 02 23:25:47 StephenS, try JSONArray Apr 02 23:25:47 pastebin Apr 02 23:25:53 paresh, thanks :) Apr 02 23:26:54 StephenS, http://developer.android.com/reference/org/json/JSONArray.html#getJSONObject(int) Apr 02 23:26:55 :) Apr 02 23:27:48 at 0 of type org.json.JSONObject cannot be converted to boolean Apr 02 23:28:04 Value {"success":true,... Apr 02 23:28:06 ? :O Apr 02 23:29:30 hmm sec Apr 02 23:30:20 ok works now super cool :) Apr 02 23:31:59 Should I use Volley for http requests? Or just plain HttpURLConnection? Apr 02 23:32:56 retrofit Apr 02 23:33:02 yea Apr 02 23:33:53 paresh, yea to retrofit? Apr 02 23:33:59 syndarion, yes Apr 02 23:34:04 retrofit2.0 ;) Apr 02 23:34:04 Thanks Apr 02 23:34:32 I was using OkHTTP before using retrofit Apr 02 23:34:44 retrofit reduced plenty of lines for me Apr 02 23:35:30 syndarion, samples on retrofit github are really helpful Apr 02 23:35:31 ;) Apr 02 23:35:32 https://github.com/square/retrofit/tree/master/samples Apr 02 23:42:59 So I can use Retrofit to fetch data from an endpoint, and store it in the DB? Do I still need an IntentService? Apr 02 23:43:33 yes, your service will call retrofit Apr 02 23:44:41 how do you set versionCode and versionName? Apr 02 23:44:51 do you bother with revisionCode? Apr 02 23:48:47 syndarion & pgs ...what? You dont need an IntentService to make simple http requests lol. Apr 02 23:49:39 well, you'll get an exception for doing network access on the main UI thread Apr 02 23:50:10 Yes, but IntentServices are not how you make simple network requests off the main thread. Apr 02 23:50:35 one of many ways Apr 02 23:50:36 Retrofit comes with it own way to make async calls. Better yet, make Retrofit return an Observable and subscribe on an io thread Apr 02 23:50:45 yep Apr 02 23:51:23 orbyt_, and what if I was a beginner, who just needed to fetch some data and store it in a sqlite DB? :P Apr 02 23:51:35 what about it Apr 02 23:52:04 I'd say it sounds rather complicated, no? Apr 02 23:52:11 what does Apr 02 23:52:34 The Observable and IO thread Apr 02 23:52:41 Do you have an example of that, perhaps? Apr 02 23:52:45 its 2 lines of code Apr 02 23:52:47 lol Apr 02 23:52:55 what exactly are you trying to do Apr 02 23:54:21 When the Activity starts, fetch some data, that's it :p I was leaning towards an AsyncTask, and a HttpRequest (or whatever it's called in Java), but I was advised to use Retrofit Apr 02 23:54:41 everything you need: https://github.com/codepath/android_guides/wiki/Consuming-APIs-with-Retrofit Apr 02 23:55:15 Thanks :) Apr 03 00:03:13 hmm, so when I do AsyncTask in a different class, I call method doSync() in a different class, but from some reason I get access to nullpointer? :O Apr 03 00:18:32 what's the best websocket library for android? Apr 03 00:18:50 and by best I mean, most mature, stable, and compliant Apr 03 00:20:13 holy cow.. android STILL cannot properly display dashed lines without having to turn off hardware acceleration on the view at least? .. lol.. disappointing Apr 03 00:26:55 So I read somewhere that it's technically incorrect to modularize android app code into many different classes as you would in a standard java app. Is that true? Will the performance loss be drastic if I do anyway? Apr 03 00:35:41 recursor94: technically incorrect is way too strong Apr 03 00:36:13 recursor94: it's unlikely to matter, there are a few limits in terms of total number of methods Apr 03 00:36:23 recursor94: but performance-wise you should be fine Apr 03 00:37:50 it's not something you should worry about in advance in any case Apr 03 00:50:06 Okay thanks, I really appreciate that feedback. Apr 03 01:19:52 having trouble finding docs on the xml layout element Apr 03 01:20:12 has to be there somewhere. are there limitations to what can be assigned to ? Apr 03 01:37:28 there must be a way to get gradle to automatcially generate a versionCode that is yyyymmdd Apr 03 01:37:46 i could add time to that if I want Apr 03 01:55:55 easy peasy Apr 03 02:02:13 I would say that's generally not recommended Apr 03 02:29:55 This kind of thing totally invalidates incremental compilation Apr 03 02:34:30 not just that but repeatable. builds Apr 03 02:40:52 Is there a way I can create an appcompat activity in android studio from the menu instead of directly defining my own class from scratch? Apr 03 02:45:28 Oh, it seems that I don't have the support library installed. Apr 03 02:45:58 pretty sure the default wizard template is an appcompat activity anyway Apr 03 02:46:42 No it tells me I have to be using at least sdk version 15 to create a new activity Apr 03 02:47:19 Or maybe 8, I forget the exact number. Apr 03 02:49:50 return o -> o.map(d -> gson.fromJson(gson.toJson(d.getValue()),type)); Apr 03 02:49:56 * jug6ernaut feels bad Apr 03 02:51:40 No, you're right it does use the support library activity by default. But then why can I only create one with a minimum sdk of at least 7? I thought the point of the support library was to be backwards compatible with all older android OS versions. **** ENDING LOGGING AT Sun Apr 03 02:59:58 2016