Saturday, February 11, 2017
Android changes for NDK developers
Android changes for NDK developers
Posted by Dmitry Malykhanov, Developer Advocate
Related to other improvements to the Android platform, the dynamic linker in Android M and N has stricter requirements for writing clean, cross-platform compatible native code in order to load. It is necessary that an applications native code follows the rules and recommendations in order to ensure a smooth transition to recent Android releases.
Below we outline in detail each individual change related to native code loading, the consequences and steps you can take to avoid issues.
Required tools: there is an <arch>-linux-android-readelf binary (e.g. arm-linux-androideabi-readelf or i686-linux-android-readelf) for each architecture in the NDK (under toolchains/), but you can use readelf for any architecture, as we will be doing basic inspection only. On Linux you need to have the binutils package installed for readelf, and pax-utils for scanelf.
Private API (Enforced since API 24)
Native libraries must use only public API, and must not link against non-NDK platform libraries. Starting with API 24 this rule is enforced and applications are no longer able to load non-NDK platform libraries. The rule is enforced by the dynamic linker, so non-public libraries are not accessible regardless of the way code tries to load them: System.loadLibrary(...), DT_NEEDED entries, and direct calls to dlopen(...) will fail in exactly the same way.
Users should have a consistent app experience across updates, and developers shouldnt have to make emergency app updates to handle platform changes. For that reason, we recommend against using private C/C++ symbols. Private symbols arent tested as part of the Compatibility Test Suite (CTS) that all Android devices must pass. They may not exist, or they may behave differently. This makes apps that use them more likely to fail on specific devices, or on future releases --- as many developers found when Android 6.0 Marshmallow switched from OpenSSL to BoringSSL.
In order to reduce the user impact of this transition, weve identified a set of libraries that see significant use from Google Plays most-installed apps, and that are feasible for us to support in the short term (including libandroid_runtime.so, libcutils.so, libcrypto.so, and libssl.so). In order to give you more time to transition, we will temporarily support these libraries; so if you see a warning that means your code will not work in a future release -- please fix it now!
$ readelf --dynamic libBroken.so | grep NEEDED 0x00000001 (NEEDED) Shared library: [libnativehelper.so] 0x00000001 (NEEDED) Shared library: [libutils.so] 0x00000001 (NEEDED) Shared library: [libstagefright_foundation.so] 0x00000001 (NEEDED) Shared library: [libmedia_jni.so] 0x00000001 (NEEDED) Shared library: [liblog.so] 0x00000001 (NEEDED) Shared library: [libdl.so] 0x00000001 (NEEDED) Shared library: [libz.so] 0x00000001 (NEEDED) Shared library: [libstdc++.so] 0x00000001 (NEEDED) Shared library: [libm.so] 0x00000001 (NEEDED) Shared library: [libc.so]
Potential problems: starting from API 24 the dynamic linker will not load private libraries, preventing the application from loading.
Resolution: rewrite your native code to rely only on public API. As a short term workaround, platform libraries without complex dependencies (libcutils.so) can be copied to the project. As a long term solution the relevant code must be copied to the project tree. SSL/Media/JNI internal/binder APIs should not be accessed from the native code. When necessary, native code should call appropriate public Java API methods.
A complete list of public libraries is available within the NDK, under platforms/android-API/usr/lib.
Note: SSL/crypto is a special case, applications must NOT use platform libcrypto and libssl libraries directly, even on older platforms. All applications should use GMS Security Provider to ensure they are protected from known vulnerabilities.
Missing Section Headers (Enforced since API 24)
Each ELF file has additional information contained in the section headers. These headers must be present now, because the dynamic linker uses them for sanity checking. Some developers try to strip them in an attempt to obfuscate the binary and prevent reverse engineering. (This doesnt really help because it is possible to reconstruct the stripped information using widely-available tools.)
$ readelf --header libBroken.so | grep section headers Start of section headers: 0 (bytes into file) Size of section headers: 0 (bytes) Number of section headers: 0 $
Resolution: remove the extra steps from your build that strip section headers.
Text Relocations (Enforced since API 23)
Starting with API 23, shared objects must not contain text relocations. That is, the code must be loaded as is and must not be modified. Such an approach reduces load time and improves security.
The usual reason for text relocations is non-position independent hand-written assembler. This is not common. Use the scanelf tool as described in our documentation for further diagnostics:
$ scanelf -qT libTextRel.so libTextRel.so: (memory/data?) [0x15E0E2] in (optimized out: previous simd_broken_op1) [0x15E0E0] libTextRel.so: (memory/data?) [0x15E3B2] in (optimized out: previous simd_broken_op2) [0x15E3B0] [skipped the rest]
If you have no scanelf tool available, it is possible to do a basic check with readelf instead, look for either a TEXTREL entry or the TEXTREL flag. Either alone is sufficient. (The value corresponding to the TEXTREL entry is irrelevant and typically 0 --- simply the presence of the TEXTREL entry declares that the .so contains text relocations). This example has both indicators present:
$ readelf --dynamic libTextRel.so | grep TEXTREL 0x00000016 (TEXTREL) 0x0 0x0000001e (FLAGS) SYMBOLIC TEXTREL BIND_NOW $
Note: it is technically possible to have a shared object with the TEXTREL entry/flag but without any actual text relocations. This doesnt happen with the NDK, but if youre generating ELF files yourself make sure youre not generating ELF files that claim to have text relocations, because the Android dynamic linker trusts the entry/flag.
Potential problems: Relocations enforce code pages being writable, and wastefully increase the number of dirty pages in memory. The dynamic linker has issued warnings about text relocations since Android K (API 19), but on API 23 and above it refuses to load code with text relocations.
Resolution: rewrite assembler to be position independent to ensure no text relocations are necessary. Check the Gentoo documentation for cookbook recipes.
Invalid DT_NEEDED Entries (Enforced since API 23)
While library dependencies (DT_NEEDED entries in the ELF headers) can be absolute paths, that doesnt make sense on Android because you have no control over where your library will be installed by the system. A DT_NEEDED entry should be the same as the needed librarys SONAME, leaving the business of finding the library at runtime to the dynamic linker.
Before API 23, Androids dynamic linker ignored the full path, and used only the basename (the part after the last /) when looking up the required libraries. Since API 23 the runtime linker will honor the DT_NEEDED exactly and so it wont be able to load the library if it is not present in that exact location on the device.
Even worse, some build systems have bugs that cause them to insert DT_NEEDED entries that point to a file on the build host, something that cannot be found on the device.
$ readelf --dynamic libSample.so | grep NEEDED 0x00000001 (NEEDED) Shared library: [libm.so] 0x00000001 (NEEDED) Shared library: [libc.so] 0x00000001 (NEEDED) Shared library: [libdl.so] 0x00000001 (NEEDED) Shared library: [C:Users uildAndroidcijnilibBroken.so] $
Potential problems: before API 23 the DT_NEEDED entrys basename was used, but starting from API 23 the Android runtime will try to load the library using the path specified, and that path wont exist on the device. There are broken third-party toolchains/build systems that use a path on a build host instead of the SONAME.
Resolution: make sure all required libraries are referenced by SONAME only. It is better to let the runtime linker to find and load those libraries as the location may change from device to device.
Missing SONAME (Used since API 23)
Each ELF shared object (native library) must have a SONAME (Shared Object Name) attribute. The NDK toolchain adds this attribute by default, so its absence indicates either a misconfigured alternative toolchain or a misconfiguration in your build system. A missing SONAME may lead to runtime issues such as the wrong library being loaded: the filename is used instead when this attribute is missing.
$ readelf --dynamic libWithSoName.so | grep SONAME 0x0000000e (SONAME) Library soname: [libWithSoName.so] $
Potential problems: namespace conflicts may lead to the wrong library being loaded at runtime, which leads to crashes when required symbols are not found, or you try to use an ABI-incompatible library that isnt the library you were expecting.
Resolution: the current NDK generates the correct SONAME by default. Ensure youre using the current NDK and that you havent configured your build system to generate incorrect SONAME entries (using the -soname linker option).
Please remember, clean, cross-platform code built with a current NDK should have no issues on Android N. We encourage you to revise your native code build so that it produces correct binaries.
Available link for download
Friday, February 10, 2017
I need developers to make AOSP Rom
I need developers to make AOSP Rom
Sent from my EVA-L19 using XDA-Developers mobile app
from xda-developers http://ift.tt/2aEzHKS
via IFTTT
Available link for download
Saturday, January 7, 2017
Grow your business on Google Play with help from the new Playbook for Developers app
Grow your business on Google Play with help from the new Playbook for Developers app
Posted by Dom Elliott, the Google Play team
| Today, the Playbook for Developers mobile app is now generally available for Android devices. The app helps you stay up-to-date with the features and best practices to grow your business on Google Play. Thanks to all our beta testers over the last six weeks whose feedback helped us tweak and refine the app in preparation for launch. Heres how you read and watch content in the Playbook for Developers app:
| ![]() |

