21 Temmuz 2014 Pazartesi

KNOX Contribution to Android: Accelerating Android in the Workplace

Srikanth Rajagopalan, PM Director and Workplace aficionado



Recently at Google I/O, we announced a comprehensive set of new features that will allow IT organizations to easily deploy and manage Android devices in enterprise environments. These features will be built into the upcoming Android L release.



Samsung, with its KNOX technology, has been a thought leader in the enterprise mobility space. In order to accelerate Android adoption in the enterprise, we have partnered with Samsung to bring key KNOX functionality into Android, for the benefit of the entire Android ecosystem. We thank Samsung for their contributions. These new capabilities will make it easy for IT organizations to allow employees to bring their own Android devices to work (BYOD) and use them on the corporate network or to simply issue new Android devices to their employees. IT administrators will be able to manage a wide range of Android devices from many manufacturers, using third-party Enterprise Mobility Management (EMM) solutions that are built on top of the new enterprise APIs launching with Android L release.



Google and Samsung together designed the new enterprise APIs around three major concepts:





  • Device and data security

  • Support for IT policies and restrictions

  • Mobile application management



Device and data security


At the core of the expanded enterprise capabilities being introduced in Android ‘L’ lies a set of technologies that are designed to keep personal and corporate data both separate and safe. We achieve the data separation by building on the existing multi-user support in Android: personal and corporate applications will run as two separate Android users. Data is kept safe by using block-level disk encryption as well as verified boot technology. For those of you familiar with KNOX, this is analogous to KNOX Workspace. EMMs will be able to take advantage of new Android SDK APIs to enable the creation of a managed profile, which is where all corporate applications and data will reside.



Support for IT restrictions and policies


EMMs can use new Android SDK APIs , which have evolved from KNOX APIs, to allow IT admins to enforce a wide set of policies, ranging from system settings and certificate provisioning to application-specific (e.g. Chrome) configurations and restrictions.



Mobile application management


EMMs will be able to use new backend APIs, adapted from KNOX APIs and built around strong security principles for on-device app deployment, to allow IT admins to curate the corporate application catalog and to remotely deploy applications to the managed profile on the employees’ devices.



We encourage developers interested in the new Enterprise APIs to download and test the Android L Developer Preview. For developers who have already built applications using Samsung KNOX APIs, Samsung will be providing a KNOX Compatibility Library that will let such applications run on all Android L devices.



You can read more about this collaboration on the Samsung KNOX blog. Stay tuned for additional details.



17 Temmuz 2014 Perşembe

Porting Your Android Wear Developer Preview Code to the Latest Support Library

Today’s post on #AndroidWear is from +Wayne Piekarski.



Now that the full Android Wear SDK is available, it’s time to port your existing wearable-enabled notification code from the Developer Preview. In the process, you’ll switch to using the latest Android support library, and there are some small API changes that will require you to update your code. This article will show you how to update my previous code samples that were released earlier for stacks and pages, which you can use to guide the conversion of your own code as well.



To get started with an existing project in Android Studio, you should update to the 0.8 or later release. You also need to make sure you’ve downloaded the Google Support Library version 20 or later from the SDK Manager. Since this is only a notification-based example, there’s no need to download the full Android Wear SDK, which is only needed if you want to create an APK to run on the wearable device.



Unix diff output is used to show the necessary changes in an easy to understand way. Do not copy the + or - symbols at the start of each line, and ignore the lines starting with @@ which are used to indicate the line number that changed. For the curious, I used the following command to generate the diff output from the last commit in my GIT repository (the -U1 shows one line of context to keep the output simple):



git show HEAD -U1



Gradle changes



To add the new support-v4 library, you need to edit your build.gradle file like so:



@@ -24,2 +24,3 @@ dependencies {
compile 'com.android.support:appcompat-v7:19.+'
+ compile 'com.android.support:support-v4:20.0+'
}


Make sure you remove the wearable-preview-support.jar that was provided with the Developer Preview from your libs directory and build.gradle file, since these features are now in the standard support library.



Package imports



Since the APIs and package names have changed, the import statements at the top of MainActivity.java need to be adjusted like this:



