Showing posts with label Android Developer Tips. Show all posts
Showing posts with label Android Developer Tips. Show all posts

Monday, May 6, 2019

Modern Android development: Android Jetpack, Kotlin, and more

This recommended video from Google I/O 2018 help developers understand how new APIs and features work together and learn what should use to build solid, modern Android applications.


Wednesday, December 12, 2018

Learn Android development with Google Codelabs

Google Developers Codelabs provide a guided, tutorial, hands-on coding experience. Most codelabs will step you through the process of building a small application, or adding a new feature to an existing application. They cover a wide range of topics such as Android Wear, Google Compute Engine, Project Tango, and Google APIs on iOS.



The Advanced Android Development course provides a series of codelabs that teach you how to add advanced features to your Android apps. You'll learn how to extend the user experience, monitor app performance, use geo features, make your apps accessible and implement advanced graphics. This is a follow on course to the Android Developer Fundamentals course.



Friday, October 12, 2018

Android Studio tips: improve build by setting org.gradle.jvmargs in Gradle script

Dex In Process (introduced from Android 2.1) is a feature that can improve build times, as well as Instant Run performance. To take advantage of Dex In Process, you’ll need to modify your gradle.properties file and increase the amount of memory allocated to the Gradle Daemon VM to a minimum of 2 Gb, using the org.gradle.jvmargs property.

org.gradle.jvmargs=-Xmx2048m



reference:


Learn more here about how to enable Dex In Process: Faster Android Studio Builds with Dex In Process




Saturday, March 17, 2018

Adding Picture in Picture to your App


An overview of adding Picture in Picture support for Android apps. With Android O apps, you can use Picture in Picture on phones to create magical experiences by overlaying other content during critical user tasks like watching a video or navigating.

PIP Blog Post: https://goo.gl/DxVADC
PIP Navigation Patterns: https://goo.gl/DxVADC
Sample: https://goo.gl/kU7wqV
Docs: https://goo.gl/8xzpxv
Handle Configuration Changes: https://goo.gl/ABPJ9w


Tuesday, January 30, 2018

What's New in Android Oreo for Developers


Android Oreo is available to consumers. Here's a summary of what you need to know to make sure that these early adopters have a great experience, along with ways to enhance that experience with new O features and the support library.

Introducing Android 8.0 Oreo: https://goo.gl/X4CGFR
Support Library https://goo.gl/rOJEa7

Wednesday, September 6, 2017

What’s New in Support Library v26

Support Library v26 comes with a lot of new features, specifically: fonts as resources and downloadable fonts, access to backwards compatible emoji support via the new EmojiCompat library, the ability to allow the text size of your TextView to expand or contract automatically to fill its layout, the option to implement animations driven by physics forces with the ‘spring and fling’ animations, improved parity with the Android framework, various form factors such as Wear and TV, and, finally, a library slimmed down by moving minSdk to 14 and dropping 1.4k methods.


For more info, check out:
Support Library Docs: https://goo.gl/rOJEa7

What's New in Android Support Library, Google I/O '17 talk:

Sunday, April 3, 2016

Remote debug web page on Android with Chrome DevTools


This video show how to remote debug web page on Android from PC, with Chrome DevTools.


In order to remote debug on Android device, you have to enable Developer options and USB debugging on your Android device.

details: Google Developers > Chrome DevTools > Remote Debugging Devices


Monday, March 7, 2016

To know how many devices running various Android version, screen size and Open GL version?

Do you want to know how many devices running various Android version?

Android Developers Dashboards provides information about the relative number of devices that share a certain characteristic, such as Android version, screen size and Open GL Version.

The Google Play Developer Console also provides detailed statistics about your users' devices. Those stats may help you prioritize the device profiles for which you optimize your app.


Wednesday, May 13, 2015

How to enable Developer Options on Xiaomi Redmi 2



To enable Developer Options on Xiaomi Redmi 2 (紅米手機2), running Android 4.4.4:
> Settings
> About phone
> Tap on "MIUI version" 7 times to enable Developer Options.

Once enabled, to access Developer Options:
> Settings
> Additional settings
> Developer options



Monday, January 26, 2015

How to fix "Found 2 versions of android-support-v4.jar in the dependency list"

Recently after updated SDK on Android-Eclipse, tried to import my old example, and have the following error reported:

Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
...

My solution is to delete the file android-support-v4.jar in libs folder of my project.

Wednesday, January 7, 2015

The processing instruction target matching "[xX][mM][lL]" is not allowed

If you get the following error in your AndroidManifest.xml, especially when you copy and paste from web:
Parser exception for /.../AndroidManifest.xml: The processing instruction target matching "[xX][mM][lL]" is not allowed.


Most probably there are some character exists before the <?xml ?> declaration, visible or invisible. Make sure delete anything before <?xml ?>, or even delete the whole line and re-type manually.

check the video demo:

Friday, December 5, 2014

Offline GDG Developer Kit available