The app supports Android 5.0 and above. If youre on an older device, check out our ebook, The Secrets to App Success on Google Play. We will be adding and updating content in the app to help you stay up-to-date and grow your business. Get the Playbook for Developers app today and then give us your feedback. The app is also available in the following languages: Bahasa Indonesia, Deutsch, español (Latinoamérica), le français, português do Brasil, ti?ng Vi?t, ??????? ?????, ???, ?? (??), ?? (??), and ???.
This is the second app weve released for Google Play developers. Get the Google Play Developer Console app to review your apps performance statistics and financial data, get notified about your apps status and publishing changes, and read and reply to user reviews on the go.

Available link for download
Saturday, December 10, 2016
Apple pushing iOS 10 beta 3 update to developers watchOS 2 2 2 to the public
Apple pushing iOS 10 beta 3 update to developers watchOS 2 2 2 to the public
Heads up, iOS 10 testers, because theres a new update for you to try.
iOS 10 beta 3 is now available for download. To grab it, youll need to be registered with Apples developer program, then download it over the air by going into Settings > General > Software Update or by getting it through Apples developer web portal.
from PhoneDog.com - Latest videos, reviews, articles, news and posts http://ift.tt/2anPOw7
via IFTTT
Available link for download
Tuesday, November 29, 2016
Find success on Google Play What app developers can learn from games
Find success on Google Play What app developers can learn from games
Posted by Matteo Vallone, Business Development Manager at Google Play
(As a way to reach more app developers and help them grow successful businesses on Google Play, this post was first published on The Next Web Ed.)
There is much common ground between freemium apps and games businesses when it comes to achieving success. Users are, however, more used to paying for games than apps, stemming from the history of traditional gaming consoles. Moreover, mobile games are also able to easily offer virtual goods across a range of price points to suit every pocket. This means that game developers have had plenty of opportunity to learn about how to improve onboarding, conversion, and ultimately the user Lifetime Value (LTV). So what can app developers learn from game developers? Here are some best practice tips and insights from successful game developers that can be applied to many apps, today.
Drive app success the game developer way:
1. Optimize retention before investing in acquisition
Retention is king, and retention drives conversion. For games developers, retention is the key measure of game quality and whether it appeals to players.
Most game developers will soft launch to beta testing communities or test markets. During this phase, the game is tweaked to optimize retention by looking into specific areas, such as tutorial completion, level difficulty and conversion. Developers can then track retention using the Cohorts reports in Google Analytics. Once retention is satisfactory, the developer can go to full launch and start investing in user acquisition.
2. Retain users with step-by-step engagement
The first seven days after install are the most critical for retention: users install several apps to try them, and decide in the first few days which ones they want to keep using. If you can retain for that time span, your app is more likely to become part of the users daily routine.
There are some simple ways to progressively build user engagement. Its important to present a strong story that explains why that app is relevant to the user, while introducing them to key features. Then place features that offer the user value early, so they can be found without much effort.
This is a not a one-size-fit-all. To find the right solution, a developer needs to first make assumptions on what user flows can improve retention and then run A/B tests to validate or correct them. For example, a developer could think that introducing sign-in later in the user flow might improve retention. Also, the developer needs to keep in mind what the key long term engagement metrics are for the individual app (such as photos uploaded or the number of articles read) and measure the impact of the different onboarding flows on those metrics as well.
In general, these principles are good places to start optimizing your onboarding:
- Look for ways to let the users experience the app straight away, rather than taking them through a long, complex setup.
- Present activation moments such as registering an account, uploading a video, or finding friend gradually
- Start by requiring minimal investment by the user, then ask them for more details as they are needed to use the apps features.
- Treat permissions as a service for the user. For example, if you want users to register, show them in advance that, by making their experience more personal, theyll get more value from the app.