@@ -7,3 +7,2 @@ import android.view.MenuItem;
-import android.support.v4.app.NotificationCompat;
import android.app.Notification;
@@ -13,4 +12,9 @@ import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
-import android.preview.support.v4.app.NotificationManagerCompat;
-import android.preview.support.wearable.notifications.WearableNotifications;

+import android.support.v4.app.NotificationCompat;
+import android.support.v4.app.NotificationManagerCompat;
+
+// Extra dependencies needed for the pages example
+import java.util.ArrayList;
+import java.util.List;
+import android.support.v4.app.NotificationCompat.BigTextStyle;


Stacking notifications



Since the preview SDK, we have simplified how notifications are implemented. The existing NotificationCompat.Builder() was extended to support groups directly, instead of a separate WearableNotifications class. The steps are a lot simpler, as can be seen with the following changes to showStackNotifications():



@@ -63,3 +67,3 @@ public class MainActivity extends ActionBarActivity {
// Group notification that will be visible on the phone
- NotificationCompat.Builder builderG = new NotificationCompat.Builder(this)
+ Notification summaryNotification = new NotificationCompat.Builder(this)
.setContentTitle("2 Pet Notifications")
@@ -67,5 +71,5 @@ public class MainActivity extends ActionBarActivity {
.setSmallIcon(R.drawable.ic_launcher)
- .setLargeIcon(bitmapMila);
- Notification summaryNotification = new WearableNotifications.Builder(builderG)
- .setGroup(GROUP_KEY_MESSAGES, WearableNotifications.GROUP_ORDER_SUMMARY)

+ .setLargeIcon(bitmapMila)
+ .setGroup(GROUP_KEY_MESSAGES)
+ .setGroupSummary(true)
.build();

@@ -76,3 +80,3 @@ public class MainActivity extends ActionBarActivity {
PendingIntent.getActivity(this, notificationId+1, viewIntent1, 0);
- NotificationCompat.Builder builder1 = new NotificationCompat.Builder(this)
+ Notification notification1 = new NotificationCompat.Builder(this)
.addAction(R.drawable.ic_action_done, "Treat Fed", viewPendingIntent1)
@@ -81,4 +85,3 @@ public class MainActivity extends ActionBarActivity {
+ "Can we have steak?")
- .setSmallIcon(R.drawable.ic_launcher);
- Notification notification1 = new WearableNotifications.Builder(builder1)

+ .setSmallIcon(R.drawable.ic_launcher)
.setGroup(GROUP_KEY_MESSAGES)
@@ -89,3 +92,3 @@ public class MainActivity extends ActionBarActivity {
PendingIntent.getActivity(this, notificationId+2, viewIntent2, 0);
- NotificationCompat.Builder builder2 = new NotificationCompat.Builder(this)
+ Notification notification2 = new NotificationCompat.Builder(this)
.addAction(R.drawable.ic_action_done, "Water Filled", viewPendingIntent2)
@@ -93,4 +96,3 @@ public class MainActivity extends ActionBarActivity {
.setContentText("Can you refill our water bowl?")
- .setSmallIcon(R.drawable.ic_launcher);
- Notification notification2 = new WearableNotifications.Builder(builder2)

+ .setSmallIcon(R.drawable.ic_launcher)
.setGroup(GROUP_KEY_MESSAGES)


Page notifications



Page notifications have also changed to use a WearableExtender() class instead of the WearableNotifications class, as can be seen here in showPageNotifications():



@@ -151,3 +153,3 @@ public class MainActivity extends ActionBarActivity {
PendingIntent.getActivity(this, notificationId+1, viewIntent1, 0);
- NotificationCompat.Builder builder1 = new NotificationCompat.Builder(this)
+ Notification notification1 = new NotificationCompat.Builder(this)
.addAction(R.drawable.ic_action_done, "Returned", viewPendingIntent1)
@@ -155,5 +157,4 @@ public class MainActivity extends ActionBarActivity {
.setContentText("You have " + numOverdue + " books due at the library")
- .setSmallIcon(R.drawable.ic_launcher);
- Notification notification1 = new WearableNotifications.Builder(builder1)
- .addPages(extras)

+ .setSmallIcon(R.drawable.ic_launcher)
+ .extend(new NotificationCompat.WearableExtender().addPages(extras))
.build();


Conclusion



If you want to download the final source code of showStackNotifications() and showPageNotifications(), you can download the MainActivity.java file. You can build this file easily by creating a new project in Android Studio, adding the support library, and then copying in this MainActivity.java.



As you can see, porting this previous code over to the latest Android Wear SDK is really easy! It should take you hardly any time at all to get your experimental applications ported over and ready for publishing on the Google Play!



15 Temmuz 2014 Salı

Learn to Think Like an Android Developer





By Reto Meier, Head of Scalable Developer Advocacy




Today I’m proud to announce the latest resource for learning to develop Android apps: Developing Android Apps: Android Fundamentals.




Android Fundamentals is an online training course featuring Google Developer Advocates Reto Meier, Dan Galpin, and Katherine Kuan, working with the team at Udacity that’s advanced and technical enough for experienced developers who are new to Android — maybe even new to mobile — but not new to programming.



The course offers step-by-step training in which you’ll build an Android app, and learn best practices of mobile development in general and Android development in particular.



The full course materials — all the videos, quizzes, and forums — are available for free for all students by selecting “View Courseware”. Personalized ongoing feedback and guidance from Coaches is also available to anyone who chooses to enroll in Udacity’s guided program.



This guided course, along with UX Design for Mobile Developers and Mobile Web Development, complement our existing material—including documentation, samples, and videos — to offer a solid grounding in developing great experiences for people using mobile devices. Check out the trailer below for an overview of what's in the course.



Mobile devices are the platform that will bring the next five billion people online. With Android expanding rapidly into emerging markets, and growing beyond phones and tablets into wearables, auto, and TV, learning the fundamentals behind Android development represents an opportunity to affect and improve the lives of billions of people.



We look forward to seeing what the next wave of Android developers build, and we’ll keep exploring new ways to help you become better developers.






10 Temmuz 2014 Perşembe

New Cross-Platform Tools for Game Developers

By Ben Frenkel, Google Play Games team



There was a lot of excitement at Google I/O around Google Play Games, and today we’re delighted to share that the following tools are now available:




  • Updated Play Games cross-platform C++ SDK

  • Updated Play Games SDK for iOS

  • New game services alerts in the Developer Console



Here's a quick look at the cool new stuff for developers.



Updated Play Games C++ SDK



We've updated the Google Play Games C++ SDK with more cross-platform support for the new services and experiences we announced at I/O. Learn more»



The new C++ SDK now supports all of the following:









Cocos2D-x, a popular game engine, is an early adopter of the Play Games C++ SDK and is bringing the power of Play Games to their developers. Additionally, the Cocos2D-x team created Wagon War, a prototype game showcasing the capabilities of the Cocos2D-x engine with Play Games C++ SDK integration.


Wagon War is also a powerful reference for developers — it gives you immediately usable code samples to accelerate your C++ implementations. You can browse or download the game sources on the Wagon War page on GitHub.




Updated Play Games iOS SDK



The Play Games iOS SDK is now updated with support for Quests and Saved Games, enabling iOS developers to integrate the latest services and experiences with the Objective-C based tool-chains they are already familiar with. Learn more»



The new Play Games SDK for iOS now supports all of the following:




  • Quests and Events. Learn more»

  • Saved Games. Learn more»

  • Game Profile and related Player XP APIs — the SDK now also provides the UI for Game Profile and access to Player XP data for players.



New types of games services alerts



Last, you can now see new types of games services alerts in the Developer Console to learn about issues that might be affecting your users' gameplay experiences. For example, if your app implements Game Gifts, you'll now see an alert when players are unable to send a gift; if your app implements Multiplayer, you'll now see an alert when players are unable to join a match. Learn more»




8 Temmuz 2014 Salı

Update on Android Wear Paid Apps

We have a workaround to enable paid apps (and other apps that use Google Play's forward-lock mechanism) on Android Wear. The assets/ directory of those apps, which contains the wearable APK, cannot be extracted or read by the wearable installer. The workaround is to place the wearable APK in the res/raw directory instead.



As per the documentation, there are two ways to package your wearable app: use the “wearApp” Gradle rule to package your wearable app or manually package the wearable app. For paid apps, the workaround is to manually package your apps with the following two changes, and you cannot use the “wearApp” Gradle rule. To manually package the wearable APK into res/raw, do the following:




  1. Copy the signed wearable app into your handheld project's res/raw directory and rename it to wearable_app.apk, it will be referred to as wearable_app.

  2. Create a res/xml/wearable_app_desc.xml file that contains the version and path information of the wearable app:
    <wearableApp package="wearable app package name">
    <versionCode>1</versionCode>
    <versionName>1.0</versionName>
    <rawPathResId>wearable_app</rawPathResId>
    </wearableApp>


    The package, versionCode, and versionName are the same as values specified in the wearable app's AndroidManifest.xml file. The rawPathResId is the static variable name of the resource. If the filename of your resource is wearable_app.apk, the static variable name would be wearable_app.


  3. Add a <meta-data> tag to your handheld app's <application> tag to reference the wearable_app_desc.xml file.
    <meta-data android:name="com.google.android.wearable.beta.app"
    android:resource="@xml/wearable_app_desc"/>

  4. Build and sign the handheld app.



We will be updating the “wearApp” Gradle rule in a future update to the Android SDK build tools to support APK embedding into res/raw. In the meantime, for paid apps you will need to follow the manual steps outlined above. We will be also be updating the documentation to reflect the above workaround. We're working to make this easier for you in the future, and we apologize for the inconvenience.

2 Temmuz 2014 Çarşamba

Google Play Services 5.0

gps

Google Play services 5.0 is now rolled out to devices worldwide, and it includes a number of features you can use to improve your apps. This release introduces Android wearable services APIs, Dynamic Security Provider and App Indexing, whilst also including updates to the Google Play game services, Cast, Drive, Wallet, Analytics, and Mobile Ads.




Android wearable services



Google Play services 5.0 introduces a set of APIs that make it easier to communicate with your apps running on Android wearables. The APIs provide an automatically synchronized, persistent data store and a low-latency messaging interface that let you sync data, exchange control messages, and transfer assets.



Dynamic security provider



Provides an API that apps can use to easily install a dynamic security provider. The dynamic security provider includes a replacement for the platform's secure networking APIs, which can be updated frequently for rapid delivery of security patches. The current version includes fixes for recent issues identified in OpenSSL.



Google Play game services



Quests are a new set of APIs to run time-based goals for players, and reward them without needing to update the game. To do this, you can send game activity data to the Quests service whenever a player successfully wins a level, kills an alien, or saves a rare black sheep, for example. This tells Quests what’s going on in the game, and you can use that game activity to create new Quests. By running Quests on a regular basis, you can create an unlimited number of new player experiences to drive re-engagement and retention.



Saved games lets you store a player's game progress to the cloud for use across many screen, using a new saved game snapshot API. Along with game progress, you can store a cover image, description and time-played. Players never play level 1 again when they have their progress stored with Google, and they can see where they left off when you attach a cover image and description. Adding cover images and descriptions provides additional context on the player’s progress and helps drive re-engagement through the Play Games app.




App Indexing API



The App Indexing API provides a way for you to notify Google about deep links in your native mobile applications and drive additional user engagement. Integrating with the App Indexing API allows the Google Search app to serve up your app’s history to users as
instant Search suggestions, providing fast and easy access to inner pages in your app. The deep links reported using the App Indexing API are also used by Google to index your app’s content and surface them as deep links to Google search result.



Google Cast



The Google Cast SDK now includes media tracks that introduce closed caption support for Chromecast.



Drive



The Google Drive API adds the ability to sort query results, create folders offline, and select any mime type in the file picker by default.



Wallet



Wallet objects from Google take physical objects (like loyalty cards, offers) from your wallet and store them in the cloud. In this release, Wallet adds "Save to Wallet" button support for offers. When a user clicks "Save to Wallet" the offer gets saved and shows up in the user's Google Wallet app. Geo-fenced in-store notifications prompt the user to show and scan digital cards at point-of-sale, driving higher redemption. This also frees the user from having to carry around offers and loyalty cards.



Users can also now use their Google Wallet Balance to pay for Instant Buy transactions by providing split tender support. With split tender, if your Wallet Balance is not sufficient, the payment is split between your Wallet Balance and a credit/debit card in your Google Wallet.



Analytics



Enhanced Ecommerce provides visibility into the full customer journey, adding the ability to measure product impressions, product clicks, viewing product details, adding a product to a shopping cart, initiating the checkout process, internal promotions, transactions, and refunds. Together they help users gain deeper insights into the performance of their business, including how far users progress through the shopping funnel and where they are abandoning in the purchase process. Enhanced Ecommerce also allows users to analyze the effectiveness of their marketing and merchandising efforts, including the impact of internal promotions, coupons, and affiliate marketing programs.



Mobile Ads



Google Mobile Ads are a great way to monetise your apps and you now have access to better in-app purchase ads. We've now added a default implementation for consumable purchases using the Google Play In-app Billing service.



And that’s another release of Google Play services. The updated Google Play services SDK is now available through the Android SDK manager. For details on the APIs, please see New Features in Google Play services 5.0.











26 Haziran 2014 Perşembe

Android L Developer Preview and Android Studio Beta

By Jamal Eason, Product Manager, Android







At the Google I/O keynote yesterday we announced the L Developer Preview — a development version of an upcoming Android release. The Developer Preview lets you explore features and capabilities of the L release and get started developing and testing on the new platform. You can take a look at the developer features and APIs in the API Overview page.



Starting today, the L Developer Preview is available for download from the L Developer Preview site. We're also announcing that Android Studio is now in beta, and making great progress toward a full release.



Let’s take a deeper dive into what’s included in the preview and what it means for you as a developer as you prepare your apps for the next Android release.



What’s in the L Developer Preview



The L Developer Preview includes updated SDK tools, system images for testing on an emulator, and system images for testing on a Nexus 5 or Nexus 7 device.



You can download these components through the Android SDK Manager:




  • L Developer Preview SDK Tools

  • L Developer Preview Emulator System Image - 32-bit (64-bit experimental emulator image coming soon)

  • L Developer Preview Emulator System Image for Android TV (32-bit)



(Note: the full release of Android Wear is a part of Android KitKat, API Level 20. Read more about Android Wear development here.)



Today, we are also providing system image downloads for these Nexus devices to help with your testing as well:




  • Nexus 5 (GSM/LTE) “hammerhead” Device System Image

  • Nexus 7 [2013] - (Wifi) “razor” Device System Image



You can download both of these system images from the L Developer Preview site.

With the SDK Tools, and Nexus device images, you can get a head start on testing out your app on the latest Android platform months before the official launch. You can use the extra lead time to take advantage of all the new app features and APIs in your apps. The Nexus device images can help you with testing, but keep in mind that they are meant for development purposes only and should not be used on a production device.



Notes on APIs and publishing



The L Developer Preview is a development release and does not have a standard API level. The APIs are not final, and you can expect minor API changes over time.



To ensure a great user experience and broad compatibility, you can not publish versions of your app to Google Play that are compiled against L Developer Preview. Apps built for L Developer Preview will have to wait until the full official launch to publish on Google Play.



Android Studio Beta



To help you develop your apps for the upcoming Android version and for new Android device types, we’re also happy to announce Android Studio Beta. Android Studio Beta helps you develop apps by enabling you to:




  • Incorporate the new material design and interaction elements of the L Developer Preview SDK

  • Quickly create and build apps with a new app wizard and layout editor support for Android Wear and Android TV



Building on top of the build variants and flavors features we introduced last year, the Android Studio build system now supports creating multiple apks, such as for devices like Android Wear. You can try out all the new features with the L Developer Preview by downloading the Android Studio Beta today.



How to get started



To get started with the L Developer Preview and prepare your apps for the full release, just follow these steps:




  1. Try out Android Studio Beta

  2. Visit the L Developer Preview site

  3. Explore the new APIs

  4. Enable the material theme and try out material design on your apps

  5. Get the emulator system images through the SDK Manager or download the Nexus device system images.

  6. Test your app on the new Android Runtime (ART) with your device or emulator

  7. Give us feedback





As you use the new developer features and APIs in the L Developer Preview, we encourage you to give us your feedback using the L Developer Preview Issue Tracker. During the developer preview period, we aim to incorporate your feedback into our new APIs and adjust features as best as we can.




You can get all the latest downloads, documentation, and tools information from the L Developer Preview site on developer.android.com. You can also check our Android Developer Preview Google+ page for updates and information.




We hope you try the L Developer Preview as you start building the next generation of amazing Android user experiences.













Get it on Google Play