GDG Dev Kit Pilot (https://sites.google.com/site/gdgdevkitpilotreadme/) is a pack of 4 DVDs (also available in a limited number of single USB thumb drives) containing useful content for developers who work with Google technologies and APIs.

The developer kit is meant for software developers or students of software development in regions of the world where steady access to the internet is expensive , unreliable or non-existent.


Each pack contains the following :
This content is current as at August 2014

Read details: https://sites.google.com/site/gdgdevkitpilotreadme/

Download link.


Tuesday, November 4, 2014

Get your app in the Google index

Get your app in the Google index — and be ready for the future of search! Try the hands-on codelab at: http://bit.ly/index-my-app.

Google set out to index to mobile apps, to bringing accessibility and discoverability to them. App Indexing is the ability for Google to index apps just like websites. Deep links to your Android app appear in Google Search results so users can get to your native mobile experience quickly, landing exactly on the right content within the app.
  • Drive return visits to your app
    For users who have your app installed, having deep links appear in search results will help drive organic traffic back to your app.
  • Re-engage your users
    For users who have viewed pages in your app, and later searches for similar content, you can use the App Indexing API to have deep links appear in search suggestions. For example, a user visits a pizza restaurant page in an app. The next time the user searches for pizza, a deep link will appear in search suggestions before seeing search results.
Create a seamless experience for your users App indexing is flexible—you can direct search users to your app or website on a page by page basis. Moving from search results to apps is seamless, without any pop-ups or extra taps to slow users down.


To learn more, check out: https://developers.google.com/app-indexing


Monday, September 22, 2014

Run Systrace in Android-Eclipse


The Systrace tool helps analyze the performance of your application by capturing and displaying execution times of your applications processes and other Android system processes. The tool combines data from the Android kernel such as the CPU scheduler, disk activity, and application threads to generate an HTML report that shows an overall picture of an Android device’s system processes for a given period of time.

The Systrace tool is particularly useful in diagnosing display problems where an application is slow to draw or stutters while displaying motion or animation. For more information on how to use Systrace, see Analyzing Display and Performance.


Keyboard shortcuts that are available while viewing a Systrace trace HTML report.


Tuesday, September 16, 2014

"The import android.support.v7 cannot be resolved" and "ActionBarActivity cannot be resolved to a type"

It's a common error "The import android.support.v7 cannot be resolved" on import android.support.v7.app.ActionBarActivity; and "ActionBarActivity cannot be resolved to a type" on extends ActionBarActivity. It may be various reason to cause it. One of the reason is the auto-generated project appcompat_v7 closed.

Please check the video:

Friday, September 5, 2014

Android ADB device offline

When I run the adb command to list devices, it show my connected device with "offline", and I cannot issue any command on it.

My solution is to run Task Manager (on Ubuntu) and kill the running adb, then re-run adb again, problem solved:)


Thanks for Vladislav Ivanov comment. You can also enter the command:

adb kill-server

and then
adb start-server



Related:
- Setup Android adb for Wifi debug

Friday, August 29, 2014

Setup Android adb for Wifi debug



To enable Android Debug Bridge (adb) debug via WiFi, connect IP address with the command:

$ adb connect <Android device IP>

or

$ adb connect <Android device IP>:<port>

example:
$ adb connect 192.168.1.111
(the default port number is 5555)

remark:
In my own case, i need to run the command adb tcpip (with usb connected) before connect at the first time:
adb tcpip 5555


FAQ:
- Android ADB device offline
- unable to connect to <ip address>:<port>


Sunday, August 24, 2014

Android Eclipse tips: switch between Automatic and manual target modes

In Eclipse and ADT, you can select launching your app automatically select suitable AVD/device, or manually select.

By default, a run configuration uses the automatic target mode in order to select an AVD/device. If your run configuration uses manual mode, then the "device chooser" is presented every time that your application is run, so that you can select which AVD/device to use.
http://developer.android.com/tools/building/building-eclipse.html#RunConfig

To set Run Configuration:
  • Right click your project -> Run As -> Run Configurations...
  • or, Click the arrow (downward) beside the Play button (green arrow) on the top menu -> Run Configurations...
In Run Configuration Dialog, select your project under Android Application on the left, select Target, then select your expect Deployment Target Selection Mode.



Thursday, August 7, 2014

Android-Ecipse tips: Manually run Content Assist

Recently I re-installed Android ADT-Eclipse, but the Content Assist feature not work, even press Ctrl+Space. Content Assist can be run manually by click Edit -> Content Assist.

Saturday, July 26, 2014

'Android SDK Content Loader' has encountered a problem - parseSdkContent failed

After install fresh Ubuntu 14.04.1 and Eclipse ADT with Android SDK, 'Android SDK Content Loader' has encountered a problem of parseSdkContent failed, Could not initialize class android.graphics.Typeface.


To fix it, delete Android L (API 20, L preview) in Android SDK Manager and restart Eclipse. It work in my case. Even re-install Android L (API 20, L preview).