Finally, ensure the user can understand the value of your app before you start asking them to pay. Game developers are particularly good at letting their users try most or all product features for free in in a set number of days or sessions.
A great tool to help analyze how users are engaging (or not) with the app is through the Flow Report in Google Analytics. Using this report, a developer can see how users navigate through the app and where they leave to identify potential roadblocks.
3. Target the right offers at the right users
Understanding different groups of users in-app purchase behavior is the key to devising strategies to encourage them to spend.
Start by identifying groups of users by how they spend and much they are likely to spend. It may be by age group, the channel that brought the install, or in-app behaviour. Use the Segment builder in Google Analytics to identify and define these groups of users. Then, tailor in-app purchase offers to match the segments spending behavior. For example, for segments where multiple users tend to spend more in one go, but spend infrequently, offer them in-app features bundled together.
4. Offer in-app purchases when users are most likely to spend
Users are also more likely to spend, if the purchasing experience is frictionless, and even more so when they can see how the expenditure will add value. So:
- Present purchase opportunities to users when theyre most likely to need or want it and explain to the user why its relevant.
- Make purchasing accessible easily from within the app with a minimum number of taps. For example, offer an upgrade button on the footer of relevant screens.

Like all good game developers, they focus on building good experiences that retain and engage users through constant testing and analytics. First impressions are important, so users need to be able to quickly understand the importance of the app and easily navigate through the onboarding experience. And to start generating revenue, it is important to be thoughtful about how to make in-app purchases actionable.
Watch Matteos Playtime 2015 session The rules of games, for apps to hear more in-depth insights which app developers can learn from games with best practices and developer examples:
You can also watch the other sessions from Google Playtime 2015 to learn more about tools and best practices which can help you find success with business on Google Play.
Available link for download
Thursday, November 10, 2016
Game developers get ready for our Developer Day at GDC 2016
Game developers get ready for our Developer Day at GDC 2016
Posted by Morgan Dollard, Product Manager of Google Play Games
Next week, well be in San Francisco to host our annual Developer Day at the Game Developers Conference (GDC). Join us to get a first look at our latest efforts to help developers of all sizes build successful mobile games businesses with powerful tools to develop high quality apps, grow a valuable user base, and earn more revenue.

