|
uncle blog posted:The page is a list of several items, with a search bar above it. If the user enters the search and starts typing, the list gets replaced by the results of the search. I want the original list to reappear when the user exits the search bar, and thought dismissing the keyboard seemed like a good point of reference. Depends on exactly what you're using (look at the methods available on whatever component it is) but you'll probably want to use this https://developer.android.com/reference/android/view/View.html#setOnFocusChangeListener(android.view.View.OnFocusChangeListener) Java code:
|
# ? Oct 6, 2016 09:11 |
|
|
# ? May 30, 2024 20:00 |
|
uncle blog posted:The page is a list of several items, with a search bar above it. If the user enters the search and starts typing, the list gets replaced by the results of the search. I want the original list to reappear when the user exits the search bar, and thought dismissing the keyboard seemed like a good point of reference.
|
# ? Oct 6, 2016 09:45 |
|
I want to make Android apps but I'm averse to Java. Will I have the most success using Scala, Clojure, Haskell or Frege?
|
# ? Oct 7, 2016 19:45 |
|
xtal posted:I want to make Android apps but I'm averse to Java. Will I have the most success using Scala, Clojure, Haskell or Frege?
|
# ? Oct 7, 2016 20:09 |
|
xtal posted:I want to make Android apps but I'm averse to Java. Will I have the most success using Scala, Clojure, Haskell or Frege? No, you will likely not.
|
# ? Oct 7, 2016 21:10 |
|
Volmarias posted:No, you will likely not. What if I wrote the Android parts in Java, but the business logic in another language? Is there anybody who had ever succeeded with a non-Java language?
|
# ? Oct 7, 2016 21:28 |
|
xtal posted:What if I wrote the Android parts in Java, but the business logic in another language? Is there anybody who had ever succeeded with a non-Java language? You're going down a dark road, friend - one with a really bad ratio of time spent worrying about tooling to time spent making apps. If you want to make Android apps, you should learn Java. When you get to know him he's not such a bad dude. Kotlin's like Java's cool younger brother who spent time traveling the world and is now back, rebuilding his career with charisma and charm - but even so, you probably won't get along with Kotlin unless you can at least demonstrate a tolerance for Java. Spend less time worrying about what languages you like or don't, and more time making apps. Apps are cool, and if it turns out you like making them, you'll probably end up liking the tools you use to make them as well - and you'll learn about new tools along the way that you like even more. Also, it could be worse. You could be staring down the barrel of Objective C. speng31b fucked around with this message at 22:09 on Oct 7, 2016 |
# ? Oct 7, 2016 22:05 |
|
The other alternative would be to use one of the cross-platform mobile frameworks that uses another language you can tolerate, but there are generally large trade-offs like: - performance/responsiveness may suck - your UI may lack the native look and feel - you don't have access to all the native functionality you want et cetera
|
# ? Oct 7, 2016 22:31 |
|
You can probably use Scala, the question is just if actually want to. A quick googling says that at least there seems to be a way. Not sure if it's a good one.
|
# ? Oct 7, 2016 22:40 |
|
It also depends on your goal. I'd say if you want this experience building Android apps to ever translate into something that could be a marketable skill, use Java - full stop, end of discussion. Also if you want to actually build apps and not just endlessly churn on adjacent technologies.
|
# ? Oct 7, 2016 23:13 |
|
You could try React Native. It's pretty cool.
|
# ? Oct 7, 2016 23:51 |
|
Thermopyle posted:You could try React Native. It's pretty cool. I disagree, and I've used it pretty extensively. I gave it a fighting shot - we have a lot of JS devs in our office, and it made sense to try to build some crossover. It's just not production-ready, stable, maintainable, or fine for building a really good UX. But probably not the time for a long form rant.
|
# ? Oct 7, 2016 23:53 |
|
Thermopyle posted:You could try React Native. It's pretty cool. I'm only considering Android because I'm so tired of Web apps. So, I think I will just go play with my abacus.
|
# ? Oct 8, 2016 00:02 |
|
xtal posted:I'm only considering Android because I'm so tired of Web apps. So, I think I will just go play with my abacus. Why do you hate Java so bad? You can even use lambdas now! You could still have a play with it, it's not a huge investment to try it out and tinker with butts.apk
|
# ? Oct 8, 2016 00:08 |
|
baka kaba posted:Why do you hate Java so bad? You can even use lambdas now! it's a can of worms but I just don't enjoy imperative programming anymore. I've written my last for loop. I know you can write functional in Java, I've been writing functional in Ruby and JavaScript for years, but it's a second rate experience, that's why I don't dig the Web.
|
# ? Oct 8, 2016 00:14 |
|
speng31b posted:I disagree, and I've used it pretty extensively. I gave it a fighting shot - we have a lot of JS devs in our office, and it made sense to try to build some crossover. It's just not production-ready, stable, maintainable, or fine for building a really good UX. But probably not the time for a long form rant. Interesting. I've only built some toy apps with it, but I haven't really heard people talking about it like you.
|
# ? Oct 8, 2016 00:29 |
|
xtal posted:it's a can of worms but I just don't enjoy imperative programming anymore. I've written my last for loop. I know you can write functional in Java, I've been writing functional in Ruby and JavaScript for years, but it's a second rate experience, that's why I don't dig the Web. You tried out Elm? All your web dreams come true maybe
|
# ? Oct 8, 2016 00:34 |
|
Thermopyle posted:Interesting. I've only built some toy apps with it, but I haven't really heard people talking about it like you. I got to the point of opening some PRs to fix some issues I was having, at which point the maintainers commented that they have "internal" implementations they don't (and won't) release which didn't have the same problems, and would probably implement a take on those fixes instead at some indefinite time in the future. I stopped. I still think it's a cool concept, but it's a toy. To use it in production, I'd need to fork it and maintain extensively, since the "good stuff" isn't always available to the open source part. I couldn't sleep at night taking ownership of a product built on that. There are too many good options out there which are way more trustworthy and come without serious pitfalls. speng31b fucked around with this message at 01:53 on Oct 8, 2016 |
# ? Oct 8, 2016 00:37 |
|
baka kaba posted:You tried out Elm? All your web dreams come true maybe Yeah Elm is great
|
# ? Oct 8, 2016 02:24 |
|
Kotlin is good, and the java/android sdk interoperability is really seamless. Feels like a better version of Swift
|
# ? Oct 8, 2016 03:15 |
|
Vesi posted:Kotlin is good, and the java/android sdk interoperability is really seamless. Feels like a worse version of Swift with a crashy debugger This was my experience. I basically liked using it but at the time I was doing it (last winter probably) it was not fun to debug.
|
# ? Oct 8, 2016 18:00 |
|
My team switched to Kotlin for all new work starting a couple months ago. It's been a joy to work with.
|
# ? Oct 9, 2016 20:55 |
|
kitten smoothie posted:My team switched to Kotlin for all new work starting a couple months ago. It's been a joy to work with.
|
# ? Oct 9, 2016 23:10 |
|
Tunga posted:My team lead is convinced it's "the latest fad" and won't let us touch it, which I do understand, I really just want an excuse to use something different from Java for once! Link them to Jake Wharton's long form rebuttal of "Kotlin is a fad/we can't support it." I'll dig it up later and link it. Basically Jetbrains is a highly credible maintainer and it will never be "a fad" unless you think Java (but better) is a fad. The opinion of your team lead is a common ignorant take on it, but should be easily corrected with a bit of actual good faith research. speng31b fucked around with this message at 23:43 on Oct 9, 2016 |
# ? Oct 9, 2016 23:36 |
|
Does no one use groovy anymore? Last time I did java development my co-workers were really into that. It did seem less painful than writing Java. How does kotlin compare with groovy?
|
# ? Oct 10, 2016 00:59 |
|
peepsalot posted:Does no one use groovy anymore? Last time I did java development my co-workers were really into that. It did seem less painful than writing Java. How does kotlin compare with groovy? We use Groovy for tooling - Gradle - because we're forced to. I've never heard of any of the more credible sources in the community endorse it as an application language. Personally it's not my cup of tea and I'd say among JVM languages that are Android compatible it's not held in particularly high esteem.
|
# ? Oct 10, 2016 04:25 |
|
speng31b posted:We use Groovy for tooling - Gradle - because we're forced to. I've never heard of any of the more credible sources in the community endorse it as an application language. Personally it's not my cup of tea and I'd say among JVM languages that are Android compatible it's not held in particularly high esteem. Yeah, if nothing else it seems people are wanting to go into the other direction, with Gradle buildscripts written in Kotlin
|
# ? Oct 10, 2016 05:35 |
|
Groovy is one of the worst languages I've ever used. It's like someone thought that the problem with Ruby was that it just didn't have enough magic or cute little tricks.
|
# ? Oct 10, 2016 06:09 |
|
speng31b posted:Link them to Jake Wharton's long form rebuttal of "Kotlin is a fad/we can't support it." I'll dig it up later and link it. Basically Jetbrains is a highly credible maintainer and it will never be "a fad" unless you think Java (but better) is a fad.
|
# ? Oct 10, 2016 09:47 |
|
Tunga posted:Is this a blog post or a video? I found a video but can't check right now if that's the right thing. Link would be great if you can find it. It's a blog post, but it's proving trickier to find than I thought it would be. I'll post it as soon as I can find it, it's a good read.
|
# ? Oct 10, 2016 17:06 |
|
speng31b posted:It's a blog post, but it's proving trickier to find than I thought it would be. I'll post it as soon as I can find it, it's a good read. https://docs.google.com/document/d/1ReS3ep-hjxWA8kZi0YqDbEhCqTt29hG8P44aA9W0DM8/edit
|
# ? Oct 10, 2016 17:51 |
|
Tunga posted:I'm guessing this? Yep that's it.
|
# ? Oct 10, 2016 23:33 |
|
I have a picture of a minus sign in my app. When a user clicks it, I want a field to drop down with the text "Remove object", that is clickable. Is there an easy wat to implement this?
|
# ? Oct 17, 2016 10:45 |
|
uncle blog posted:I have a picture of a minus sign in my app. When a user clicks it, I want a field to drop down with the text "Remove object", that is clickable. Is there an easy wat to implement this? I'm guessing you want a PopupMenu ?
|
# ? Oct 17, 2016 10:50 |
|
Seems like a good guess, thanks!
|
# ? Oct 18, 2016 08:38 |
|
I'm not sure if this is an android or java question, but here goes: I've got two nasty constraints to deal with - a polling-only interface, and devices with flaky real time clocks. The ones that run faster than real-time eventually check the network time and jump back, sometimes a few minutes. My Timer().schedule(task, 100ms) doesn't seem to fire until it the system clock goes past where it was before. Obvious question answered first: Yes, I'm making sure to post the results to the UI thread. I forgot that once and my app promptly crashed. All that the timer does is toss a 'requestUpdate' command in the transmit queue. Some of the UI buttons toss commands in the queue too, and those keep working as expected. It's a PITA to diagnose due to the specific hardware this runs on, and I don't have the update service working on an emulator. Is there a way to request monotonic intervals on android through sleep and time changes? Edit: To clarify, I don't want to fire during sleep, just a fairly consistent period while the device is running that doesn't hang when the time changes or the device sleeps. All the answers out there are "never change the wall time." Harik fucked around with this message at 21:10 on Oct 20, 2016 |
# ? Oct 20, 2016 20:44 |
|
how about skipping java and using clock_gettime() with CLOCK_MONOTONIC? linux is one of the easier platforms to get monotonic time with
|
# ? Oct 21, 2016 04:06 |
|
Vesi posted:how about skipping java and using clock_gettime() with CLOCK_MONOTONIC? Yes you can use monotonic time to help with unreliable system time, no you don't "skip Java" to get monotonic time. Read the docs: https://developer.android.com/reference/android/os/SystemClock.html Elapsed real-time is guaranteed to be monotonic. Trying to skip Java and use raw *nix functionality in android apps is a great way to end up with unstable unportable code.
|
# ? Oct 21, 2016 07:09 |
|
I don't particularly want to write a replacement for Timer.schedule() using SystemClock.sleep() and .uptimeMillis(). Timer.schedule() is based on Object.wait(millis), and I thought that was monotonic. Going over the page again it's not clear that it is. It looks like android.os.Handler.postDelayed() is monotonic, and it's trivial to switch to that. Is that the right answer?
|
# ? Oct 21, 2016 08:15 |
|
|
# ? May 30, 2024 20:00 |
|
postDelayed and/or postAtTime with uptimeMillis are probably what you want, yep.
|
# ? Oct 21, 2016 14:26 |