
Android M Developer Preview and Tools - CodeWithCoffee
http://android-developers.blogspot.com/2015/05/android-m-developer-preview-tools.html
======
frik
_Permissions_

"We are giving users control of app permissions in the M release. Apps can
trigger requests for permissions at runtime, in the right context, and users
can choose whether to grant the permission. Making permission requests right
when they’re needed means users can get up and running in your app faster.
Also, users have easy access to manage all their app permissions in settings."

Great, finally Google got it. Hopefully with the old Android 2.3 style fine
granular permissions and not the few permission groups of Android 4/5.

~~~
calvin_c
They've actually set the number of permission groups to 8. But at least you
can accept/decline each individually.

EDIT: The permission groups are

Location

Camera

Microphone

Contacts

Phone

SMS

Calendar

Sensor

~~~
rentnorove
Conspicuously absent:

\- Read external storage

\- Internet

~~~
Aldo_MX

      Application YourTypicalMobileApplication is asking for access to the Internet
      to display advertisements powered by Google AdMob.
    
                                                                 [ D̶E̶N̶Y̶ ] [ ALLOW ]
    
      (Do you think we would give you the option to easily cut our income?)

~~~
socceroos
Then please, oh please separate it out. Internet _and_ Advertising. Shouldn't
be hard.

~~~
Manishearth
> Shouldn't be hard.

How can the OS tell if an HTTP request is for the Internet or for Ads? It
can't.

Though Google _could_ special-case AdMob effectively owning the ad scenario
for apps which don't use the internet for anything else.

~~~
socceroos
That's what I meant. It covers a good ~95% of all ads. Have any extras
register for security exemption. Makes sense to me - in the context of not
screwing the user over constantly.

------
ignoramous
IMO, the most game changing feature announced today is 'Now on tap'

Google isn't releasing more details on it, but with it, Google would be able
to understand what you do, when you do it, who your pals are, who you go out
to movies with, who you chat with the most, are you looking to quit your job,
are you about to break up, are you going through a depression and so on...

