News for hackers. Stuff that matters.
Re:Google Launches Android Studio 2.0 by talloaktrees on Monday November 23, 2015 @01:07PM (#10616061)
"Instant Run lets developers build and deploy their apps once (both to the emulator or to a physical device) and then as they change their code and deploy it, it’ll only take a second or two before they can see those changes in the running app. This feature will work for all apps that target Ice Cream Sandwich and later. Cuthbertson politely refused to tell us how exactly Instant Run works, but promised that Google will detail the technology behind this feature in the future."

This could be awesome, if it works as advertised.

Re:Google Launches Android Studio 2.0 by mirkoadari on Monday November 23, 2015 @03:05PM (#10616930)
It's definitely possible. JRebel for Android [1] has been available for quite some time now with none of the limitations on what kind of changes are supported. Will they get it stable? Time will tell.

[1] https://zeroturnaround.com/software/jrebel-for-android/

Re:Google Launches Android Studio 2.0 by nohawp on Monday November 23, 2015 @06:21PM (#10618073)
I just tried it, it works pretty well. You can also ask it to relaunch the activity.
Re:Google Launches Android Studio 2.0 by nerdwaller on Tuesday November 24, 2015 @12:02AM (#10619206)
I've had hit and miss results so far, sometimes it's great and then a bunch of times it ends up launching the app twice. Perhaps I'm either doing something wrong or I'm not hitting the right use when this works flawlessly. So far, however, hit and miss with little clear reason.
Re:Google Launches Android Studio 2.0 by whatever_dude on Tuesday November 24, 2015 @09:33AM (#10620880)
My hypothesis is that launching the app twice actually means it's crashing the app.

When the app is running, and you do an instant run from Android Studio, it will try doing the hot swap. The app crashes and immediately relaunches (and it's the same build). All the while Android Studio is monitoring the app task and waiting for the hot swap to take place. It keeps checking, times out after a few seconds (realizing it didn't update successfully), and then it deploys and launches the new APK, as a last resort.

My point is to be careful when testing if you're getting the double launches, because the first time it is launched, it's still the old APK.

Re:Google Launches Android Studio 2.0 by ycosynot on Monday November 23, 2015 @06:53PM (#10618199)
For some reason, it doesn't work with my radio button text, it doesn't update it, but it works with labels and button texts. Well, maybe it's not stable yet, but it's awesome, and I'm happy that it's there.
Re:Google Launches Android Studio 2.0 by shade23 on Tuesday November 24, 2015 @07:47AM (#10620380)
It does not seem to be working for me. It does not reflect logic changes and I thought it was only for UI,however that also had no effect.Am I doing something wrong?
Re:Google Launches Android Studio 2.0 by gruez on Monday November 23, 2015 @01:10PM (#10616086)
I guess it works similarly to edit and continue in visual studio.
Re:Google Launches Android Studio 2.0 by Natanael_L on Monday November 23, 2015 @01:50PM (#10616397)
If done directly on devices too, I'm assuming runtime hacks similar to Xposed that swap code out right away.
Re:Google Launches Android Studio 2.0 by jayd16 on Monday November 23, 2015 @02:16PM (#10616575)
Yes, it sounds more like monkey patching the apk than simply changing the running code. Hard to say without more details. /starts download
Re:Google Launches Android Studio 2.0 by free2rhyme214 on Monday November 23, 2015 @01:35PM (#10616274)
Instant Run would be awesome on iOS...
Re:Google Launches Android Studio 2.0 by iLoch on Monday November 23, 2015 @03:43PM (#10617172)
React Native supports it on both platforms. Also live reload. :)
Re:Google Launches Android Studio 2.0 by infinite8s on Monday November 23, 2015 @04:25PM (#10617416)
Well it's easy when you don't have to monkey patch assembly jumps.
Re:Google Launches Android Studio 2.0 by jbigelow76 on Monday November 23, 2015 @03:44PM (#10617179)
Same with NativeScript.
Re:Google Launches Android Studio 2.0 by oblio on Monday November 23, 2015 @05:49PM (#10617924)
Interesting. Have you used NativeScript for a commercial product? It's the first time I hear about it and I'm curious to hear an opinion about it.
Re:Google Launches Android Studio 2.0 by untog on Monday November 23, 2015 @08:44PM (#10618637)
I've been playing around with it, but not for a full project. It's very interesting - unlike React Native the JS has full access to all native APIs, so if you want to call one no-one has written a wrapper for yet you just can.

I've actually ended up writing a lot of platform specific code as I found the cross-platform stuff to be kind of janky. But it basically lets me write an iOS app, using iOS APIs (and even iOS sample code, if I apply myself)... in JavaScript. It's not bad at all.

Re:Google Launches Android Studio 2.0 by iLoch on Monday November 23, 2015 @10:30PM (#10618987)
> unlike React Native the JS has full access to all native APIs, so if you want to call one no-one has written a wrapper for yet you just can.

Yup I think I'll stay as far away from that as possible! Sounds like a recipe for a 10 hour debugging binge. I think managed APIs are pretty essential when doing interop.

Re:Google Launches Android Studio 2.0 by untog on Monday November 23, 2015 @11:10PM (#10619095)
Depends what you're trying to do. For instance, I was playing around with notifications in iOS. They have the ability for you to download data in the background before a notification is opened, which is a tremendously useful thing to be able to do. Last I checked the multi-platform frameworks don't allow you to do it - so being able to use NativeScript's cross-platform stuff then augment it as you desire is a pretty great thing.
Re:Google Launches Android Studio 2.0 by jbigelow76 on Tuesday November 24, 2015 @02:26AM (#10619571)
Haven't used it for a commercial project, only toying around at night. But the company I work for does use another of Telerik's products, Kendo UI.
Re:Google Launches Android Studio 2.0 by AlphaSite on Monday November 23, 2015 @05:24PM (#10617782)
There is a limited form of it available as an Xcode plugin.

- https://github.com/johnno1962/injectionforxcode

Re:Google Launches Android Studio 2.0 by javaguy44 on Tuesday November 24, 2015 @05:34PM (#10624056)
I dev Droid and iOS natively, and am playing with instant run now. iOS simulator still faster than Instant Run on a real sized project. Instant Run just helps to bring more parity, but is still not there yet.
Re:Google Launches Android Studio 2.0 by Drdrdrq on Monday November 23, 2015 @01:41PM (#10616320)
I imagine they only change the modified activities. I guess they can't do that for games...
Re:Google Launches Android Studio 2.0 by newjersey on Monday November 23, 2015 @02:58PM (#10616880)
Yup, modified activities but games should be able to take advantage of this as well. In the timestamp below, it shows the presenter making the chess pieces larger and smaller. It is available on the canary build beginning today. Give it a try?

https://www.youtube.com/watch?feature=player_detailpage&v=YY... (lifestream timestamp is probably inaccurate)

Re:Google Launches Android Studio 2.0 by whatever_dude on Monday November 23, 2015 @03:00PM (#10616893)
It starts 26 minutes in, so people should look at the start time and just forward 26 minutes.

It's the second speaker, a woman right after the man that comes first.

Re:Google Launches Android Studio 2.0 by whatever_dude on Monday November 23, 2015 @05:29PM (#10617809)
Just tested. It doesn't replace the activities, it replaces parts of the compiled code (classes' dex?) with new versions.

It works well most of the time. Sometimes it can cause some nasty crashes. I guess it's expected since you can't just replace some object instances and expect it to work.

The settings does have an option to also restart the current activity when it does the hot swapping. I guess it's to account for those cases when hot swapping doesn't work as expected.

Re:Google Launches Android Studio 2.0 by revelation on Monday November 23, 2015 @06:52PM (#10618197)
It crashes? That's pretty bad. VS Edit&Continue and Eclipse JDT, which also do something similar, warn you when a change can't be applied live (or would cause a crash resuming on old state).

I've generally found with this feature in various IDEs that it's good for changing a constant in some drawing code but not really much else, and then it just turns into frustration as you get constant popups reminding you it won't apply some change live. I think the problem is that in the timeframe companies like Google and Microsoft allocate for such a feature, it's extremely difficult to produce something that works 99% of the time. If we could get there (and improve step backwards functionality, as well) we would probably just abandon the divide between programming and debugging mode in IDEs and always have an updated copy running (or mostly, paused) alongside ready to context-switch into.

Re:Google Launches Android Studio 2.0 by scorpion032 on Wednesday November 25, 2015 @09:35AM (#10627330)
I think they have to compete with how React Native handles it, to make sure the developer experience developing Native Android apps is at least at par with those developing using React native, Ionic etc.
Re:Google Launches Android Studio 2.0 by seany on Monday November 23, 2015 @04:16PM (#10617368)
You can do this with CoronaSDK based apps already (on all platforms even)