**** BEGIN LOGGING AT Mon Jan 16 03:00:02 2017 Jan 16 05:15:33 anyone have experience with self-signed certs on android? I'm trying to get my dev environment set up working on the app with a self signed cert. App gets 403 and chrome browser on the android isn't working either Jan 16 05:15:52 I installed the cert from android security but it's not letting me trust it anywhere Jan 16 05:23:45 Does generating a signed APK take a _lot_ longer than building a debug apk? My debug builds usually take 10-20 seconds (simple app) Jan 16 05:23:56 generating a signed apk is going on 10+ minutes now Jan 16 05:38:36 Hi all. Can I use RetroLambda without Jack with latest Gradle and latest Android Studio? I'm having problems after upgrading and getting Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8. Jan 16 07:36:03 * raoul11 thepooshes thepoosh Jan 16 07:36:20 finally figured out that shitty deserializer thepoosh Jan 16 07:37:45 yay! Jan 16 07:37:50 what did you do? Jan 16 07:39:23 final DObject object = context.deserialize(jsonObject.get("token"), DObject.class) Jan 16 07:39:35 now im wondering whats the cost of deserialization Jan 16 07:39:43 and whether i should use InstanceCreator Jan 16 07:43:36 raoul11: now stuck with this question: http://stackoverflow.com/q/35798166/1056359 Jan 16 07:43:41 squ: any thoughts? Jan 16 07:45:52 you want a red asterisk? Jan 16 07:46:01 yessir Jan 16 07:46:15 not red specifically but an asterisk Jan 16 07:47:01 a fixed asterisk or with the hint? Jan 16 07:47:03 it only has password things Jan 16 07:47:09 might do it with that Jan 16 07:47:18 android.support.design:passwordToggleDrawable Jan 16 07:47:26 and set it to an asterisk Jan 16 07:48:03 or maybe draw directly on it Jan 16 07:48:25 because the design docs have it Jan 16 09:51:58 Is there some AS function to generate set/get InstanceStates? Jan 16 09:58:20 yea just command N while in the code Jan 16 09:58:39 oh, InstanceStates, don't know what you mean Jan 16 10:00:47 PresidentNotSure: you get that in the lifecycle events and can store the bundle or whatever state you want internally Jan 16 10:00:56 you store it in onSavedInstance Jan 16 10:01:29 and get it in both onCreate and onRestoreInstanceState Jan 16 10:03:01 butterknife/pocketknife eh? Jan 16 10:04:15 Ashiren: huh? Jan 16 10:04:22 butterpocket Jan 16 10:04:54 woot Jan 16 10:05:02 god damn alarms man Jan 16 10:05:22 why are they even being triggered if it isn't their time yet, because of the "if alarm is before then trigger immediately" thing? Jan 16 10:05:52 i hate alarmmanager Jan 16 10:15:45 anyone using java's new java.time? Jan 16 10:15:49 JSR 310? Jan 16 10:16:14 thepoosh, yeah, but it's tedious for me because I have a lot of stuff to save Jan 16 10:20:48 Odaym, yes. Jan 16 10:20:56 It's awesome and should be used everywhere. Jan 16 10:21:04 so you've turned to Java 8 now? Jan 16 10:21:10 instant run isn't supported Jan 16 10:21:14 no. Jan 16 10:21:19 There's a backport of the API. Jan 16 10:21:23 where? Jan 16 10:21:27 how can I use it now with 7 Jan 16 10:21:28 https://github.com/JakeWharton/ThreeTenABP Jan 16 10:21:33 of course.. Jan 16 10:22:47 kek Jan 16 10:23:02 PresidentNotSure: if it's tedious you are doing it wrong Jan 16 10:23:32 thepoosh, think Google's doing it wrong, not me Jan 16 10:23:54 ok... good luck with that Jan 16 10:24:25 tell me if I'm insane, please Jan 16 10:24:53 I set an alarm, and inside the receiver I have to check if the time is after current time so I know that it should be triggered? Jan 16 10:25:11 or so I know what to do with it when it's triggered? Jan 16 10:25:26 Alarm just schedules a piece of code to run Jan 16 10:25:39 "schedules" Jan 16 10:25:47 shouldn't this include knowing when to trigger? Jan 16 10:25:48 Somewhere around targeted time... so yes I guess you have to additionally check what to do when your code runs :) Jan 16 10:25:54 I'm checking for everything on its behalf Jan 16 10:31:51 ah the JodaTime guy made the 310 Jan 16 10:32:14 yeah, 310 is standardized JodaTime Jan 16 10:32:19 with a few fixes IIRC Jan 16 10:55:33 Is there a way to change CardView corner radius in whole app? Jan 16 10:59:13 maybe by style Jan 16 11:32:11 hi all Jan 16 11:32:18 http://stackoverflow.com/questions/23869037/app-inside-an-app Jan 16 11:32:38 I can see there the INJECT_EVENTS permission needs to have rooted device Jan 16 11:32:59 is there any alternative method for communicating with an app? Jan 16 11:33:09 my idea was with text file Jan 16 11:34:26 greyline, what do you mean Jan 16 11:34:49 to start an app from an app, and communicate between them with a text file Jan 16 11:35:40 Zharf: one of them reads, release the read (to avoid lock, so the other can write into the file), reads again, release the read, and so on Jan 16 11:35:57 Zharf: the other one tries to write to that file when it's not locked Jan 16 11:36:42 bad idea but you need to explain the use-case a little more for me to provide a better idea Jan 16 11:37:13 Zharf: if the last line is app1: task1, then the app1 does the task1 Jan 16 11:37:44 Zharf: if the last line is app2: task1, then app2 does the task1 (task1 is his own task) Jan 16 11:38:13 bad idea, but it could be solved the problem without rooting, I think Jan 16 11:38:21 what's the usecase for two apps commanding eachother? Jan 16 11:38:45 well, my boss wants to use an existing android app with Unity interface Jan 16 11:39:19 Zharf: and I need to discover what methods could be done for using the app inside the other Jan 16 11:39:45 Zharf: or near the other Jan 16 11:40:01 since you're thinking of doing IPC through textfiles, you're going to have to modify the original app too Jan 16 11:40:13 http://codetheory.in/android-interprocess-communication-ipc-messenger-remote-bound-services/ Jan 16 11:40:23 Zharf: I know, I didn't want to mean that Jan 16 11:40:43 if the original app doesn't support IPC then you can't do it Jan 16 11:41:13 Zharf: I mean he wants to use the original plans and schemes for creating this new app, and there're more Android Studio java developers than Unity developers Jan 16 11:41:15 in here Jan 16 11:41:51 Zharf: so he just want to use their experience on Java, but still, he wants 3D surface, and I'm the only one who knows how to do that Jan 16 11:41:56 Zharf: the 3D things Jan 16 11:43:22 just fork the original code and build on that then? Jan 16 11:43:50 using two apps communicating with eachother is way too complicated for users Jan 16 11:43:52 Zharf: there's no original code yet Jan 16 11:44:24 i got a listview with some custom items and an adapter. I set the items up in the adapter in getView(), where I also register a click handler to open up a detail activity (parent set to the activity containing the listview). When pressing back it does go back to the listview, if I selected one of the first items (about 4-5) but if I go further down the list a back button press opens the detail activity of the above listview item. Also a back Jan 16 11:44:24 arrow appears on the left side of the actionbar, if I press it the Listview's activity OnCreate() gets called, as if it was finished before Jan 16 11:44:41 Zharf: we want to use Unity and we want to develop the backend in Java Jan 16 11:44:58 in a single app though? Jan 16 11:45:10 Zharf: in a single app, if it is possible Jan 16 11:45:35 Zharf: but if not, with two different apps, used somehow in each other Jan 16 11:45:44 single app is way simpler Jan 16 11:46:02 Zharf: but they don't want to program everything in Unity Jan 16 11:46:16 just provide an interface they can call your code through Jan 16 11:46:17 Zharf: they want to use Android Studio, and do Java code Jan 16 11:46:37 Zharf: that's what I want to find out to how to do that Jan 16 11:46:39 I don't know how unity works on android but I'm sure there's a way to interface with the code Jan 16 11:46:46 but the way is *not* separate files Jan 16 11:47:22 http://jeanmeyblum.weebly.com/scripts--tutorials/communication-between-an-android-app-and-unity Jan 16 11:47:30 (didn't read through, but looked promising) Jan 16 11:47:32 something like that Jan 16 11:48:19 https://github.com/inbgche/Unity-Android-Communication Jan 16 11:56:32 TotallyNotKim, consider migrating to recyclerview... but I would like to see some code Jan 16 11:57:40 Zharf: just playing arround, so will try recyclerView later Jan 16 11:57:51 going to lunch now, will post code later, but thanks anyway :) Jan 16 11:57:56 ok Jan 16 12:05:16 Zharf: another idea was to use the Unity WebGL, or the Unity Web Player inside and android app Jan 16 12:05:16 Zharf: as a local webpage Jan 16 12:18:19 can i execute async task after every 10 secs? Jan 16 12:18:35 from the time it stops wait 10 seconds Jan 16 12:21:09 purplex88: use Handler#postDelayed(Runnable, msec) and start the async task in the Runnable Jan 16 12:21:24 purplex88: the Runnable itself is executed in the UI loo Jan 16 12:21:26 loop Jan 16 12:21:46 Im having some issues with recyclerview not being updated when switching fragment with ViewPager. Android seems to keep the old one in memory Jan 16 12:22:53 Two tabs - Contacts and Favorites. When going to the Favorites fragment and removing a favorite -> Then going back to contacts it wont update. Just loads the old data Jan 16 12:23:39 Melatonina: can a timer be used? Jan 16 12:24:03 purplex88: a timer it's basically the same, yes Jan 16 12:25:16 Sourcey: ViewPager attempts to re-use the same fragments, including the fragment that contains your recycler view, probably. It's up to you update the adapter with the new information. Jan 16 12:26:13 Melatonina: i want to kick start the timer as soon as the background is over and wait for 10 seconds Jan 16 12:27:04 squ: are you awake? Jan 16 12:27:05 then use postDelayed at the end of the AsyncTask Jan 16 12:27:06 I'm done Jan 16 12:27:13 hi thep Jan 16 12:27:17 Melatonina: hi hi Jan 16 12:27:17 http://imgur.com/a/NG6FM Jan 16 12:27:22 what do you think? Jan 16 12:27:31 so mTimer.schedule(mTimerTask, 0, 10000); won't work? Jan 16 12:29:43 echo %C Jan 16 12:30:28 and doesn't timer create a new thread? Jan 16 12:30:43 purplex88: decide if you want to use AsyncTask or TimerTask. There are examples on StackOverflow Jan 16 12:31:49 Melatonina: i am using AsyncTask and i want to start it after 10 secs but only after it ends Jan 16 12:32:07 purplex88: I told you what to do Jan 16 12:32:57 then use postDelayed at the end of the AsyncTask Jan 16 12:33:18 either one them: https://developer.android.com/reference/java/util/Timer.html or https://developer.android.com/reference/java/lang/Runnable.html ? Jan 16 12:33:33 use postDelayed at the end of the AsyncTask Jan 16 12:34:02 oh and it will just restart..? Jan 16 12:34:20 Do I have to write the code for you? Jan 16 12:34:22 after the delay Jan 16 12:35:00 If you schedule the start of the same AsyncTask after 10000 msec, yes, of course it will restart Jan 16 12:37:18 purplex88, be mindful of activity lifecycle with timers Jan 16 12:37:24 okay i thought i would need to call "new MyTask.execute()" after 10 secs Jan 16 12:37:56 you can create 1 task Jan 16 12:38:04 and re-execute() it Jan 16 12:38:18 thats good Jan 16 12:38:42 Sourcey, viewpager keeps (by default) two adjacent fragments alive for you Jan 16 12:38:54 Sourcey, so it won't update unless you tell it to update, through a signal for example Jan 16 12:39:21 Zharf: tell viewpager to update or the adapter? or the fragment? Jan 16 12:39:22 Sourcey, if your "update" code is in fragment resume right now that is Jan 16 12:40:58 Sourcey, whatever you use to set the data for the recyclerview adapter Jan 16 12:41:06 refresh it Jan 16 12:44:01 Sourcey: and notify the adapter Jan 16 12:44:57 Sourcey: ideally you should interact with the adapter and the notification should be encapsulated. That's what I do, at least Jan 16 12:48:37 Hmm, yes. Trying to figure it out. still kinda new and making an app way over my head Jan 16 12:50:39 Sourcey: there are many ways to do what you need Jan 16 12:52:29 Sourcey: some are more elegant and generic, some are more quick. If it's your first time, you may choose a quick-and-dirty option and review your code as you get accustomed to the framework Jan 16 12:53:46 Sourcey: what do the two fragments do/show? Jan 16 12:54:05 Sourcey, I find that something like eventbus would be the best way to do it because you can't really rely on the fragment being alive so you shouldn't interact with it directly Jan 16 12:54:51 best way for me would be a way to kill it completely. but i guess thats bad practice Jan 16 12:57:20 bah, finally finished with this part of the app i think, then this problem comes to backfire Jan 16 12:57:31 anyway, time for lunch Jan 16 12:59:20 * raoul11 thepooshes thepoosh Jan 16 12:59:45 raoul11: did you see the final layout? Jan 16 13:00:05 negative Jan 16 13:00:08 http://imgur.com/a/NG6FM Jan 16 13:00:12 was busy fappin most day Jan 16 13:00:27 ok.... Jan 16 13:00:30 this is... Jan 16 13:00:33 wierd Jan 16 13:00:46 naaaaaice Jan 16 13:01:01 who dat handsome pucker in the pic Jan 16 13:01:07 oh you.... Jan 16 13:02:11 had issues with retrofit today thepoosh Jan 16 13:02:33 what issues? Jan 16 13:02:36 it formatted my @Query string strangely Jan 16 13:02:50 Do I need storage permission to use DownloadManager? Jan 16 13:02:52 woot Jan 16 13:03:03 astroduck: probably not Jan 16 13:03:08 i was passin an array, the api said no. so i formatted the array to a string, and the api said no again Jan 16 13:03:09 but I'm not sure Jan 16 13:03:19 something to do with how retrofit formats , Jan 16 13:03:26 :S Jan 16 13:04:13 Time for an experiment! Jan 16 13:26:59 thepoosh: Jan 16 13:27:30 you may avoid linear layout to just split in half two elements Jan 16 13:29:31 how? Jan 16 13:29:56 squ: I thought so initally since TextInputLayout extends Linear Layout Jan 16 13:31:35 thepoosh: It looks like you do need permission, so weird... Jan 16 13:31:45 I can't even store to public dirs Jan 16 13:31:53 thepoosh: same trick works on ios too. Center element, another extend from left (or top) to the center, and another from right (or bottom) to center Jan 16 13:32:16 woot? Jan 16 13:34:33 in constraintlayout I guess? Jan 16 13:36:56 constraint is still in beta Jan 16 13:36:59 I cannot use it :( Jan 16 13:37:01 yeah Jan 16 13:37:10 it's not in android sdk manager so I can't use it Jan 16 13:40:55 thepoosh: got it? Jan 16 13:41:07 I didn't understand Jan 16 13:41:08 :S Jan 16 13:41:16 which part exactly Jan 16 13:42:24 15:31 squ: thepoosh: same trick works on ios too. Center element, another extend from left (or top) to the center, and another from right (or bottom) to center Jan 16 13:42:25 this Jan 16 13:42:26 :S Jan 16 13:42:53 I'll describe in query Jan 16 13:46:44 how to run a gif in background? Jan 16 13:47:03 sub_zero: run a gif in the background? Jan 16 13:47:06 as in play it? Jan 16 13:47:10 yes Jan 16 13:47:17 image.gif Jan 16 13:47:17 Glide has a GifImageView Jan 16 13:47:28 and some other libs have gif support for android Jan 16 13:47:34 it's not supported internally yet Jan 16 13:47:39 ok Jan 16 13:47:56 do you need to load it from network as well? Jan 16 13:48:32 i tried by splitting the gif into frames but the splitter i am using is creating frames format as .gif so its not working Jan 16 13:48:34 no Jan 16 13:48:43 only a single image Jan 16 13:48:53 hmmm Jan 16 13:48:58 I would just use that Jan 16 13:48:59 so i am trying to avoid use of other libs Jan 16 13:49:00 Glide Jan 16 13:49:05 ok thanks Jan 16 13:49:09 np Jan 16 13:49:25 android development is library spam Jan 16 13:49:55 thepoosh how can i get glide? Jan 16 13:50:34 from where* Jan 16 13:50:46 Zharf: have you ever done JS development? Node or web Jan 16 13:51:00 sub_zero: https://github.com/koral--/android-gif-drawable Jan 16 13:51:07 https://github.com/bumptech/glide Jan 16 13:51:32 even worse Jan 16 13:52:22 rubenwardy, luckily no Jan 16 13:52:31 but I'm familiar with the situation there Jan 16 13:52:40 I don't think using a bunch of libraries is bad though Jan 16 13:52:50 I like the android library economy Jan 16 13:53:29 thepoosh thanks :D Jan 16 13:55:03 Any ideas why when I'm trying to use auto-value-gson I get : "cannot resolve symbol GsonTypeAdapter" ? Jan 16 13:55:42 though every now and again I run into libraries like this thing that I just get annoyed with Jan 16 13:56:03 and then I try to implement it better and get annoyed more because android sucks and then I realise why the original solution was the way it was Jan 16 13:56:18 and then I still try to avoid using it because I don't like it at all Jan 16 13:59:09 can anyone tell me if i can have a launcher widget with webkit inside it? Jan 16 14:01:02 notten, https://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout Jan 16 14:02:21 How should I do these lines surrounding he OR ? http://imgur.com/a/F0AgV Jan 16 14:02:32 if you read the documentation, you will figure that it's a no Jan 16 14:02:43 Dagmar: what wrong with tme Jan 16 14:02:45 I was thinking this is a think in CSS , but nothing in android that i know of Jan 16 14:03:11 adq, thanks for that. i started reading your link, and I saw something about RemoteView, but I figured it's a no. Jan 16 14:03:21 dar10s: yeah that upsets me, could have used the css but they invented their own layout Jan 16 14:03:59 and people can't reuse their knowledge of css Jan 16 14:04:07 dar10s, easiest way would be a simple relative layout, with your textview in the center, and 2 views with a height of like 1dp on its side Jan 16 14:04:16 and a background color of your choice Jan 16 14:04:36 and of course some padding/margin Jan 16 14:04:47 it was something like that or a drawable line. Jan 16 14:05:16 there are many ways to do it Jan 16 14:05:31 you could make a custom view too, i did something similar for a project with a custom view Jan 16 14:05:48 but usually, ppl asking this kind of question sound like they will struggle with customview Jan 16 14:06:44 dar10s, it was looking like that: http://imgur.com/a/5yyz4 Jan 16 14:06:54 it's a custom textview Jan 16 14:08:09 squ, why would you want something css based on android is a mystery to me Jan 16 14:08:29 it's not because someone is used to css (mainly webdev) that it makes sense to port it to the whole android platform, however someone did it Jan 16 14:08:34 maybe reread what I said, idk Jan 16 14:08:40 https://github.com/google/flexbox-layout Jan 16 14:08:51 (i would not touch that even if someone pays me) Jan 16 14:09:05 i have read what you said Jan 16 14:09:07 (already) Jan 16 14:13:31 these span things are really underdocumented Jan 16 14:39:04 can somebody interpret this thing for me? https://developer.android.com/reference/android/os/Messenger.html Jan 16 14:39:21 can it be used for communicating two apps with each other? Jan 16 14:39:44 greyline: what are you trying to implement Jan 16 14:39:55 sup thepoosh Jan 16 14:40:02 still doing filthy ui work? Jan 16 14:40:34 thepoosh: two app (one made with Android Studio, in Java, the other is a Unity app) communicating with each other Jan 16 14:40:52 thepoosh: Unity interface is visible, the other should run in the background Jan 16 14:46:56 I still don't see why you're insisting them being separate apps Jan 16 14:47:06 when you're clearly developing the same application Jan 16 14:47:50 aand he timed out Jan 16 14:48:09 okay, I don'T know who wrote me back Jan 16 14:48:16 but I couldn't see anything about that Jan 16 14:48:20 I said Jan 16 14:48:23 my internet was proken Jan 16 14:48:24 I still don't see why you're insisting them being separate apps Jan 16 14:48:26 when you're clearly developing the same application Jan 16 14:48:36 Zharf: not just you, somebody other also Jan 16 14:48:45 a few minutes ago Jan 16 14:49:01 nope, no one else said anything after your last line before you timedout Jan 16 14:49:17 Zharf: I know there was somebody... Jan 16 14:49:31 who was not you Jan 16 14:49:40 thepoosh asked what you're trying to implement to which you answered Jan 16 14:49:40 I asked about the Messenger Jan 16 14:49:43 after that there was nothing Jan 16 14:49:53 Zharf: I asked about this: https://developer.android.com/reference/android/os/Messenger.html Jan 16 14:55:15 raoul11: yeah :( Jan 16 14:55:54 greyline: you should think of different ways of communications such as providers and Intents Jan 16 14:58:13 thepoosh the glide is not playing the gif ,it is only showing it like an image Jan 16 15:00:13 sub_zero: there is an example of gif Jan 16 15:02:51 why this async task doesn't run after every 3 secs? http://pastebin.com/4hQs2PXs Jan 16 15:03:58 i want to repeat the task only after when previous one complete Jan 16 15:04:22 but its not playing it Jan 16 15:04:31 only showing it as an image Jan 16 15:20:01 Is there a simple way to save a file into a specific folder with the google drive api? it seems so convoluted. Jan 16 15:20:29 saving into the root folder is easy, but if I want to save it into a folder within the root folder i'm already running into issues. Jan 16 15:21:09 what are the pros/cons of something like https://ionicframework.com over normal Java-based Android development? Jan 16 15:21:41 as far as I understand I need to do DriveApi.getRootFolder(...).queryChildren(..., queryForMyFolder).setResultCallback(...) Jan 16 15:22:33 in the callback I need to rip apart a metadataBuffer into metadata, then peel my driveId out of it so I can finally write into the folder I want to write into. Jan 16 15:24:17 but it seems my metadata object is empty (metadata.get(0) --> illegal state exception without a detailed message) and I really don't know how to get the deviceId out of it. Jan 16 15:24:30 i mean DriveId Jan 16 15:26:43 anyone? Jan 16 15:31:31 Hi, I got an android cordova plugin that I want to fork a bit. Not beeing a native android programmer: what do I need to do to compile from *.java to *.class? (file in question: https://github.com/honza889/cordova-plugin-kiosk/blob/master/android/KioskPlugin.java ) Jan 16 15:32:31 Do I try to import it in to android studio, hope the import dependencies are satisfied and somehow try to build. than extract the forked class file? Jan 16 15:33:24 dont the android cordava run by itself? Jan 16 15:33:29 bananabas, well, it lists some of the pros right there. it let's you code in the language it does instead of android and perhaps it might offer some random other features. The cons is that no one else in the whole world will use your random development framework and the developer of that framework will likely barely support it. Jan 16 15:33:59 AndroidNewb, I want to change a line :). Maybe I can even quick and dirty modify the *.class file? Jan 16 15:34:36 anotheryou, the compiler creates class files during... well, compiling. so to create class files you need to compile. Jan 16 15:34:36 AndroidNewb, oh, nevermind, you are right XD Jan 16 15:34:52 Syzygy, thanks, haha, yaaay eaaasy Jan 16 15:34:57 Syzygy: so you're saying it's a no-go due to long-term maintenance problems? Jan 16 15:35:12 cordova is a stand alone IDe Jan 16 15:35:22 With android studio you just need to press that funky little play buttion, with java in general you type javac myJavaFile.java Jan 16 15:36:40 bananabas, it's a risk and in my experience more often than not a problem. Such frameworks, even the big and "good" ones are plagued by bugs, lack of documentation, support and learning resources. Jan 16 15:37:36 plus you'll have a harder time finding another dev that you could ask. Jan 16 15:37:52 i see Jan 16 15:38:03 people probably use them because it's easier to find web devs Jan 16 15:38:07 familiar with that stack Jan 16 15:38:14 rather than android devs Jan 16 15:43:04 People use them because they think they'll save time and won't have to learn anything. Jan 16 15:43:14 Then they find out that both of those facts are wrong. Jan 16 15:43:35 :D Jan 16 15:44:54 Don't get me wrong, there are types of apps which may be faster to develop for cross-platform this way. Jan 16 15:45:04 Mavrik: such as? Jan 16 15:45:04 But it's still pretty hellish if you want to do advanced stuff. Jan 16 15:52:37 yeah I haven't seen a single successful web based mobile app that wasn't exceedingly simple Jan 16 15:53:28 also I'm on the verge of writing my own textview Jan 16 15:53:38 I probably shouldn't Jan 16 15:53:41 please do Jan 16 15:53:47 and add justified text :') Jan 16 15:53:57 but doing nice highlights with spannables is a major pain Jan 16 15:54:05 (every lib i tested doing it.. failed miserably and not even on edge cases) Jan 16 15:55:10 if you look at the source code of TextView, it's too big, it does too many things Jan 16 15:55:22 justified like the ones that have each line be roughly the same lenght by adding spacing? Jan 16 15:55:23 i think it would have been nice they split or separate this kind of View Jan 16 15:55:29 yes Zharf Jan 16 15:55:38 basically, computing space length Jan 16 15:55:55 i did it for round screen, but nothing i would share so ugly my code is but at least it worked Jan 16 15:56:17 ugly solution probably woulnd't be too hard either :) Jan 16 15:56:19 i used few formula related to inscribed circle Jan 16 15:56:32 but that's not what I'm interested in right now Jan 16 15:56:51 and like you said, doing too many things in one view leads to disaster Jan 16 15:57:01 well TextView is incredibly big inside Jan 16 15:57:06 it is Jan 16 15:57:44 i think the main problem is due to view lifecycle with measurement & stuff Jan 16 15:58:08 because if the text is bigger than the view height itself, everything not visible still need to be computed Jan 16 15:58:19 TextView.java also has editor stuff in it Jan 16 15:58:41 but i cannot imagine it's not a solvable problem Jan 16 15:58:50 we are used to justify text everywhere since ages Jan 16 15:59:23 even printing, before computer did it Jan 16 15:59:24 lol Jan 16 15:59:35 im getting crushed by libc linking bug Jan 16 16:00:06 i may be forced to give up on ndk-r13b and go back to r10d Jan 16 16:02:13 maybe i should just try and wait up this toolchain breakage and focus exclusively on ios for another 4 months Jan 16 16:02:29 wait out* Jan 16 16:18:55 Hi. My kiosk mode just kills system dialogs when my app looses focus. Can I somehow exclude a certain dialog? Or can my app not look far enough out of the sandbox? Jan 16 16:19:04 How the hell do I get a DriveId of an existing folder in google drive? Jan 16 16:19:13 or at least the resource ID of such a folder Jan 16 16:21:13 anotheryou, any reason you're not using OS integrated kiosk mode? Jan 16 16:21:28 and prevent the dialog from being created in the first place? Jan 16 16:22:47 Mavrik, uhm, maybe I was just too stupid to find that option, where is it? The dialog is the "allow screen recording" thing, which seems to have to launch sucessfully even when set to "remember my answer" Jan 16 16:23:27 https://developer.android.com/work/cosu.html Jan 16 16:24:50 * anotheryou sings the song of the lollipop Jan 16 16:24:52 thanks! Jan 16 16:25:03 didn't know about it and pinning was not enough for me Jan 16 16:25:37 anyone played with latest WearableRecyclerView (android wear 2.*) and can confirm switch setCenterEdgeItems from true to false or from false to true does not change anything (looks like it's only taken in account in the constructor of this specific WRV)? Jan 16 16:32:41 stackoverflow is down D: (maintanance) Jan 16 16:35:16 Why do I need a folderResourceId to get a folderId to get a folder in the google drive android api... Jan 16 16:37:22 actually folderResourceId to get a driveId to get a folderId to get a folder.... Jan 16 17:10:10 cool https://www.raspberrypi.org/magpi/compute-module-3/ Jan 16 17:15:45 neat Jan 16 17:19:30 wonder if Android Things works out of the box with it Jan 16 17:22:10 AFAIK the compute module is pretty much identical to standard RPi 3 Jan 16 17:22:14 just the packaging is different Jan 16 18:02:51 I'm developing an app that creates custom quick tiles via a TileService. When the app is running (in the background/open in recent tasks) the launchIntent for the tile goes perfectly, launching the selected app. However, when the app is closed, the launchIntent reverts to that of the contacts app for some reason. here's a gist of the tileService: Jan 16 18:02:53 https://gist.github.com/munowse/18dee33e22b5b5d0f1c29729c155b113 Jan 16 18:03:24 any help would be greatly appreciated Jan 16 18:18:36 raoul11: here? Jan 16 18:25:18 Has anyone used keystore in 23+? I'm trying to read this tutorial but it's a bit confusing https://developer.android.com/training/articles/keystore.html#SecurityFeatures Jan 16 18:25:56 I'm trying to encrypt and decrypt a regular string. Sort of like this post: https://stackoverflow.com/questions/33754129/encryption-decryption-of-username-using-keystore-in-android-m-older-version Jan 16 18:38:15 I am hoping someone could give me a good suggest for Form Inputs on Android. Something that implements your basic types like Strings, Numbers, etc, as well as built in formatting like decimals, emails, etc Jan 16 18:38:31 Something like this iOS library https://github.com/xmartlabs/Eureka Jan 16 18:38:44 I'm trying to create an "immortal" application for internal automation purposes, basically, if there's a crash, the app should restart on its own. Jan 16 18:39:42 For that I set an UncaughtExceptionHandler, but it seems like whenever I try to start the app again (with startActivity) I get Activity pause timeout for ActivityRecord Jan 16 18:39:53 Any idea how to avoid that or how best to restart my app? Jan 16 18:41:24 https://gist.github.com/Syzygy2048/149835240747f78168c066bdf8c9feed this is pretty much all I'm doing. Jan 16 18:44:24 Activities shouldn't try and keep themselves always open. It would make more sense to always keep a service going. Jan 16 18:45:15 @Syzygy this is as close as you're going to get, some crashes completely kill the Application, you can't recover from that https://medium.com/@ssaurel/how-to-auto-restart-an-android-application-after-a-crash-or-a-force-close-error-1a361677c0ce#.y7v7992sc Jan 16 18:47:39 Girafferson, sorry, I disconnected. I'm totally fine with the activity closing and opening again somehow. The app won't work as a service because it's taking pictures constantly. Jan 16 18:47:56 (I only saw your first post, in case there were more) Jan 16 18:48:41 @Syzygy did you see @jawatio's reply? Jan 16 18:49:04 no Jan 16 18:49:09 @Syzygy this is as close as you're going to get, some crashes completely kill the Application, you can't recover from that https://medium.com/@ssaurel/how-to-auto-restart-an-android-application-after-a-crash-or-a-force-close-error-1a361677c0ce#.y7v7992sc Jan 16 18:51:19 it's ok if it can't recover, that's why I want to restart it :D AlarmManager seems like a decent solution, I'll try it. Thanks Jan 16 18:51:46 Is there a way to build/load android-things without Android Studio? Jan 16 18:51:57 wouldnt a service makes sense Syzygy ? Jan 16 18:52:26 for my app in general, no, it needs constant access to the camera and thus won't work as a service. Jan 16 18:52:39 for restarting... maybe? Jan 16 18:52:43 just to restart Jan 16 18:52:57 @Syzygy by can't recover, means if the exception is sever enough to crash the entire application, its out of your hands, you can't do anything about it Jan 16 18:53:48 jawatio, I wish there was a "this app messed up" broadcast ^^ Jan 16 18:54:40 you could possibly make a background service, but how does it know when to truly restart the app. maybe the end user is done using it Jan 16 18:55:26 To mean, this not only sounds like a design flaw. But that it would also be easier to correctly handle all exceptions the app can throw. thats why we do Test Driven Development Jan 16 18:55:35 there is no end user, this app is meant to run constantly on company internal devices Jan 16 18:55:49 it's still a very wrong approach Jan 16 18:56:24 if there is no end user, there should be no UI, therefore it should be a background service, then the OS will restart it if possible Jan 16 18:56:55 but that alone sounds odd, why an android device, a server would be more reliable . imo Jan 16 18:57:28 because a server can't take photos Jan 16 18:57:33 and neither can a background service. Jan 16 18:57:56 a server most certainly can. attach a camera to it Jan 16 18:59:52 10 cheap phones are probably cheaper than 10 servers, and better suited for being moved around from time to time. Jan 16 19:00:12 If you're truly limited on having to use an android device. build a service, that opens an activity when it needs to capture the image Jan 16 19:00:41 you wouldnt need multiple servers, just cameras, which would be cheaper or same price as a device Jan 16 19:02:55 I need the cameras at different locations... at the same time, including some where wifi isn't available. The app takes timelapse pictues every 10 seconds to 1 minute or so, so taking the photos via an app seems possible, but kind of weird to me. Jan 16 19:04:27 in any case, the alarm manager works great. Jan 16 19:05:04 One thing to know about android applications, the OS can and will end your app when it feels the need, such as low memory Jan 16 19:05:33 a service is your best bet, one that opens the activity when the image is needed to be captured Jan 16 19:05:53 otherwise, you have no guarantee it will also be working Jan 16 19:06:13 always* Jan 16 19:07:39 I'll keep that in mind. Thank you. Jan 16 19:09:33 Syzygy basically what you're trying to do http://stackoverflow.com/questions/14976614/open-run-camera-from-background-service-in-android/14997460 Jan 16 19:10:24 bye my friends Jan 16 19:13:37 i think he is mixing several problems into one, and that makes it hard to solve, initially i thought he just wanted to recover his ~app (note application != activity) from crash Jan 16 19:13:52 and now it's about camera (which is probably the one making the activity crash lol) Jan 16 19:18:26 is there a ready to use input text dialog in android? Jan 16 19:19:00 in docs im seeing a custom dialog example with username and password Jan 16 19:26:48 adq, well, I want to recover the app no matter what. sometimes the app crashes because the camera api acts weird (and yes, that the implementation is rushed doesn't help either), sometimes it crashes for some reason during onStart of the main activity... since I can't reproduce all the possible crashes, restarting the app is best. After all, up to now the only way to restart the app was to push out a new update. Jan 16 19:27:17 you should use camera2 Jan 16 19:27:27 and give up on the old api Jan 16 19:27:28 that's what I did at first. Jan 16 19:27:36 but the phone doesn't support it. Jan 16 19:27:41 and if you continue to stick to old broken stuff, make flavor and push different versions Jan 16 19:28:36 restarting the app is not the best, if same crash condition(s) occur, it will crash again Jan 16 19:28:42 you will restart app again, it will crash again, etc Jan 16 19:28:52 better than doing nothing. Jan 16 19:28:55 no Jan 16 19:29:22 on old device, a camera crash might require a phone restart anyway lol Jan 16 19:29:24 good luck Jan 16 19:29:42 (not even mentionning discrepancies across roms) Jan 16 19:30:40 It's not an old device (but a cheap one that ships with android 6 but does not support camera2) Jan 16 19:30:49 luckily all devices are the same. Jan 16 19:37:22 huh? camera2 is since android 5.0 Jan 16 19:37:44 I know... as I said, chap phones. Jan 16 19:39:59 Ulefone U007 Pro. It's actually surprisingly good. The only issue I have with it is that it doesn't support Camera2 (although I haven't used it besides developing). Even the picture quality is fine. Jan 16 19:41:42 Quick question: When I call the vibrate method of the Vibrator class multiple times in a row (each time requesting the Vibrator via getSystemService), how can I achieve that the running vibration pattern is not interrupted by the new call to vibrate? Jan 16 19:46:24 Matthew42, since you know the pattern of vibration, you could estimate the amount of time + a delta to be safe and then "new call" Jan 16 19:47:47 that means you have to track when it starts, when it should have stopped to make your new call Jan 16 19:49:15 adq: Yeah, I could probably do that, but isn't there a "cleaner" solution? I'd expect Android to have something like "append to vibration queue" ... Jan 16 19:50:00 i don't think there is such thing Jan 16 19:50:36 the class is very minimalist Jan 16 19:51:12 are you making a sextoy app or something? Jan 16 19:51:22 because i have trouble finding a valid use-cases lol Jan 16 19:51:30 maybe for a (silent) metronome app Jan 16 19:53:19 adq: What gave it away? :P No, actually It's for api requests that need some "haptic" feedback. Jan 16 19:54:16 adq: Network speed is unpredictable and I'd like to have a vibration pattern for request and response :) Jan 16 19:55:04 well, i don't know how to approach your problem except from what i said earlier Jan 16 19:55:40 adq: There is a attributes parameter of the type AudioAttributes, could that be what I wish for? Jan 16 19:56:14 seems unrelated Jan 16 20:01:14 I'm just thinking about making the request patterns extremely short and accept that they can be interrupted. Afterall I want the response notice to come asap. Jan 16 20:08:59 dudes! happy new year! Jan 16 20:09:19 I'm still gradle'ing out of holiday fog -- how's everyone today? Jan 16 20:11:28 shipit: Happy new year? Internet explorer user spotted! Jan 16 20:12:06 lol Jan 16 20:12:15 Matthew42 I'm on Mac OS X, using Chrome -- what sorcery is this? Jan 16 20:12:24 actually, I'm using LimeChat Jan 16 20:12:37 thats a good irc client shipit Jan 16 20:12:50 thx raoul11, I like it a lot Jan 16 21:48:21 Anyone here with a rooted Xperia X Performance (or Compact) or a XZ that can check if they have the following file? /sys/devices/virtual/input/clearpad/glove Jan 16 22:20:40 Quacked: wrong channel Jan 16 22:31:00 I have problems getting a overflow div scrolling in android Jan 16 22:38:03 anli: I'm sorry Jan 16 22:38:26 I had it working now Jan 16 22:38:31 So do not be Jan 16 22:38:37 Cool :9 Jan 16 22:38:39 :) Jan 16 22:38:44 :) Jan 16 22:57:56 hey guys, do you know how to simulate app termination by the OS? Jan 16 23:10:56 hey guys, does anyone know how to simulate app termination by the OS? Jan 17 00:14:29 * Zharf slaps gridlayout Jan 17 00:14:32 stop being like that Jan 17 00:16:18 http://eclipser.xmms2.org/device-2017-01-17-021544.png -.- Jan 17 00:17:54 http://eclipser.xmms2.org/device-2017-01-17-021727.png better screenshot Jan 17 00:25:03 Sony Crew representin'. Jan 17 00:26:48 ? Jan 17 00:39:23 lol i should get one of those costumes http://i.imgur.com/xvGFloS.gifv Jan 17 00:40:02 Zharf whats the problem ? Jan 17 00:40:24 http://eclipser.xmms2.org/device-2017-01-17-023808.png fixed it Jan 17 00:40:49 Kinda disturbs me that there's no socks or shoes. :S Jan 17 00:40:54 the layoutparams I made in code were bogus Jan 17 00:41:07 TacticalJoke only ~100 hours until the world ends Jan 17 00:41:58 Is a meteor coming? I'll get the champagne. Jan 17 00:42:16 trump inauguration Jan 17 00:42:31 meteor would be quick and painless, this will be prolonged suffering Jan 17 00:42:46 it's only four years Jan 17 00:43:17 he's already talking about selling parts of narional parks for fossil fuel extraction Jan 17 00:43:24 meanwhile endless comedy for us non-muricans Jan 17 00:43:42 unless he starts a war with china lol Jan 17 00:43:50 meh Jan 17 00:44:07 all of america's businesses are in china Jan 17 00:45:10 should probaly restart IDEA Jan 17 00:45:20 it's capping out the 4G max heap Jan 17 00:46:55 mmmm, can't be so bad... “I love bacon and eggs,” Trump told People magazine last year. Jan 17 00:48:10 though maybe I don't need to keep these 8 projects open at the same time Jan 17 01:43:07 http://eclipser.xmms2.org/device-2017-01-17-034102.mp4 I'll call that good enough for now and come back to tweak it later when I've ran out of other things to do Jan 17 01:48:20 pretty cool http://www.trustedreviews.com/news/microsoft-patent-hints-at-foldable-tablet-design-for-surface-phone Jan 17 01:53:17 hey guys, does anyone know how to simulate app termination by the OS? Jan 17 01:54:54 c2h6o: Press Home on the device, click X in Android Studio (the Android Monitor pane), and then restore the app on the device. Jan 17 01:55:14 That simulates the low-memory termination. Jan 17 01:55:45 g00s: That stuff sounds great. Jan 17 01:56:19 c2h6o, https://developer.android.com/studio/command-line/adb.html#am has various things the platform can do to your ap Jan 17 01:56:23 app* Jan 17 01:56:28 I mean the technology. I'm not so huge on patents in general (though I realise they're sometimes necessary evils). Jan 17 01:57:04 Zharf: Does any of those commands simulate the low-memory background kill? Jan 17 01:57:49 am kill? Jan 17 01:57:55 pretty sure it's hte same Jan 17 02:02:02 Doesn't even kill the background-activity process here. Jan 17 02:02:10 It seems to not consider it "safe to kill". Jan 17 02:04:00 `am kill-all` also doesn't kill my background-activity process. Jan 17 02:04:32 AFAIK, the Android Studio way is the only way. Jan 17 02:05:51 nope, android studio uses the same commands that are available through adb Jan 17 02:06:12 Zharf: Which command is it, then? Jan 17 02:06:26 but even in a low memory situation the system rarely kills an app that it determines would impact the user experience Jan 17 02:06:33 unless the need is extreme Jan 17 02:06:51 kill works for me, your app does something that prevents it Jan 17 02:06:56 No. Jan 17 02:11:06 in dev options, you can simulate if with don"t keep activity enabled Jan 17 02:11:16 and also background process limit to 1 Jan 17 02:11:26 it's usually useful to test saveinstance & stuff Jan 17 02:12:22 adq: That just destroys activities, rather than killing processes. It's similar but a bit different. Jan 17 02:12:34 hmm possible Jan 17 02:12:39 but killing process == nothing left Jan 17 02:12:50 adq: Yeah, but `savedInstanceState` remains. Jan 17 02:13:17 Try my AS method: put the app in the background and click the red X in AS. The process is killed *and* you get `savedInstanceState` when you come back. Jan 17 02:13:27 adb shell am kill kills my process just fine Jan 17 02:13:32 you're doing something wrong :p Jan 17 02:13:34 That thing in AS is a life-saver (and I'm guessing not many people know about it). Jan 17 02:13:51 Zharf: What API version are you running? I once read that `am kill` doesn't work after 22. Jan 17 02:13:56 23 Jan 17 02:14:04 "works for me" Jan 17 02:14:06 24 here. Jan 17 02:14:32 disconnect it from debugger first? Jan 17 02:14:38 Yes, but "works for everyone" is needed here. Jan 17 02:14:42 Not connected to debugger. Jan 17 02:14:46 are you sure? Jan 17 02:15:05 I mean, android studio is eager to connect to it Jan 17 02:15:13 unless you disable adb integration Jan 17 02:17:24 I'm surprised it works for you. The documentation says "This command kills only processes that are safe to kill and that will not impact the user experience." Jan 17 02:17:28 Hi guys. I have an IntentService which I start a few times in a row so they run just one after another just as it should. Now, the documentation says that nothing can stop IntentService, but what I've just fuond out is that if I start, say, 3 services, and for example the 2nd one fails to finish due to some unhandled exception, the last one, third, won't run at all. Jan 17 02:17:49 TacticalJoke, right, why would it impact user experience when it's in the background? Jan 17 02:17:53 that's the point, right? Jan 17 02:17:58 put it in the background and then kill it Jan 17 02:18:37 One could argue that killing it when it was recently used or there's plenty of free memory would impact the user experience. Jan 17 02:18:46 Why an exception in onHandleIntent() affects the next instance of same intent service and it doesn't let it run? Jan 17 02:19:07 TacticalJoke, that has no visible impact to user experience as long as the application resumes properly Jan 17 02:19:50 Creating the process again is slower. It's user-noticeable in many cases. Jan 17 02:20:45 I've not noticed that in a couple of years on modern devices, to be honest... but I guess I might use a biased set of apps :) Jan 17 02:21:11 but in normal operations android doesn't kill the apps very often Jan 17 02:21:12 I notice it easily on my Moto G4. Not the fastest phone ever, but not terrible either. Jan 17 02:21:27 but the only prerequisite is that it doesn't have a foreground process Jan 17 02:21:33 (including foreground service) Jan 17 02:23:07 https://plugins.jetbrains.com/idea/plugin/7380-adb-idea does this do what you want? if so, just read the source which adb command it uses :) Jan 17 02:23:12 its kill seems to use force-stop Jan 17 02:23:12 AlexBerdnikov: Can you give more info? For example, what do you mean by "won't run at all"? Jan 17 02:23:18 but I need to sleep Jan 17 02:23:58 Zharf: Why, though? Like I said, AS has this functionality built in. Jan 17 02:24:11 Press the red X. Problem solved. Jan 17 02:24:35 TacticalJoke, sure, but it's not the same as android killing in low memory situations Jan 17 02:24:39 It is. Jan 17 02:24:41 because it kills even foreground processes Jan 17 02:24:53 android does not kill foreground processes intentionally Jan 17 02:24:57 You have to put it in the background first. Jan 17 02:25:11 no you don't, you can press it without it being in the background Jan 17 02:25:14 it works just the same Jan 17 02:25:18 No. Jan 17 02:25:28 In that case, `savedInstanceState` will be null when you come back. Jan 17 02:25:36 Not the same at all. Jan 17 02:25:57 well then it's a two state button with no visible state to the presser Jan 17 02:26:37 am kill does it too, but only if it's in the background... also it's more useful for automated testing Jan 17 02:26:54 but really now, sleep Jan 17 02:26:57 zzz Jan 17 02:27:17 TacticalJoke, I have a subclass of IntentService. Sometimes I start it in a small cycle, like onу after another with Context.startService(). So, the first instance runs, finihes and the the second instance created and runs right after the first was ended. Then in onHandleIntetnt some unexpected exception occurs and onHandleIntent fails to finish as it meant to. Then I expect the 3rd instance to be created and run after the second one was Jan 17 02:27:17 finished (its failed to finish its job but still it has been finished). Jan 17 02:27:28 And that;s not happeninig Jan 17 02:27:49 3rd instance never starts if the previous one failed to fibish normally Jan 17 02:29:58 AlexBerdnikov: So it never stops and get destroys when the exception happens, right? Jan 17 02:30:02 destroyed* Jan 17 02:31:02 Right. But I don't understand why does that affect the next queued IntentService and cancels it's running Jan 17 02:31:27 *cancels its run Jan 17 02:31:30 AlexBerdnikov: It's because IntentService allows only one task at a time. Jan 17 02:33:40 Yes, I knoe that. I mean, if intent services of same subclass runs one after another and never simultaneously, why then when 2nd queued service fails, 3rd won't run after that? Jan 17 02:37:17 Sorry, I think my last comment was wrong. Jan 17 02:37:32 Are you certain that handleIntent() isn't getting called the third time? Jan 17 02:37:37 onHandleIntent* Jan 17 02:38:50 I'd also override Service.onStartCommand and log that. Jan 17 02:39:15 Be sure to say `super.onStartCommand(intent, flags, startId);`, of course. Jan 17 02:39:34 Yes, I'm sure because after I added additional catch block for that initially unexpected exception, next queued services conitued to run. Jan 17 02:39:37 Well, `return super.onStartCommand(intent, flags, startId);`. Jan 17 02:40:18 AlexBerdnikov: Could you try adding a log statement at the start of both onHandleIntent and onStartCommand? Jan 17 02:40:56 Yes, of course. I'll try it and look what happens... Jan 17 02:41:03 Thank you for suggestions Jan 17 02:46:16 Ok, it seems that this line in IntentService's source explains everything: Jan 17 02:46:19 return mRedelivery ? START_REDELIVER_INTENT : START_NOT_STICKY; Jan 17 02:46:26 This is from onStartCOmmand Jan 17 02:47:19 So if service fails by default it just won't be redelivered even with new intent Jan 17 02:47:45 That's not relevant to this. That's about if the process is killed by the OS> Jan 17 02:47:46 .* Jan 17 02:48:27 Well, if your entire process is going down I guess it could be relevant. Jan 17 02:49:15 I think there's no diference between the scenario when the service fails to finish due to exception and because OS killed it. Jan 17 02:50:09 So, my service dies because of exception and by default it just doesn't redeliver, so the queue is cleared obviously. Jan 17 02:59:02 Anyone familiar with HttpRequest? I'm making a simple post request which works fine until I use special characters such as an accented e. In that case I get an exception: content-length promised 165 bytes, but received 164 Jan 17 02:59:46 Setting the content length like so: connection.setRequestProperty("Content-Length", "" + Integer.toString(body.getBytes().length)); **** ENDING LOGGING AT Tue Jan 17 03:00:02 2017