Our Developer Day will take place in room 2020 of the West Hall of Moscone Center on Monday, March 14. Based on your feedback from last year, were going to keep presentations short and informative with lightning talks around virtual reality, the cloud, ads, and so much more, while dedicating more time to interactive discussions with Google engineers and your peers in the industry.
Heres a glimpse of the agenda on Monday, March 14:
Opening keynote || 10AM: Be the first to see whats new and hear about the investments Google is making to help mobile developers grow their game business.
Best practices for success on Google Play || 10:30AM: In this talk, youll learn how successful mobile game developers acquire users and bring them back to keep them playing longer.
Lightning talks || 11:15AM: A series of 5-minute talks on innovative technologies to tantalize players, like Project Tango, software to speed and simplify game development, and new ways to predict and prevent user churn.
Interactive roundtables || 2:00PM: After lunch, well break up into interactive roundtables to interact with Google experts and peers on how to build better and more successful games. Ask questions, tell Google product teams what you need, and learn from fellow game developers.
Visit the agenda page to get a full list of our talks and speaker details. Please note that these events are part of the official Game Developers Conference, so you will need a pass to attend.
For everyone who cant make it in person, well be live streaming our event on YouTube. Tune in from 10am on Monday, March 18.
Available link for download
Thursday, September 29, 2016
Google Developers teams up with General Assembly to launch Android Development Immersive training course
Google Developers teams up with General Assembly to launch Android Development Immersive training course
Posted by Peter Lubbers, Senior Program Manager, Google Developer Training
Today at the Big Android BBQ we announced that we have teamed up with General Assembly (GA), a global education institution transforming thinkers into creators, to create a new Android Development Immersive training course. This 12-week, full-time course will be offered beginning in January 2016 at GAs New York campus, and in February at GAs San Francisco campus and will roll out to additional campuses over the course of the next year. It is the first in-person training program of its kind that Google Developers has designed and built.

The Google Developer Relations team teamed up with General Assembly to ensure the Android Development Immersive bootcamp provides developers with access to the best instructors and latest and greatest hands-on material to create successful app experiences and businesses. To effectively reach over a billion of Android users globally, its important for developers to build high-quality apps that are beautifully designed, performant, and delightful to use.
We are constantly looking at the economy and job market for what skills are most in-demand. Demand for developers who can address this market and build new applications is tremendous, said Jake Schwartz, co-founder and CEO, General Assembly. Developing this course in partnership with Google Developers allows us to provide students with the most relevant skills, ensuring a reliable pipeline of talented developers ready to meet the urgent demand of companies in the Android ecosystem, a key component of GAs education-to-employment model."
Registration in the Android Development Immersive includes access to GAs career preparation services and support, also known as Outcomes, includes assistance in creating portfolio-ready projects, access to career development workshops, networking events, and coaching and support in the job search process. Through in-person hiring events, mock interviews & GAs online job search platform, graduates connect with GAs hiring partners, which consists of close to 2,000 employers globally.
One of these employers is Vice Media. "Im really excited to see the candidates coming out of the GA Android course. The fact that theyre working with both Google and potential employers to shape the curriculum around real-world problems will make a huge difference. Textbook learning is one thing, but classroom learning with practitioners is a level we have all been waiting for. In fact, Vice Media is going to be hiring an apprentice right out of this course," said Ben Jackson, Director of Mobile Apps for Vice Media.
Learn more and sign up here.
Available link for download