They haven't revealed anything about how exactly 'Now on tap' works...but the
potential for data collection is enormous. With 'Now on tap' they promise to
do 'searches' based on the context (which is derived from the contents in the
app that's showing on-screen). So no matter what app you're using, Google will
get its hand on the data. It sounds nightmarish and exciting at the same time.

~~~
Roritharr
What scared me about that announcement was that "no changes in the app are
necessary" which basically means that google from now on will parse the text
that is displayed, regardless of the type of app that is open.

Without any further clarification i have to expect Google now to send the
displayed data of my mobile banking app to its servers everytime i hit that
"Now on Tap" button, accidentally or not, while its open. I don't like that.

~~~
Sargos
This only works if the developer uses app indexing where Google can search
through the content and make it searchable to end users and other endpoints.
It doesn't come for free so Google has no access to things like your bank
app's screen.

~~~
wikyd
[http://arstechnica.com/gadgets/2015/05/android-ms-google-
now...](http://arstechnica.com/gadgets/2015/05/android-ms-google-now-on-tap-
shows-contextual-info-at-the-press-of-a-button/) makes it seem like they just
walk the view hierarchy. They show examples of using this in a chat app, which
makes less sense to be found via app indexing.

~~~
zmmmmm
The presenter actually mentioned app indexing on stage at some point so I
think it does rely on the developer opting into indexing.

On the other hand, it's not clear to me that the _user_ opts into the
indexing, so Google might suddenly silently be getting access to a huge number
of user's deep within-app data without them realising it. But that is old
news, app indexing has been around for a while.

~~~
wikyd
I think the way to think about it is Google is doing what it does best:
search. They use whatever content they can scrape from the screen using the
view hierarchy once the user signals intent that they want to search. It's a
faster way to do search using context (in this case the screen) to provide the
"keywords". The app indexing part is how they are able to show related apps
with deep links. They use app indexing of _other_ apps to find relevant
results for the query.

App indexing makes sense when you have more stable content inside of an app
like a traditional public website. Think Yelp and their 'screen' per place
inside of the app. It doesn't make sense to publish the contents of a chat
conversation to Google's app index -- that would be a huge privacy leak! It
would be the equivalent of GoogleBot indexing my Gmail inbox.

------
27182818284
Google is showing off Android M dev previews while devices sold new last fall
in major US retailers are still running KitKat with no updates from Google or
their providers. They continue to actively create the "fractured" world of
Android.

In other words, that's cool about Android M, but most people aren't even using
L. (40% on K, 9% on L whose preview was the 2014 IO)

Can Google not poach one or two of Apple's negotiators to go to the right
meetings at Motorola, Verizon, etc to talk about updates?

~~~
krschultz
Damn lies and statistics. The Android dashboard numbers are always super
pessimistic on upgrade rate.

I am the lead for an app with >250,000 installs. Over 45% of our usage is
coming from Lollipop. The rest is JB & KK. We see <6% ICS for the last 30
days.

I know other major apps that have even better numbers.

Looking at my data, L usage was basically nil in January 2015. There was slow
growth from there until April, when we saw an inflection point in the number
of Lollipop users. This aligned with the release of several Samsung updates
that pushed Lollipop to some of the most popular devices out there.

If you want publicly available numbers, I would rely on Mixpanel[1] not the
Android dashboard. And even this understates it, as of writing this comment
Mixpanel is not including 5.1 in the Lollipop numbers which is cutting 2-3%
off that. [2]

[1]
[https://mixpanel.com/trends/#report/android_os_adoption](https://mixpanel.com/trends/#report/android_os_adoption)
[2]
[https://twitter.com/mixpanel/status/604025242529308672](https://twitter.com/mixpanel/status/604025242529308672)

The narrative about Android fragmentation is really out of touch with what I
experience on a daily basis.

~~~
kuschku
As someone developing another Android app, a FOSS app for an IRC bouncer:

About 25% of our users are below ICS even. Yes, one quarter of our users are
on Gingerbread.

And then the rest is shared equally between JB, KK and L.

~~~
yareally
The Android Market lets you depreciate old versions of Android now for your
apps by leaving up the last compatible apk for them while newer devices get
the latest version of your app.

With that, you can either let the old version die slowly as users upgrade
devices. I haven't attempted it, but I assume you can still somehow push
bugfixes for the older version without newer devices also getting it.

~~~
kuschku
But then those people wouldn’t get the normal upstream releases anymore, and
we’d have to setup a branch for backports – not really great.

~~~
yareally
Backporting bug fixes or new features? I wouldn't be going out of my way to
try adding new features to 5 year old versions of Android. If a user reports a
crash for 2.3, sure, I will fix it. I know I have a fair amount of devices
showing as Android 2.3 for one of my apps, but I've noticed most of them seem
to be inactive. The app in question is a tool for testers and power users, so
I would expect many of them to keep old devices around for fun/hobby, but not
really using them actively.

Just something you might want to investigate. You may not have as many
actively using 2.3 as you might think. Creating a new branch for active build
really isn't that much complexity and then a branch for legacy when the legacy
is just maintenance mode only.

~~~
kuschku
We are talking only about people who installed the latest version of the app –
so they had to be online, and had updates activated, within of the past few
weeks.

------
heyheyhey
> Battery - We’re making Android devices smarter about managing power through
> a new feature called Doze. With M, Android uses significant motion detection
> to learn if a device has been left unattended for a while. In this state,
> Android will exponentially back off background activity, trading off a
> little bit of app freshness for longer battery life.

Will this improve wakelock performance that has been plaguing Android for
years?

~~~
kllrnohj
Wakelocks have just been a scapegoat for people to pretend to sound smart when
just saying that they want better battery life. They haven't actually been an
issue for years.

No, this won't magically fix bugs in apps that lead to poor battery life. If
an app opens the camera and forgets to close it, yeah that's gonna murder your
battery.

~~~
serve_yay
That shouldn't even be possible IMO.

~~~
kllrnohj
I, too, would love to live in a world where it's impossible to write bugs.
Things would be so much nicer if Google could just solve the halting problem
already.

Sadly it's more likely I'll just get some stupid pony instead.

~~~
pas
The OS manages resources. It can temporarily grant (exclusive) control of a
resource to an application. It can measure your other resource activity
(touchscreen). If not touch screen activity for a long time, or when simply
the screen is locked, then why is the camera on?

Sure, it can be a spy app, designed to listen and record! But then the OS can
expose a per-app maximum wake setting. Yes, it'd look like a spreadsheet
instead of a happy user UI, but that'd be a solution, instead of this "oh we
can't do anything" excuse.

~~~
sangnoir
> If not touch screen activity for a long time, or when simply the screen is
> locked, then why is the camera on?

Because the OS shouldn't be making assumptions about applications' interaction
models. People tend to write apps that OS creators never dreamed about. There
are legitimate reasons for resource usage (camera) to continue without user
interaction.From the top of my head, I can imagine writing a baby-monitor app
that uses camera to stream video to my phone in the other room using wifi.

The resource-limiting heuristics have to be _impossibly_ good, otherwise it
gets in the way of useful apps.

~~~
jordanthoms
One way of handling this is to have a separate permission - Use camera, which
allows an app to use it for a limited time with the user interacting and while
in foreground, and a 'Background Camera' permission which your baby-monitor
app would request. Perhaps make the permissions dialog for the background
permission scarier so developers have an incentive to use the less privileged
permission.

This would work nicely for GPS etc - sure, I want to be able to have My Tracks
keep GPS on for 3 hours, but I don't need Uber to be able to do that - and
their app has a nasty habit of forgetting to turn the GPS off if you leave it
at the wrong time.

------
JasonFruit
The update to provide run-time permission prompts pleases me as a user; as a
developer, I'm not as excited about it, especially if it doesn't come with
narrower categories of permission. I could see it prompting the user to
provide permission to do much more than is being done, and without the ability
to provide reasoning and context in the dialog.

~~~
EddieRingle
Dave stated during the keynote that they were slimming down the number of
permission categories.

~~~
lsaferite
Wait, wouldn't slimming down categories result in even less granular control?

~~~
baddox
I assume that the upfront permissions prompted before an install will be
simpler and fewer, and the more granular permissions (like microphone or
camera access) will be prompted when they are actually requested by the app.
Just like iOS.

~~~
digi_owl
Don't think so, as their post install UI slide showed pr category switches
with categories very similar to those already seen in the "improved" Play app.

------
amolgupta
the NDK support in Studio will end the use of eclipse for Android development.

~~~
quotemstr
I like how people see Android developments as a choice of heavyweight IDEs. I
do all my Android development, Java and native, with Emacs and Buck.

~~~
jraines
Can you recommend any good resources learning about taking this approach?

~~~
Ologn
I often program Android in Emacs as well. I use the Java Development
Environment for Emacs and have been happy with it.

If you add an Android-specific class like TextView in your code, you can
easily have Android Studio add the needed import command for it.

With Emacs/JDE, I point my jde-global-classpath to the Android jar, then when
I need to add an import line I highlight the class and do a Control-C,
Control-V, Control-Z. It is slightly more convoluted than Studio but works
well enough, I could probably automate and simplify it more if I needed to.
This was the main shortcut I missed when moving from Eclipse/ADT to Android,
but doing this got it back for me.

------
jfuhrman
Will there be an official Android M for the Nexus 4 ? It's a very powerful
device even by today's standards with a quadcore and 2GB RAM.

~~~
runjake
From the article this submission is linked to:

"The M Developer Preview includes an updated SDK with tools, system images for
testing on the official Android emulator, and system images for testing on
Nexus 5, Nexus 6, Nexus 9, and Nexus Player devices."

So, no.

~~~
nly
I don't think they released the Android L previews for the the N4 either?
Maybe someone can confirm.

~~~
christop
They didn't, but by the time Android M comes out, the Nexus 4 will be
approaching three years old.

As a Nexus 4 user, I'm not holding my breath (and my N4 isn't holding its
charge).

------
Zigurd
The pace of development is impressive. Now if they could get OEMs to keep up.

------
hadrien01
> Android Design Support Library - Making Material design apps gets even
> easier with the new Android Design support library. We have packaged a set a
> key design components (e.g floating action button, snackbar, navigation
> view, motion enabled Toolbars) [...]

Finally! I had to start developing for Android not too long ago, and I
couldn't stand seeing "mandatory" material components for certain usages that
weren't supported in the official SDK.

~~~
krschultz
Nothing is mandatory. Material guidelines are a suggestion and a set of tools
to make the baseline app better by default.

In general the UI components are moving out of the SDK into the support libs
or the community at large. RecyclerView & Toolbar are examples of Google
untangling the foundation from the look & feel, and letting the community come
up with the final implementation of things.

~~~
dharma1
Is that a deliberate strategy or a lack of communication between teams at
Google to create the SDK level support for components their design team
designs?

~~~
izacus
I don't understand this sentiment, why do you need those components? There's
bunch of 3rd party libraries to implement the UI patterns. Do you go annoy
Safari/Chrome/Firefox developers that they don't provide you with components
for carousels in browsers as well?

~~~
dharma1
Annoy? I'm not sure I understand that sentiment.

I think the comparison between operating systems and browsers is apples (no
pun) and oranges. Browsers generally don't implement any specific UI design
language, whereas operating systems do.

Android is a system where Google controls most of the baseline UI and does
implement much of the Material design language in the SDK- but at least on the
launch of 5.0 several components were missing. As you rightly say the
community came to the rescue and there are several versions of each component
now on github.

Was just wondering if that was on purpose, and the strategy is only to provide
base components in the SDK, and only visual designs of a more comprehensive
set of UI components - and then let the community implement the missing
components outlined in the design guidelines? Not saying that's a bad thing,
just curious if it's done on purpose.

------
axg
Product page:
[https://developer.android.com/preview/index.html](https://developer.android.com/preview/index.html)

And downloads page:
[https://developer.android.com/preview/download.html](https://developer.android.com/preview/download.html)

------
jwilm
> Most notable is a much requested feature from our Android NDK & game
> developers: code editing and debugging for C/C++ code

Does this mean gdb integration with android studio? That would be fantastic!
Working with the NDK has been a pretty painful at times, and this change will
make a lot of people very happy.

~~~
jordanthoms
Yes, They mentioned they integrate with the gdb and llvm debugger.

------
mahouse
[https://4.bp.blogspot.com/-LCRPmN9Lx_E/VWc6aVDdMkI/AAAAAAAAB...](https://4.bp.blogspot.com/-LCRPmN9Lx_E/VWc6aVDdMkI/AAAAAAAABpI/Kt5p6uEMK-U/s0/cropped_runtime_permissions.png)

That image... Seriously, when will Google stop doing things like these? Will
they ever learn to be attentive?

~~~
isbadawi
What are you referring to?

~~~
mahouse
The image is blurry and the colours are dithered. This really looks good to
you? [https://i.imgur.com/r3HZWyG.png](https://i.imgur.com/r3HZWyG.png)

~~~
nacs
That was probably just a poor attempt by whoever edited the screenshot to de-
emphasize the app in the background and highlight the actual permission
dialog.

~~~
mahouse
The permission dialog is also blurry and dithered. It's just barely noticeable
because it's mostly white, but it's there also.

~~~
nacs
They might have saved as a 256 color GIF (resulting in the dithering) before
re-encoding to PNG.

