tag:blogger.com,1999:blog-40237753372234556012024-02-23T02:39:06.736+05:30Vardhan Blog - My ExperiencesThis blog is to share the knowledge or tech tips in Java, Android, iOS and more..., which I came across in my Career.Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.comBlogger105125tag:blogger.com,1999:blog-4023775337223455601.post-47781384964972877632023-02-16T16:04:00.005+05:302023-02-16T16:04:48.504+05:30dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/lib/arm64/libfolly_runtime.so"<p><span style="font-family: Nunito;">dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/xadfadsfas==/xxxxxxx==/lib/arm64/libfolly_runtime.so"</span></p><p><span style="font-family: Nunito;"><br /></span></p><p><span style="font-family: Nunito;">https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt</span></p><p><span style="font-family: Nunito;">target_compile_options(folly_runtime PUBLIC ${folly_FLAGS})</span></p><p><span style="font-family: Nunito;">target_include_directories(folly_runtime PUBLIC .)</span></p><p><span style="font-family: Nunito;">Where, In the app. we need to check runtime libraries, </span></p><p><span style="font-family: Nunito;">Which will be residing under jniLibs folder.</span></p><p><span style="font-family: Nunito;"><span face="Roboto, "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", "Noto Sans Thai", "Noto Sans Hebrew", "Noto Sans Bengali", sans-serif" style="background-color: white; color: #202124;">If your application includes multiple shared libraries, you should use </span><code dir="ltr" style="border-radius: var(--devsite-inline-code-border-radius,0); border: var(--devsite-inline-code-border,0); box-sizing: inherit; color: var(--devsite-code-color); direction: ltr; font: 500 90%/1 var(--devsite-code-font-family); padding: var(--devsite-inline-code-padding,1px 4px); word-break: break-word;" translate="no">libc++_shared.so</code><span face="Roboto, "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", "Noto Sans Thai", "Noto Sans Hebrew", "Noto Sans Bengali", sans-serif" style="background-color: white; color: #202124;">.</span></span></p><p style="background-color: white; box-sizing: inherit; color: #202124; margin: 16px 0px; padding: 0px;"><span style="font-family: Nunito;">On Android, the libc++ used by the NDK is not the same as the one that's part of the OS. This gives NDK users access to the latest libc++ features and bug fixes even when targeting old versions of Android. The trade-off is that if you use <code dir="ltr" style="background: var(--devsite-code-background); border-radius: var(--devsite-inline-code-border-radius,0); border: var(--devsite-inline-code-border,0); box-sizing: inherit; color: var(--devsite-code-color); direction: ltr; font: 500 90%/1 var(--devsite-code-font-family); padding: var(--devsite-inline-code-padding,1px 4px); word-break: break-word;" translate="no">libc++_shared.so</code>, you must include it in your app. If you're building your application with Gradle this is handled automatically.</span></p><p style="background-color: white; box-sizing: inherit; color: #202124; margin: 16px 0px; padding: 0px;"><span style="font-family: Nunito;">Old versions of Android had bugs in PackageManager and the dynamic linker that caused installation, update, and loading of native libraries to be unreliable. In particular, if your app targets a version of Android earlier than Android 4.3 (Android API level 18), and you use <code dir="ltr" style="background: var(--devsite-code-background); border-radius: var(--devsite-inline-code-border-radius,0); border: var(--devsite-inline-code-border,0); box-sizing: inherit; color: var(--devsite-code-color); direction: ltr; font: 500 90%/1 var(--devsite-code-font-family); padding: var(--devsite-inline-code-padding,1px 4px); word-break: break-word;" translate="no">libc++_shared.so</code>, you must load the shared library before any other library that depends on it.</span></p><p><span style="font-family: Nunito;"><span face="Roboto, "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", "Noto Sans Thai", "Noto Sans Hebrew", "Noto Sans Bengali", sans-serif" style="background-color: #e1f5fe; color: #01579b;">libc++ is not a system library. If you use </span><code dir="ltr" style="border-radius: var(--devsite-inline-code-border-radius,0); border: 0px; box-sizing: inherit; color: #01579b; direction: ltr; font-weight: 700; padding: 0px; word-break: break-word;" translate="no">libc++_shared.so</code><span face="Roboto, "Noto Sans", "Noto Sans JP", "Noto Sans KR", "Noto Naskh Arabic", "Noto Sans Thai", "Noto Sans Hebrew", "Noto Sans Bengali", sans-serif" style="background-color: #e1f5fe; color: #01579b;">, it must be included in your app. If you're building your application with Gradle this is handled automatically.</span></span></p><p><span style="font-family: Nunito;">run the command </span><span style="font-family: Nunito; font-variant-ligatures: no-common-ligatures;">nm -gD libc++_shared.so</span></p><p><span style="font-family: Nunito;"><span style="font-variant-ligatures: no-common-ligatures;">Where </span>__emutls_get_address method is missing in the <span style="font-variant-ligatures: no-common-ligatures;">libc++_shared.so, Update the latest </span><span style="font-variant-ligatures: no-common-ligatures;">libc++_shared.so, the problem will be solved</span></span></p>Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-18135624186660326252022-12-30T15:17:00.002+05:302022-12-30T15:17:42.867+05:30Android INSTALL_FAILED_INVALID_APK base.apk is missing <p><span style="background-color: white;"><br /></span></p><p><span style="background-color: white;">I</span><span style="background-color: white; color: #232629; font-family: -apple-system, "system-ui", "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-size: 15px;">ssue was caused by </span><code style="border-radius: var(--br-sm); border: 0px; box-sizing: inherit; color: #232629; font-family: var(--ff-mono); font-size: var(--_pr-code-fs); font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: var(--su2) var(--su4); vertical-align: baseline; white-space: pre-wrap;"><b>testCoverageEnabled true</b></code><span style="background-color: white; color: #232629; font-family: -apple-system, "system-ui", "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-size: 15px;"> in build.gradle, Latest gradle versions above 7.3 have the issue with jacoco</span></p>Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-46994609974937591152015-10-19T10:24:00.000+05:302015-10-26T10:29:39.717+05:30Google Maps No Longer Requires STORAGE Permission!<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 class="western">
<span style="font-size: small; font-weight: normal;"><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif; line-height: 158%;">For
a long time, Google Maps Android SDK requires us to have
</span><span style="line-height: 158%;"><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">WRITE_EXTERNAL_STORAGE
</span></span><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif; line-height: 158%;">permission.
It was not the case when they first released the SDK.</span></span></h3>
<pre class="western" style="border: none; margin-top: 0.45in; padding: 0in;"><span style="font-family: Menlo, Monaco, Courier New, Courier, monospace;"><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission></span></pre>
<div style="line-height: 158%; margin-bottom: 0in; margin-top: 0.4in;">
<a href="https://www.blogger.com/null" name="4b77"></a><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">I
didn’t want to have that storage permission first, because In app permission “The
permission description says that the application can access </span><em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">files
on the devices such as images, videos or audio”</span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">. </span></div>
<div style="line-height: 158%; margin-bottom: 0in; margin-top: 0.4in;">
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif; line-height: 158%;">I
had lots of </span><strong style="line-height: 158%;"><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">1,
2, 3 stars </span></strong><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif; line-height: 158%;">in
app ratings because of this. Users say that “</span><em style="line-height: 158%;"><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">Why
do you request access for my photos and videos?</span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif; line-height: 158%;">”.
They are right! They are always right. I don’t want to access your
photos and I won’t. I am forced to have that permission.</span></div>
<div style="margin-bottom: 0in; margin-top: 0.4in;">
<span style="line-height: 158%;"><a href="https://www.blogger.com/null" name="f1bc"></a></span>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif; line-height: 158%;">A</span><em style="line-height: 158%;"><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">ndroid
Marshmallow </span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="line-height: 158%;">brought
us </span><span style="line-height: 25.28px;">run-time</span><span style="line-height: 158%;"> permissions. They are great! Users do not see permissions
when they install or update the app. Users have more control over the
app’s functionality.</span></span></div>
<div style="line-height: 158%; margin-bottom: 0in; margin-top: 0.4in;">
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">for
example, a user could choose to give a camera app access to the
camera but not to the device location.</span></div>
<div style="line-height: 158%; margin-bottom: 0in; margin-top: 0.3in;">
<a href="https://www.blogger.com/null" name="081a"></a>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">But
imagine you have an app with </span><em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">Google
Maps </span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">integration,
and imagine you have to request </span><strong><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">WRITE_EXTERNAL_STORAGE
</span></strong><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">on
runtime to show the map. How would you explain that to users? Runtime
permissions that are not obvious and require explanation are the
worse. This is one of them.</span></div>
<div style="line-height: 158%; margin-bottom: 0in; margin-top: 0.3in;">
<a href="https://www.blogger.com/null" name="e589"></a>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">Fortunately,
they fixed the issue and removed storage permission. But not for all,
just for Android Marshmallow.</span></div>
<div style="line-height: 158%; margin-bottom: 0in; margin-top: 0.3in;">
<a href="https://www.blogger.com/null" name="8a95"></a>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">If
you use </span><em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">Google
Maps </span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">and
you want to target </span><em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">Android
Marshmallow</span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">,
this is what you need to do:</span></div>
<ul>
<li><div style="border: none; line-height: 158%; margin-bottom: 0.15in; padding: 0in;">
<a href="https://www.blogger.com/null" name="5a5c"></a>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">First
you need to use </span><em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">Google
Play Services 8.1.0</span></span></em></div>
</li>
<li><div style="border: none; line-height: 158%; margin-bottom: 0in; padding: 0in;">
<a href="https://www.blogger.com/null" name="be8e"></a>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">Second,
you need to add </span><em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-style: normal;">maxSdkVersion
</span></span></em><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">property
in your permissions as shown below:</span></div>
</li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTLFoXpOM-A7mKlESBTBvL6zhgAuUhwP4LfOQmUN8Ski6qKRiJ-gDePf0azZZFPP7SISCF9Idv3wB5Nu5E2LwZ82g8laSVEp-FNLXNUIzx4IVnMkFAkfj45tQRRf5oST7LxmZqf-iezQw/s1600/perm.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="139" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTLFoXpOM-A7mKlESBTBvL6zhgAuUhwP4LfOQmUN8Ski6qKRiJ-gDePf0azZZFPP7SISCF9Idv3wB5Nu5E2LwZ82g8laSVEp-FNLXNUIzx4IVnMkFAkfj45tQRRf5oST7LxmZqf-iezQw/s640/perm.png" width="640" /></a></div>
<br />
<br />
<br />
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">They
also say in the </span><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><a href="https://developers.google.com/maps/documentation/android-api/config#add_the_required_settings_to_your_apps_manifest">documentation</a>
</span><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;">that
they will remove it completely in the next release.</span></div>
<blockquote style="border: none; line-height: 158%; margin: 0.3in 0in 0in; padding: 0in;">
<a href="https://www.blogger.com/null" name="9a94"></a>
<span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><i>From
the next release of the Google Play services SDK, the requirement for
the WRITE_EXTERNAL_STORAGE permission will be completely dropped from
the Google Maps Android API.</i></span></blockquote>
<br />
<h3 class="western" style="line-height: 114%; margin-bottom: 0in; margin-top: 0.58in;">
<span style="font-size: small;"><span style="font-family: medium-content-sans-serif-font, Lucida Grande, Lucida Sans Unicode, Lucida Sans, Geneva, Verdana, sans-serif;">Note:
</span><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-weight: normal;">Please
do the described changes in your application if you have Google Maps
and want to target Android M!</span></span></span></h3>
<div>
<span style="font-size: small;"><span style="font-family: medium-content-serif-font, Georgia, Cambria, Times New Roman, Times, serif;"><span style="font-weight: normal;"><br /></span></span></span></div>
<div>
<div style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px; margin: 0in;">
<span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px; margin: 0in;">
<span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<div style="margin-bottom: 0in;">
<br style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;" /></div>
<div class="MsoNormal" style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;">
<span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 17.6333px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments. feedback are welcome...</span></div>
</div>
</div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-71769760547338796942015-10-01T10:04:00.002+05:302015-10-01T10:04:41.877+05:30Small Note on Parse Vs Firebase <div style="line-height: 0.23in; margin-bottom: 0in; orphans: 2; widows: 2;">
<span style="font-family: Times New Roman, serif;"><span style="color: #555555;">For
mobile app developers, picking and choosing a server or cloud
solution for things like storage, push notifications, user
information and analytics can be a struggle.</span> </span>
</div>
<div style="line-height: 0.23in; margin-bottom: 0in; orphans: 2; widows: 2;">
<br />
</div>
<div style="line-height: 0.23in; margin-bottom: 0in; orphans: 2; widows: 2;">
We have few servers like parse, firebase and more which helps us in
doing all the job of backend without writing a single line of code.</div>
<div style="line-height: 0.23in; margin-bottom: 0in; orphans: 2; widows: 2;">
<br />
</div>
<div style="line-height: 0.23in; margin-bottom: 0in; orphans: 2; widows: 2;">
We will compare Parse Vs Firebase in the post.</div>
<div style="line-height: 0.23in; margin-bottom: 0in; orphans: 2; widows: 2;">
<br />
</div>
<div style="margin-bottom: 0in;">
Heads up: you're comparing apples to
oranges. Tools belonging to different groups are often not directly
comparable because they usually have different intended purposes,
benefits and need.</div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<br />
</div>
<table border="1" bordercolor="#000001" cellpadding="4" cellspacing="0" style="width: 665px;">
<colgroup><col width="212"></col>
<col width="214"></col>
<col width="213"></col>
</colgroup><tbody>
<tr valign="TOP">
<td bgcolor="#ffffff" width="212">
<br />
<br />
</td>
<td bgcolor="#ffffff" width="214">
<h2 class="western">
<span style="font-size: medium;">Firebase</span></h2>
</td>
<td bgcolor="#ffffff" width="213">
<h2 class="western">
<span style="font-size: medium;">Parse</span></h2>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Description</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER" style="orphans: 2; widows: 2;">
<span style="color: black;">Real-time
cloud data service </span>
</div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER" style="orphans: 2; widows: 2;">
<span style="color: black;">Complete
technology stack for building mobile apps </span>
</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Storage</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">NoSQL</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">SQL</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Setup</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">Easy</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">Easy</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Documentation</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">Great Documentation</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">Well documented</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Hosting</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">Yes</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">Yes</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Supports</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">Android/iOS/REST/Web</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">Android/iOS/REST/Web/PHP/.NET
and more</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" height="298" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Authentication</span></h2>
<br />
<br />
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER" style="orphans: 2; widows: 2;">
<span style="color: black;">Firebase
makes authentication easy. It can integrate with your existing
login server, or authenticate users with only client-side code. It
has built-in functionality for email & password, and
third-party providers such as Facebook, Twitter, GitHub, and
Google.</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER" style="orphans: 2; widows: 2;">
<span style="color: black;">Users
can be created through traditional username/password signup,
through a third-party login system like Facebook or Twitter, or
even by using Parse's </span><a href="https://www.blogger.com/blogger.g?blogID=4023775337223455601#users-anonymous-users">automatic
anonymous users</a><span style="color: black;"><b> f</b></span><span style="color: black;">unctionality.
</span>
</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Offline/Local Data Storage</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
Yes</div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
Yes</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Analytics</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
Yes</div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
Yes</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Security & Rules</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
Yes</div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
Yes</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">File Storage</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
No</div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
Yes</div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Push Notification</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">No</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">Yes</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Realtime Communcation</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">Yes</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">No</span></div>
</td>
</tr>
<tr>
<td bgcolor="#ffffff" valign="TOP" width="212">
<h2 class="western">
<span style="font-size: medium;">Crash Reporting</span></h2>
</td>
<td bgcolor="#ffffff" width="214">
<div align="CENTER">
<span style="color: black;">No</span></div>
</td>
<td bgcolor="#ffffff" width="213">
<div align="CENTER">
<span style="color: black;">Yes</span></div>
</td>
</tr>
</tbody></table>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
More info: <a href="https://www.blogger.com/blogger.g?blogID=4023775337223455601#more">http://stackshare.io/stackups/firebase-vs-parse#more</a></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px; margin: 0in;">
<span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px; margin: 0in;">
<span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<div style="margin-bottom: 0in;">
<br style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;" /></div>
<div class="MsoNormal" style="background-color: #fefdfa; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18.2px;">
<span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 17.6333px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments. feedback are welcome...</span></div>
<br />
<div style="margin-bottom: 0in;">
<br />
</div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-89692199897732185592015-03-01T16:42:00.000+05:302015-04-28T16:44:45.893+05:30Android and the DEX 64K Methods Limit & Online Tool<div style="margin-bottom: 0.2in;">
<span style="font-family: Times New Roman, serif;">Our
apps are limited to a 64K method reference limit. If your app reaches
this limit, the build process outputs the following error
message:<br /><br /><span style="color: red;">Unable to execute dex: method ID not in [0, 0xffff]:
65536</span></span></div>
<h3 class="western">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Tools
</span></span>
</h3>
<div style="margin-left: 0.49in;">
<a href="https://www.blogger.com/null" name="solutions"></a><span style="font-family: Times New Roman, serif;">This
is a drap and drop tool which helps us to find the number of method
in apk <a href="http://inloop.github.io/apk-method-count/">http://inloop.github.io/apk-method-count/</a>.
</span>
</div>
<div style="margin-left: 0.49in;">
<span style="font-family: Times New Roman, serif;">Which
helps us to be in safe-guard in optimizing things. Know we need some solutions to optimize the problem. Let find them</span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Solutions</span></span></span></h3>
<h3 class="western">
<a href="https://www.blogger.com/null" name="multidex"></a>
<span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">MultiDex</span></span></span></h3>
<div style="line-height: 0.25in; margin-left: 0.49in; orphans: 1;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">MultiDex
allows you to use multiple DEX files contained within one APK. With a
few steps, your classes will split automatically into several DEX
files (</span></span><em><span style="color: black;"><span style="font-family: Times New Roman, serif;">classes.dex</span></span></em><span style="color: black;"><span style="font-family: Times New Roman, serif;">,</span></span><em><span style="color: black;"><span style="font-family: Times New Roman, serif;">classes2.dex</span></span></em><span style="color: black;"><span style="font-family: Times New Roman, serif;">,
</span></span><em><span style="color: black;"><span style="font-family: Times New Roman, serif;">classes3.dex</span></span></em><span style="color: black;"><span style="font-family: Times New Roman, serif;">,
etc) in case you reach the method index limit.</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span>
</div>
<div style="line-height: 0.25in; orphans: 1;">
<a href="https://www.blogger.com/null" name="proguard"></a><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>ProGuard</b></span></span></span></div>
<div style="line-height: 0.25in; margin-left: 0.49in; orphans: 1;">
<a href="https://developer.android.com/tools/help/proguard.html"><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;">ProGuard</span></span></span></a><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">is
a tool that shrinks, optimizes and obfuscates your code by removing
unused code and renaming classes, fields and methods with
semantically obscure names.</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span>
</div>
<h3 class="western">
<a href="https://www.blogger.com/null" name="jarjar"></a><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">JarJar</span></span></span></h3>
<div style="margin-left: 0.49in;">
<a href="https://code.google.com/p/jarjar/"><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;">Jar
Jar Links</span></span></span></a><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">is
a utility that makes it easy to repackage Java libraries and embed
them into your own distribution.</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span>
</div>
<h2 class="western">
<a href="https://www.blogger.com/null" name="conclusion"></a><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Conclusion</span></span></span></h2>
<div style="margin-left: 0.49in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">At
this point, Google Play Services is perhaps the biggest common threat
on your methods count. I would love to see this API broken into
separate modules. A </span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><a href="http://jakewharton.com/play-services-is-a-monolith/">detailed
summary of this problem</a> </span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">was
published a while ago by Jake Wharton & </span></span><a href="https://www.contentful.com/blog/2014/10/30/android-and-the-dex-64k-methods-limit/" style="font-family: 'Times New Roman', serif;" target="_blank">Android and the dex 64k methods limit</a> by Tom Renzik<span style="font-family: 'Times New Roman', serif;">, so feel free to dive into that
as well.</span></div>
<div style="margin-left: 0.49in;">
<span style="font-family: 'Times New Roman', serif;"><br /></span></div>
<div style="margin-left: 0.49in;">
<span style="font-family: 'Times New Roman', serif;">Another
</span><a href="http://cyrilmottier.com/2014/08/26/putting-your-apks-on-diet/" style="font-family: 'Times New Roman', serif;">interesting
blog post</a><span style="font-family: 'Times New Roman', serif;"> </span><span style="font-family: 'Times New Roman', serif;">was published a while ago by Cyril Mottier,
illustrating how to reduce APK size using various different
techniques. </span></div>
<div style="margin-left: 0.49in;">
<br />
</div>
<div style="margin-left: 0.49in;">
<br /></div>
<br />
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-themecolor: background1; mso-themeshade: 128;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-themecolor: background1; mso-themeshade: 128;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div style="margin-left: 0.49in;">
</div>
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 115%; mso-themecolor: background1; mso-themeshade: 128;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments.</span></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-15846900416125019272015-02-25T18:58:00.001+05:302015-02-25T18:58:56.070+05:30Usage of Android manifestmerger<div style="border: none; line-height: 0.23in; margin-bottom: 0.19in; padding: 0in;">
<span style="color: #242424;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Before going into manifestmerger, we will have questions why to merge?</span></span></span></div>
<div style="border: none; line-height: 0.23in; margin-bottom: 0.19in; padding: 0in;">
<span style="color: #242424;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Let start ...</span></span></span></div>
<div style="border: none; line-height: 0.23in; margin-bottom: 0.19in; padding: 0in;">
<span style="color: #242424;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Why
to merge manifest files?</b></span></span></span></div>
<div style="border: none; line-height: 0.23in; margin-bottom: 0.19in; padding: 0in;">
<span style="color: #242424;"><span style="font-family: Times New Roman, serif;">Assume
we have a multiple libraries and each of them contribute
Activity/Receiver/Services and many more into the application.
Managing all in one manifest files makes like miserable.</span></span></div>
<div style="border: none; line-height: 0.23in; margin-bottom: 0.19in; padding: 0in;">
<span style="color: #242424;"><span style="font-family: Times New Roman, serif;">To
solve the above approach, we can manage their own
Activity/Receiver/Services and more in their own manifest file and
build time, we can combined all together.</span></span></div>
<div style="border: none; line-height: 0.23in; margin-bottom: 0.19in; padding: 0in;">
<span style="color: #242424;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Now,
how to merge manifest file?</b></span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: #258aaf;"><span style="font-family: Times New Roman, serif;"><a href="http://developer.android.com/tools/sdk/eclipse-adt.html?q=manifestmerger.enabled#">ADT
20.0.0</a> </span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">introduced
new property to help in merging the manifest files, which helps in
merging all the manifest files using property “</span></span><span style="color: #006600;"><span style="font-family: Times New Roman, serif;">manifestmerger.enabled</span></span><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">“.</span></span></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>What
</b></span></span></span><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>the
</b></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>manifestmerger.enabled
</b></span></span></span></code><code class="western"><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>do?</b></span></span></span></code></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<code class="western"><span style="color: black;"><span style="font-family: Times New Roman, serif;">It
automatically merges the library project manifest files into the
including project's manifest. Just by using the
</span></span></code><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;">manifestmerger.enabled
</span></span></code><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;">property,
we can enable this feature.</span></span></code></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">We
need to add this property in the project.properties file of your
project.</span></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>What
errors we may face?</b></span></span></span></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="color: black;">If
the configuration is done properly in the manifest file, we may face
</span>“Unknown error merging manifest”
Android Manifest Merger Problem.</span></div>
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><b>Solution
to solve this exception:</b> </span>
</div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><b><br /></b></span></div>
<div style="margin-bottom: 0in;">
<code class="western"><span style="font-family: Times New Roman, serif;">Be
clear in using of </span></code><code class="western"><span style="color: #6666ff;"><span style="font-family: Times New Roman, serif;">android:targetSdkVersion</span></span></code><code class="western"><span style="font-family: Times New Roman, serif;">
and </span></code><code class="western"><span style="color: #6666ff;"><span style="font-family: Times New Roman, serif;">android:minSdkVersion</span></span></code><code class="western"><span style="font-family: Times New Roman, serif;">.
</span></code>
</div>
<div style="margin-bottom: 0in;">
<code class="western"><span style="font-family: Times New Roman, serif;">Your
minSdkVersion of library should not be less than your project
minSdkVersion and Your targetSdkVersion of library should not be more
in than your project manifest file.</span></code></div>
<br />
<div style="margin-bottom: 0in;">
<br />
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-themecolor: background1; mso-themeshade: 128;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-themecolor: background1; mso-themeshade: 128;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 115%; mso-themecolor: background1; mso-themeshade: 128;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments.</span></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-52573717359018196272014-11-06T12:26:00.002+05:302014-11-06T12:31:42.229+05:30Android : Usages & Issues of Toolbar (Material Compatibility) in Appcompat 21<h3 class="western">
<span style="font-family: Georgia, Times New Roman, serif;">
Toolbar Widget</span></h3>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><code class="western"><span style="color: #333333;">Toolbar</span></code><span style="color: #333333;">
is fully supported in AppCompat and has feature and API parity with
the framework widget. In AppCompat,</span><code class="western"><span style="color: #333333;">Toolbar</span></code><span style="color: #333333;">
is implemented in the </span><span style="color: navy;"><span lang="zxx"><a href="https://developer.android.com/reference/android/support/v7/widget/Toolbar.html"><span style="color: #258aaf;">android.support.v7.widget.Toolbar</span></a></span></span><span style="color: #333333;">
class. There are two ways to use </span><code class="western"><span style="color: #333333;">Toolbar</span></code><span style="color: #333333;">:</span></span></div>
<ul>
<li><div align="JUSTIFY" style="border: none; line-height: 0.19in; margin-bottom: 0in; padding: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;">Use
a </span><code class="western"><span style="color: #333333;">Toolbar</span></code><span style="color: #333333;">
as an Action Bar when you want to use the existing Action Bar
facilities (such as menu inflation and selection,
</span><code class="western"><span style="color: #333333;">ActionBarDrawerToggle</span></code><span style="color: #333333;">,
and so on) but want to have more control over its appearance.</span></span></div>
</li>
<li><div align="JUSTIFY" style="border: none; line-height: 0.19in; padding: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;">Use
a standalone </span><code class="western"><span style="color: #333333;">Toolbar</span></code><span style="color: #333333;">
when you want to use the pattern in your app for situations that an
Action Bar would not support; for example, showing multiple toolbars
on the screen, spanning only part of the width, and so on.</span></span></div>
</li>
</ul>
<div align="JUSTIFY" style="border: none; line-height: 0.2in; margin-bottom: 0.16in; padding: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;">Toolbar
supports a more focused feature set than ActionBar. </span><span style="color: #222222;"><span style="font-size: 10pt;">From
start to end, a toolbar may contain a combination of the following
optional elements:</span></span>
</span></div>
<ol>
<li><div align="JUSTIFY" style="border: none; line-height: 0.2in; margin-bottom: 0.16in; padding: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;">A
navigation button </span>
</span></div>
</li>
<li><div align="JUSTIFY" style="border: none; line-height: 0.2in; margin-bottom: 0.16in; padding: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">A
branded logo image</span></div>
</li>
<li><div align="JUSTIFY" style="border: none; line-height: 0.2in; margin-bottom: 0.16in; padding: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">A
title and subtitle</span></div>
</li>
<li><div align="JUSTIFY" style="border: none; line-height: 0.2in; margin-bottom: 0.16in; padding: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">One
or more custom views</span></div>
</li>
<li><div align="JUSTIFY" style="border: none; line-height: 0.2in; margin-bottom: 0.16in; padding: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">An
action menu</span></div>
</li>
</ol>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;">Things
to do remind while Implementing ToolBar</span></div>
<h3 class="western">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;">IllegalStateException
(windowActionBar)</span></h3>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;">java.lang.RuntimeException:
Unable to start activity ComponentInfo{}:
java.lang.IllegalStateException: This Activity already has an action
bar supplied by the window decor. Do not request
Window.FEATURE_ACTION_BAR and set windowActionBar to false in your
theme to use a Toolbar instead.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><b>Solution:</b></span></div>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;">add
</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><code style="color: black; word-wrap: normal;"> <item name="windowActionBar">false</item>
</code></span></pre>
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;">
in theme.</span></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<h3>
<span style="color: black;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><b>Apply
Styles for Version above API level 14+</b></span></span></h3>
</div>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;"><code style="color: black; word-wrap: normal;"> <color name="holo_blue_light">#ff33b5e5</color>
<color name="green">#36A245</color>
<color name="ripple_material_light">#40000000</color>
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/holo_blue_light</item>
<item name="colorPrimaryDark">@color/green</item>
<item name="colorAccent">@color/ripple_material_light</item>
</style>
</code></span></pre>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<h3>
<span style="color: black;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><b>Above
21+</b></span></span></h3>
</div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;"><code style="color: black; word-wrap: normal;"> <style name="AppBaseTheme" parent="android:Theme.Material.Light">
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/ripple_material_light</item>
<item name="colorPrimaryDark">@color/green</item>
<item name="colorAccent">@color/holo_blue_light</item>
</style>
</code></span></pre>
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span></div>
<h3 class="western">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;">Styling
of ToolBar:</span></h3>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #333333;">Styling
of </span><code class="western"><span style="color: #333333;">Toolbar
</span></code><span style="color: #333333;">is
done differently to the standard action bar, and is set directly onto
the view.</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;"><code style="color: black; word-wrap: normal;"> <android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Light" />
</code></span></pre>
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: #2a00ff;"><b>ThemeOverlay.AppCompat.Light
: </b></span><span style="color: black;"><b>Changes the Toolbar title text
color to Black.</b></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: #2a00ff;"><b>ThemeOverlay.AppCompat.Dark.ActionBar
:</b></span><span style="color: black;"><b> Changes the Toolbar title text
color to White.</b></span></span></div>
<h3 class="western">
<span style="color: black;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><br /></span></span></h3>
<h3 class="western">
<span style="color: black;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;">Usage
of inflateMenu in Toolbar:</span></span></h3>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"><span lang="en-US">If
you're using </span></span><span style="color: #3f7f5f;">setSupportActionBar(</span><span style="color: #3f7f5f;"><u>toolbar</u></span><span style="color: #3f7f5f;">);</span><span style="color: black;"><b>
</b></span><span style="color: black;">then</span><span style="color: black;"><b>
</b></span><span style="color: black;">inflateMenu
of toolbar cannot be used, because Toolbar is acting like Actionbar.
So, all the menu related callbacks are default.</span></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;"><span style="font-size: small;"><span lang="en-US">The
only time you need to call </span></span></span><code class="western"><span style="color: #3f7f5f;"><span style="font-size: small;"><span lang="en-US">toolbar.inflateMenu()</span></span></span></code><code class="western"><span style="color: black;"><span style="font-size: small;"><span lang="en-US">
</span></span></span></code><span style="color: black;"><span style="font-size: small;"><span lang="en-US">is
when you are using the Toolbar as a standalone widget. In this case
you need to manually populate the Toolbar with content/actions. For
instance, if you want it to display actions, you need to inflate a
menu into it: </span></span></span>
</span></div>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Georgia, Times New Roman, serif;"> Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar);
// Set an OnMenuItemClickListener to handle menu item clicks
toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.searchItem:
Toast.makeText(getApplicationContext(), "Search", Toast.LENGTH_SHORT).show();
break;
case R.id.filterItem:
Toast.makeText(getApplicationContext(), "Filter", Toast.LENGTH_SHORT).show();
break;
}
return true;
}
});
// Inflate a menu to be displayed in the toolbar
toolbar.inflateMenu(R.menu.toolbar_menu);
</span></code></pre>
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Georgia, Times New Roman, serif;">res/xml/toolbar_menu.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" >
<item
android:id="@+id/searchItem"
android:icon="@android:drawable/ic_menu_search"
android:title="Search"
app:showAsAction="always"/>
<item
android:id="@+id/filterItem"
android:icon="@android:drawable/ic_menu_info_details"
android:title="Info"
app:showAsAction="always"/>
</menu>
</span></code></pre>
</div>
<h3 class="western">
<span style="font-size: small;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;"><br /></span></span></h3>
<h3 class="western">
<span style="font-size: small;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;">Navigations
in Toolbar:</span></span></h3>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"><span lang="en-US"><i>Here
we can see how toolbar navigation works and this is similar to the
action of </i></span></span><b>setDisplayHomeAsUpEnabled(true)
</b><span style="color: black;"><span lang="en-US"><i>in
the actionbar.</i></span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;">Toolbar
toolbar = (Toolbar) findViewById(R.id.</span><span style="color: #0000c0;"><i>my_awesome_toolbar</i></span><span style="color: black;">);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;"> </span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;">toolbar.setTitle(</span><span style="color: #2a00ff;">"Second
Activity"</span><span style="color: black;">);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;">toolbar.setNavigationIcon(R.drawable.</span><span style="color: #0000c0;"><i>ic_up</i></span><span style="color: black;">);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;">toolbar.setNavigationOnClickListener(</span><span style="color: #7f0055;"><b>new</b></span><span style="color: black;">
View.OnClickListener() {</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<div align="LEFT" style="margin-bottom: 0in;">
</div>
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"></span><span style="color: #646464;"> @Override</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #646464;"> </span><span style="font-size: small;"><span style="color: black;"></span><span style="color: #7f0055;"><b>public</b></span><span style="color: black;">
</span><span style="color: #7f0055;"><b>void</b></span><span style="color: black;">
onClick(View view) {</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #646464;"> </span><span style="font-size: small;"><span style="color: black;">NavUtils.</span><span style="color: black;"><i>navigateUpTo</i></span><span style="color: black;">(SecondActivity.</span><span style="color: #7f0055;"><b>this</b></span><span style="color: black;">,
IntentCompat.</span><span style="color: black;"><i>makeMainActivity</i></span><span style="color: black;">(</span><span style="color: #7f0055;"><b>new</b></span><span style="color: black;">
ComponentName(SecondActivity.</span><span style="color: #7f0055;"><b>this</b></span><span style="color: black;">,
SecondActivity.</span><span style="color: #7f0055;"><b>class</b></span><span style="color: black;">)));</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #646464;"> </span><span style="color: black;">}</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="font-size: small;"><span style="color: black;">});</span><span style="color: teal;">
</span></span>
</span></div>
<h3 class="western">
<span style="font-size: small;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;"><br /></span></span></h3>
<h3 class="western">
<span style="font-size: small;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;">Customize
Toolbar:</span></span></h3>
<span style="color: black; font-family: Georgia, Times New Roman, serif;">The
customization of the toolbar here is to center align the title text
and it is as follows.</span><br />
<div style="margin-bottom: 0in;">
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="color: teal; font-family: Georgia, Times New Roman, serif;"><code style="color: black; word-wrap: normal;"><android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/my_awesome_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" >
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:singleLine="true"
android:text="Toolbar Title"
android:textColor="@android:color/white"
android:textSize="18sp"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
</code></span></pre>
<span style="color: teal; font-family: Georgia, Times New Roman, serif;">
</span></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: .0001pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Georgia, Times New Roman, serif;"><b>Source Code</b><span style="font-size: 13.5pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: .0001pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="color: #333333; font-family: Georgia, Times New Roman, serif; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";">You can download the source code by clicking here: <a href="https://sites.google.com/site/vardhanexp/toolbar-sample/ToolBarMaterialComp.zip?attredirects=0&d=1">ToolBarMaterialComp Source Code</a>. This project is built using eclipse IDE. Unzip and import the project into Eclipse, it’s a good idea to use the Project by clean and rebuild from the project menu. It works in all API levels above 2.3.</span><br />
<span style="color: #333333; font-family: Georgia, Times New Roman, serif; mso-bidi-font-family: "Times New Roman"; mso-fareast-font-family: "Times New Roman";"><br /></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif; font-size: 11.5pt; mso-themecolor: background1; mso-themeshade: 128;">As always, thanks for reading :) </span></div>
<div class="MsoNormal">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">Don't forget to +1 this blog and share this post on Google+ if you found it interesting!</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #666666;"><br /></span>
<span style="color: #666666; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 115%; mso-themecolor: background1; mso-themeshade: 128;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments & f</span><span style="color: #666666;">eedback's are welcome.</span></span></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-62243646223936095782014-09-24T00:35:00.000+05:302014-09-24T00:35:03.390+05:30Android: Material Theme in Kitkat<span style="font-family: Georgia, Times New Roman, serif;">Material Theme look and feel can be easily achieve in KitKat because of the new features Translucent UI in KitKat, where you have the ability to sit behind status and navigation bars</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">We can getting material theme look and feel in 2 ways.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">1. We can write our own styles.xml and modify according to our needs.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;">2. Import <a href="https://github.com/jgilfelt/SystemBarTint" target="_blank">SystemBarTint</a> library and apply changes as per need.</span><br />
<h2>
<span style="font-family: Georgia, Times New Roman, serif;">First Approach using styles.xml:</span></h2>
<span style="font-family: Georgia, Times New Roman, serif;">We can build our own theme by setting with Translucent Theme in xml</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">If you are seeking more control over translucent decor, consider using a custom theme that extends something other than *.TranslucentDecor and use the following style properties in your theme:</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Georgia, Times New Roman, serif;"> <item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</span></code></pre>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">If your content does not need to be full bleed you can structure your layouts in such a way that the content will reside in an area of the screen that is not blocked by the status or navigation bar. To do this you would set android:fitsSystemWindows="true" on the content layout/view in your layout xml or in style.xml as </span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Georgia, Times New Roman, serif;"> <item name="android:fitsSystemWindows">true</item>.
</span></code></pre>
<span style="font-family: Georgia, Times New Roman, serif;">.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;">Add Some Color to the status bar, just set the windowBackground attribute in my theme.</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Georgia, Times New Roman, serif;"> <item name="android:windowBackground">@color/window_bg</item> </span></code></pre>
<h2>
<span style="font-family: Georgia, Times New Roman, serif;">Second Approach Using SystemBarTine:</span></h2>
<span style="font-family: Georgia, Times New Roman, serif;">This library <a href="https://github.com/jgilfelt/SystemBarTint" target="_blank">jgilfelt-SystemBarTint</a> offers a simple way to create a background "tint" for the system bars. Internally even this library is depended on the Translucent theme.</span><br />
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><span style="color: #333333;">Source Code</span></b><span style="font-size: 13.5pt;"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="color: #333333; font-family: Georgia, Times New Roman, serif;">You can download the source code by clicking here: <a href="https://github.com/harshavardhands/MaterialThemeLookInKitKat" target="_blank">MaterialThemeLookInKitKat</a>. This project is built using eclipse IDE. Unzip and import the project into Eclipse, it’s a good idea to use the Project by clean and rebuild from the project menu. This example is built using 2nd approach.</span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">Output:</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgodf_wAZyWZb9ZC1zjez5RLmVmfPiLuXAJLwXRt6fhdqhBtZb78do6En7pnEJ8gHUnFFVxnJ3YpGRkdS5J3dQnPc70Hvki9KQOY3igdfuMOngAZHJsTIN5VBh0oKGtRoAKFFdDyOzQgeQ/s1600/device-2014-09-24-000346.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Georgia, Times New Roman, serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgodf_wAZyWZb9ZC1zjez5RLmVmfPiLuXAJLwXRt6fhdqhBtZb78do6En7pnEJ8gHUnFFVxnJ3YpGRkdS5J3dQnPc70Hvki9KQOY3igdfuMOngAZHJsTIN5VBh0oKGtRoAKFFdDyOzQgeQ/s1600/device-2014-09-24-000346.png" height="320" width="180" /></span></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: Georgia, Times New Roman, serif; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: Georgia, Times New Roman, serif; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<div class="MsoNormal">
<span style="color: grey; font-family: Georgia, Times New Roman, serif; font-size: 11.5pt; line-height: 17.6333332061768px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments.</span></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-29112352764949869492014-09-23T13:28:00.000+05:302014-09-23T13:28:42.085+05:30Solution: Stuck @ installing apps from Google Play Store<h2>
<span style="font-family: inherit;">Problem</span></h2>
<span style="font-family: inherit;">If you are stuck at some percentage while installing apps from Google Play Store.</span><br />
<h2>
<span style="font-family: inherit;">Reason</span></h2>
<span style="font-family: inherit;">The reason behind this is Google Play Store transfers data in background to update itself. </span><span style="font-family: inherit;">Without completing the background data transfer, Play Store won’t start downloading apps.</span><br />
<span style="font-family: inherit;">It will be showing progress bar/loading bar will be running and showing percentage but the download won’t start until your Google services job is finished.</span><br />
<h2>
<span style="font-family: inherit;">Solution</span></h2>
Wait a few minutes until the Google Play Store is completely upgraded.<br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Even after,</span> If the problem persists, then follow the <span style="font-family: inherit;">steps below.</span><br />
<br />
<ul>
<li><span style="font-family: inherit;">Go the play store and start installing application.</span></li>
<li><span style="font-family: inherit;">Now, minimize play Store and go to Settings </span><span style="background-color: #f3f3f3; color: #333333; font-family: helvetica, arial, sans-serif; font-size: 16px; line-height: 25.6000003814697px;">→</span><span style="font-family: inherit;"> Apps </span><span style="background-color: #f3f3f3; color: #333333; font-family: helvetica, arial, sans-serif; font-size: 16px; line-height: 25.6000003814697px;">→</span><span style="font-family: inherit;"> RUNNING</span></li>
<li><span style="font-family: inherit;">Find the Google Play services. Tap and stop all the Google Play Services.</span></li>
<li><span style="font-family: inherit;">Now Go back to play store again and your download will start and finishes... </span></li>
</ul>
<br />
<div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.6333332061768px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? feedback are welcome.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com1tag:blogger.com,1999:blog-4023775337223455601.post-63862767226600550762014-09-12T12:21:00.000+05:302014-09-22T14:26:42.252+05:30Android: Image loading libraries Picasso vs Glide<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
<span style="font-family: Times New Roman, serif;"><span style="line-height: 26.8799991607666px;">This post is about image loading libraries, which could help us in avoiding complex codes.</span></span><br />
<br />
Downloading of images, caching and reusing of images are know part of all the application and it <span style="font-family: 'Times New Roman', serif; line-height: 26.8799991607666px;">became part of developers life. While doing this process, </span><span style="font-family: 'Times New Roman', serif; line-height: 26.8799991607666px;">We need to consider few things...</span><br />
<br />
<ul style="text-align: left;">
<li><span style="font-family: 'Times New Roman', serif; line-height: 26.8799991607666px;">Loading process should be asynchronously.</span></li>
<li><span style="font-family: 'Times New Roman', serif; line-height: 26.8799991607666px;">Image should display when it is loaded successfully, In case if it is not downloaded then placing some place holders.</span></li>
<li><span style="font-family: 'Times New Roman', serif; line-height: 26.8799991607666px;">Caching Image rather than downloading every time.</span></li>
</ul>
<br />
<span style="font-family: 'Times New Roman', serif;"><span style="line-height: 0.28in;">There are more libraries in the
market which helps us in </span><span style="line-height: 26.8799991607666px;">avoiding</span><span style="line-height: 0.28in;"> to do all these </span><span style="line-height: 26.8799991607666px;">exercises and</span><span style="line-height: 0.28in;"> here I am going to discuss about Picasso and Glide. Where this two
libraries looks similar in the way of implementation and Its easy to
integrate in the middle of the application, since its a just a one
line code to load image.</span></span><br />
<span style="font-family: 'Times New Roman', serif;"><span style="line-height: 0.28in;"><br /></span></span></div>
<div style="border: none; line-height: 0.28in; margin-bottom: 0.21in; padding: 0in;">
<span style="font-family: Times New Roman, serif;">There are lot of features in the
two libraries and few are listed below, where I can compare them
easily.</span><br />
<a name='more'></a></div>
<div style="border: none; line-height: 0.28in; margin-bottom: 0.21in; padding: 0in;">
</div>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" style="page-break-before: always; width: 665px;">
<colgroup><col width="116"></col>
<col width="244"></col>
<col width="279"></col>
</colgroup><tbody>
<tr valign="TOP">
<td width="116"><div align="CENTER">
<br /></div>
</td>
<td width="244"><div align="CENTER">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b><a href="http://square.github.io/picasso/" target="_blank">Picasso</a></b></span></span></div>
</td>
<td width="279"><div align="CENTER">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b><a href="https://github.com/bumptech/glide/wiki" target="_blank">Glide</a></b></span></span></div>
</td>
</tr>
<tr valign="TOP">
<td width="116"><div align="LEFT">
<span style="color: black;"> </span>
</div>
</td>
<td width="244"><div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Picasso</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">with</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>(</b></span></span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>)</b></span></span></span></div>
<div align="LEFT">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">load</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #dd1144;"><span style="font-family: Times New Roman, serif;">URL</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">)</span></span></div>
<div align="LEFT">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">into</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>(</b></span></span></span><span style="color: #0000c0;"><span style="font-family: Times New Roman, serif;">imageView</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>);</b></span></span></span></div>
</td>
<td width="279"><pre class="western"><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">Glide</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">with</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>(</b></span></span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>)</b></span></span></span>
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">load</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #dd1144;"><span style="font-family: Times New Roman, serif;">URL</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">)</span></span>
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">into</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #0000c0;"><span style="font-family: Times New Roman, serif;">imageView</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">);</span></span></pre>
</td>
</tr>
<tr valign="TOP">
<td width="116"><div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Re-size
the Image</span></span></div>
</td>
<td width="244"><div align="LEFT">
<span style="color: black;">Picasso</span><span style="color: #333333;"><b>.</b></span><span style="color: teal;">with</span><span style="color: #333333;"><b>(</b></span><span style="color: #7f0055;"><b>this</b></span><span style="color: #333333;"><b>)</b></span></div>
<div align="LEFT">
<span style="color: #333333;"><b>.</b></span><span style="color: teal;">load</span><span style="color: #333333;"><b>(</b></span><span style="color: #dd1144;">URL</span><span style="color: #333333;"><b>)</b></span></div>
<div align="LEFT">
<span style="color: #333333;"><b>.</b></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">resize</span></span><span style="color: black;"><b>(200,
200)</b></span></div>
<div align="LEFT">
<span style="color: black;"><b>.</b></span><span style="color: teal;">into(</span><span style="color: #0000c0;">imageView</span><span style="color: teal;">);</span></div>
</td>
<td width="279"><div align="LEFT">
<span style="color: black;">Glide.</span><span style="color: teal;">with</span><span style="color: #333333;"><b>(</b></span><span style="color: #7f0055;"><b>this</b></span><span style="color: #333333;"><b>)</b></span></div>
<div align="LEFT">
<span style="color: #333333;">.</span><span style="color: teal;">load</span><span style="color: #333333;">(</span><span style="color: #dd1144;">URL</span><span style="color: #333333;">)</span></div>
<div align="LEFT">
<span style="color: black;">.</span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">override</span></span><span style="color: black;">(200,
200)</span></div>
<div align="LEFT">
<span style="color: black;">.</span><span style="color: teal;">into</span><span style="color: black;">(</span><span style="color: #0000c0;">imageView</span><span style="color: black;">);</span></div>
</td>
</tr>
<tr valign="TOP">
<td width="116"><span style="font-family: Times New Roman, serif;">If loading is
failed then on failure callbacks or listener.</span><br />
<br />
<br /></td>
<td width="244"><span style="color: black;"><span style="font-family: Times New Roman, serif;">Picasso.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">with</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span><br />
<div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">load</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #dd1144;"><span style="font-family: Times New Roman, serif;">URL</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span></div>
<div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">into</span></span><span style="font-family: Times New Roman, serif;">(</span><span style="color: navy;"><span lang="zxx"><u><a href="eclipse-javadoc:%E2%98%82=GlideVsPicassoTest/D:%5C/Learning%5C/ws%5C/GlideVsPicassoTest%5C/libs%5C/picasso-2.3.4.jar%3Ccom.squareup.picasso(RequestCreator.class%E2%98%83RequestCreator~into~Landroid.widget.ImageView;~Lcom.squareup.picasso.Callback;%E2%98%82ImageView"><span style="font-family: Times New Roman, serif;">ImageView</span></a></u></span></span><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span><span style="color: #0000c0;"><span style="font-family: Times New Roman, serif;">imageView</span></span><span style="font-family: Times New Roman, serif;">,
</span><span style="color: navy;"><span lang="zxx"><u><a href="eclipse-javadoc:%E2%98%82=GlideVsPicassoTest/D:%5C/Learning%5C/ws%5C/GlideVsPicassoTest%5C/libs%5C/picasso-2.3.4.jar%3Ccom.squareup.picasso(RequestCreator.class%E2%98%83RequestCreator~into~Landroid.widget.ImageView;~Lcom.squareup.picasso.Callback;%E2%98%82Callback"><span style="font-family: Times New Roman, serif;">Callback</span></a></u></span></span><span style="font-family: Times New Roman, serif;">
arg1)</span></div>
</td>
<td width="279"><div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Glide.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">with</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span></div>
<div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">load</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #dd1144;"><span style="font-family: Times New Roman, serif;">URL</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span></div>
<div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">listener</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: navy;"><span lang="zxx"><u><a href="eclipse-javadoc:%E2%98%82=GlideVsPicassoTest/D:%5C/Learning%5C/ws%5C/GlideVsPicassoTest%5C/libs%5C/main.jar%3Ccom.bumptech.glide(DrawableRequestBuilder.class%E2%98%83DrawableRequestBuilder~listener~Lcom.bumptech.glide.request.RequestListener%5C%3CTModelType;Lcom.bumptech.glide.load.resource.drawable.GlideDrawable;%3E;%E2%98%82RequestListener"><span style="color: black;"><span style="font-family: Times New Roman, serif;">RequestListener</span></span></a></u></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><u><</u></span></span></span><span style="color: navy;"><span lang="zxx"><u><a href="eclipse-javadoc:%E2%98%82=GlideVsPicassoTest/D:%5C/Learning%5C/ws%5C/GlideVsPicassoTest%5C/libs%5C/main.jar%3Ccom.bumptech.glide(DrawableRequestBuilder.class%E2%98%83DrawableRequestBuilder~listener~Lcom.bumptech.glide.request.RequestListener%5C%3CTModelType;Lcom.bumptech.glide.load.resource.drawable.GlideDrawable;%3E;%E2%98%82String"><span style="color: black;"><span style="font-family: Times New Roman, serif;">String</span></span></a></u></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><u>,
</u></span></span></span><span style="color: navy;"><span lang="zxx"><u><a href="eclipse-javadoc:%E2%98%82=GlideVsPicassoTest/D:%5C/Learning%5C/ws%5C/GlideVsPicassoTest%5C/libs%5C/main.jar%3Ccom.bumptech.glide(DrawableRequestBuilder.class%E2%98%83DrawableRequestBuilder~listener~Lcom.bumptech.glide.request.RequestListener%5C%3CTModelType;Lcom.bumptech.glide.load.resource.drawable.GlideDrawable;%3E;%E2%98%82GlideDrawable"><span style="color: black;"><span style="font-family: Times New Roman, serif;">GlideDrawable</span></span></a></u></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><u>>
requestListener</u></span></span></span></div>
<div align="LEFT">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span><br />
<span style="color: black;"><span style="font-family: Times New Roman, serif;">.into(</span></span><span style="color: #0000c0;"><span style="font-family: Times New Roman, serif;">imageView</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">);</span></span></div>
</td>
</tr>
<tr valign="TOP">
<td width="116"><span style="font-family: Times New Roman, serif;">Transform</span></td>
<td width="244"><span style="font-family: Times New Roman, serif;">Picasso</span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">with</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>(</b></span></span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>)</b></span></span></span><br />
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;">.</span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">load</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #dd1144;"><span style="font-family: Times New Roman, serif;">URL</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">)</span></span><br />
<span style="font-family: Times New Roman, serif;">.</span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">transform</span></span><span style="font-family: Times New Roman, serif;">(new
CircleTransform())</span><br />
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">into</span></span><span style="font-family: Times New Roman, serif;">(</span><span style="color: #0000c0;"><span style="font-family: Times New Roman, serif;">imageView</span></span><span style="font-family: Times New Roman, serif;">);</span></td>
<td width="279"><span style="color: black;"><span style="font-family: Times New Roman, serif;">Glide</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">with</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>(</b></span></span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>)</b></span></span></span><br />
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>.</b></span></span></span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">load</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>(</b></span></span></span><span style="color: #dd1144;"><span style="font-family: Times New Roman, serif;">URL</span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>)</b></span></span></span><br />
<span style="color: teal;"><span style="font-family: Times New Roman, serif;">.transform</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(new</span></span><span style="font-family: Times New Roman, serif;">
CircleTransform(context))</span><br />
<span style="font-family: Times New Roman, serif;">.</span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">into</span></span><span style="font-family: Times New Roman, serif;">(</span><span style="color: #0000c0;"><span style="font-family: Times New Roman, serif;">imageView</span></span><span style="font-family: Times New Roman, serif;">);</span></td>
</tr>
<tr valign="TOP">
<td width="116"><span style="font-family: Times New Roman, serif;">Thumbnail
Support</span></td>
<td width="244"><span style="font-family: Times New Roman, serif;">No</span></td>
<td width="279"><span style="font-family: Times New Roman, serif;">Yes</span><br />
<br />
<div align="LEFT">
<span style="color: black;">Glide.</span><span style="color: teal;">with</span><span style="color: #333333;"><b>(</b></span><span style="color: #7f0055;"><b>this</b></span><span style="color: #333333;"><b>)</b></span></div>
<div align="LEFT">
<span style="color: #333333;">.</span><span style="color: teal;">load</span><span style="color: #333333;">(</span><span style="color: #dd1144;">URL</span><span style="color: #333333;">)</span></div>
<div align="LEFT">
<span style="color: black;">.</span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">thumbnail</span></span><span style="color: black;">(0.1f)</span></div>
<div align="LEFT">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: black;">.</span><span style="color: teal;">into</span><span style="color: black;">(</span><span style="color: #0000c0;">imageView</span><span style="color: black;">);</span></span></span></div>
</td>
</tr>
<tr valign="TOP">
<td width="116"><span style="font-family: Times New Roman, serif;">Animation</span></td>
<td width="244"><span style="font-family: Times New Roman, serif;">No direct
approach</span></td>
<td width="279"><span style="font-family: Times New Roman, serif;">Yes</span><br />
<br />
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Animation anim
= <span style="color: black;">AnimationUtils.</span><span style="color: black;"><i>loadAnimation</i></span><span style="color: black;">(</span><span style="color: #0000c0;">context</span><span style="color: black;">,
android.R.anim.</span><span style="color: #0000c0;"><i>fade_in</i></span><span style="color: black;">);</span></span></span><br />
<br />
<div align="LEFT">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: black;">Glide.</span><span style="color: teal;">with</span><span style="color: #333333;"><b>(</b></span><span style="color: #7f0055;"><b>this</b></span><span style="color: #333333;"><b>)</b></span></span></span></div>
<div align="LEFT">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">.</span><span style="color: teal;">load</span><span style="color: #333333;">(</span><span style="color: #dd1144;">URL</span><span style="color: #333333;">)</span></span></span></div>
<div align="LEFT">
<span style="color: black;">.</span><span style="color: teal;"><span style="font-family: Times New Roman, serif;">animate</span></span><span style="color: black;">(anim)</span></div>
<div align="LEFT">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: black;">.</span><span style="color: teal;">into</span><span style="color: black;">(</span><span style="color: #0000c0;">imageView</span><span style="color: black;">);</span></span></span></div>
</td>
</tr>
<tr valign="TOP">
<td height="73" width="116"><span style="font-family: Times New Roman, serif;">Placeholders
during loading</span></td>
<td width="244"><span style="font-family: Times New Roman, serif;">Yes</span><br />
<br />
<div align="LEFT" lang="en-US">
<span style="color: teal;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.placeholder<span style="color: black;">(drawable/resourceid)</span></span></span></span></div>
<div align="LEFT" lang="en-US">
<span style="color: teal;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.error<span style="color: black;">(</span><span style="color: black;">drawable/resourceid</span><span style="color: black;">)</span></span></span></span></div>
</td>
<td width="279"><span style="font-family: Times New Roman, serif;">Yes</span><br />
<br />
<div align="LEFT" lang="en-US">
<span style="color: teal;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.placeholder<span style="color: black;">(drawable/resourceid)</span></span></span></span></div>
<div align="LEFT" lang="en-US">
<span style="color: teal;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.error<span style="color: black;">(</span><span style="color: black;">drawable/resourceid</span><span style="color: black;">)</span></span></span></span></div>
</td>
</tr>
</tbody></table>
<div style="border: none; margin-bottom: 0.21in; padding: 0in;">
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;"><br /></span>
<span style="font-family: Times New Roman, serif;">How can we get directly Circular Image, when we can get when we download from the url?</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;">This both libraries support in doing without change of xml.</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;">Both the libraries are having transform method, where we can customize the class and we can get the image as we required.</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;"><br /></span>
<span style="font-family: Times New Roman, serif;">Picasso (CircleTransform.Java)</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;"><br /></span>
</div>
<pre style="background-attachment: initial; background-clip: initial; background-color: #f0f0f0; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> import android.graphics.Bitmap;
import com.squareup.picasso.Transformation;
public class CircleTransform implements Transformation {
@Override
public Bitmap transform(Bitmap source) {
return ImageUtils.getCircularBitmapImage(source);
}
@Override
public String key() {
return "circle-image";
}
}
</code></pre>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;"><br /></span><span style="font-family: Times New Roman, serif;">Glide </span><span style="font-family: 'Times New Roman', serif;">(CircleTransform.Java)</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: 'Times New Roman', serif;"><br /></span>
</div>
<pre style="background-attachment: initial; background-clip: initial; background-color: #f0f0f0; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> import android.content.Context;
import android.graphics.Bitmap;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
public class GlideCircleTransform extends BitmapTransformation {
public GlideCircleTransform(Context context) {
super(context);
}
@Override
protected Bitmap transform(BitmapPool pool, Bitmap source, int outWidth, int outHeight) {
return ImageUtils.getCircularBitmapImage(source);
}
@Override
public String getId() {
return "Glide_Circle_Transformation";
}
}
</code></pre>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;"><br />Utils class, where we are customizing the bitmap image as we required.</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;">ImageUtils.java</span></div>
<div style="line-height: 0.28in;">
<span style="font-family: Times New Roman, serif;"><br /></span></div>
<pre style="background-attachment: initial; background-clip: initial; background-color: #f0f0f0; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1px dashed rgb(204, 204, 204); color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
public class ImageUtils {
public static Bitmap getCircularBitmapImage(Bitmap source) {
int size = Math.min(source.getWidth(), source.getHeight());
int x = (source.getWidth() - size) / 2;
int y = (source.getHeight() - size) / 2;
Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size);
if (squaredBitmap != source) {
source.recycle();
}
Bitmap bitmap = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
BitmapShader shader = new BitmapShader(squaredBitmap, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);
paint.setShader(shader);
paint.setAntiAlias(true);
float r = size / 2f;
canvas.drawCircle(r, r, r, paint);
squaredBitmap.recycle();
return bitmap;
}
}
</code></pre>
<span style="font-family: Times New Roman, serif; line-height: 0.28in;"><br /></span><span style="font-family: Times New Roman, serif;"><span style="line-height: 0.28in;">The above </span><span style="line-height: 26.8799991607666px;">getCircularBitmapImage method provides me the circular bitmap image.</span></span><br />
<span style="font-family: Times New Roman, serif;"><span style="line-height: 26.8799991607666px;"><br /></span></span>
<span style="font-family: Times New Roman, serif;"><span style="line-height: 26.8799991607666px;">Screenshot:</span></span><br />
<span style="font-family: Times New Roman, serif;"><span style="line-height: 26.8799991607666px;"><br /></span></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFvDPdke_b_AVDmQWP8qICPh9c-V1O8a4gZksc0eARWO9gAOArKc5lx3iS74neQvCYrqZ9PmnBDonor6tSDIBc10npVJdTVeaa3eyvQO3jAhsMY_GG-l9gTDQsxN0pUUuEUfWpJY3xPxU/s1600/device-2014-09-12-120733.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFvDPdke_b_AVDmQWP8qICPh9c-V1O8a4gZksc0eARWO9gAOArKc5lx3iS74neQvCYrqZ9PmnBDonor6tSDIBc10npVJdTVeaa3eyvQO3jAhsMY_GG-l9gTDQsxN0pUUuEUfWpJY3xPxU/s1600/device-2014-09-12-120733.png" height="320" width="192" /></a></div>
<span style="font-family: Times New Roman, serif;"><span style="line-height: 26.8799991607666px;"><br /></span></span>
<span style="font-family: Times New Roman, serif; line-height: 0.28in;"><br /></span><br />
<span style="font-family: Times New Roman, serif; line-height: 0.28in;"><br /></span>
<br />
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.6333332061768px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments. feedback are welcome...</span></div>
</div>
</div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com19tag:blogger.com,1999:blog-4023775337223455601.post-17209889839852984312014-09-10T13:11:00.000+05:302014-09-22T02:18:52.918+05:30Android Wear : Solution for "You cannot combine swipe dismissal and the action bar"<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">While running my first application in android wear in eclipse. I have faced with the exception.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><b>Exception:</b></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">android.util.AndroidRuntimeException:
You cannot combine swipe dismissal and the action bar.<br /> at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)<br /> at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)<br /> at
android.app.ActivityThread.access$800(ActivityThread.java:138)<br /> at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)<br /> at
android.os.Handler.dispatchMessage(Handler.java:102)<br /> at
android.os.Looper.loop(Looper.java:136)<br /> at
android.app.ActivityThread.main(ActivityThread.java:5026)<br /> at
java.lang.reflect.Method.invokeNative(Native Method)<br /> at
java.lang.reflect.Method.invoke(Method.java:515)<br /> at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)<br /> at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)<br /> at
dalvik.system.NativeStart.main(Native Method)<br />Caused by:
android.util.AndroidRuntimeException: You cannot combine swipe
dismissal and the action bar.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><b>Workaround Solution:</b></span></div>
<div style="margin-bottom: 0in;">
There should be some SDK issues where it is behaving weirdly.</div>
<div style="margin-bottom: 0in;">
So, I have tried by r<span style="color: black; font-family: 'Times New Roman', serif; line-height: 0.25in;">emoving android:targetSdkVersion</span><span style="font-family: 'Times New Roman', serif; line-height: 0.25in;"> and change the
android:minSdkVersion as shown below it worked out for me.</span></div>
<div style="line-height: 0.25in; margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Change to </span></span><span style="font-family: 'Times New Roman', serif;"> </span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: teal;"><u><</u></span><span style="color: #3f7f7f;"><u>uses-sdk</u></span><span style="color: black;"><u>
</u></span><span style="color: #7f007f;"><u>android:minSdkVersion</u></span><span style="color: black;"><u>=</u></span><span style="color: #2a00ff;"><i><u>"8"</u></i></span><span style="color: black;"><u>
</u></span><span style="color: teal;"><u>/></u></span><span style="color: teal;"> </span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: teal;"><br /></span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: teal;">from </span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: teal;"><u><</u></span><span style="color: #3f7f7f;"><u>uses-sdk
</u></span><span style="color: #7f007f;">android:minSdkVersion</span><span style="color: black;">=</span><span style="color: #2a00ff;"><i>"20"
</i></span><span style="color: #7f007f;">android:targetSdkVersion</span><span style="color: black;">=</span><span style="color: #2a00ff;"><i>"20"</i></span>
<span style="color: teal;">/></span></span></span></div>
<br />
<div align="LEFT" style="margin-bottom: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-80151051765729608822014-09-08T23:12:00.001+05:302014-09-22T14:27:50.617+05:30Glide, an Android media loading library...<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">Recently
I have came across new image loader library </span><span style="color: navy;"><span lang="zxx"><a href="https://github.com/bumptech/glide"><span style="color: #4183c4;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;">Glide</span></span></span></a></span></span><span style="color: navy;"><span lang="zxx"><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
from <a href="https://github.com/google/iosched">iosched Git Code</a></span></span></span></span></span></div>
<h1 class="western">
<span style="color: navy;"><span lang="zxx"><a href="https://github.com/bumptech/glide"><span style="color: #4183c4;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: medium;">Glide</span></span></span></span></a></span></span></h1>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">Glide
is a fast and efficient open source media management framework for
Android that wraps media decoding, memory and disk caching, and
resource pooling into a simple and easy to use interface. </span></span></span>
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">Glide's
primary focus is on making scrolling any kind of a list of images as
smooth and fast as possible, but Glide is also effective for almost
any case where you need to fetch, resize, and display a remote image.
</span></span></span>
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<h1 class="western" style="orphans: 0; page-break-after: avoid; widows: 0;">
<span style="color: navy;"><span lang="zxx"><span style="color: #4183c4;"><span style="font-family: Times New Roman, serif;"><span style="font-size: 13pt;">Implementation
/ Usage</span></span></span></span></span></h1>
<div style="margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;">When
we see the implementation of Glide. It looks similar to the </span></span><span style="color: navy;"><span lang="zxx"><u><a href="http://square.github.io/picasso/"><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">Picasso</span></span></a></u></span></span><span style="color: #333333;"><span style="font-family: Times New Roman, serif;">.</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;">Let
Looks the implementation of Picasso and Glide.</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Picasso.</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><i>with</i></span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">).load(</span></span><span style="color: #2a00ff;"><span style="font-family: Times New Roman, serif;">"</span></span><span style="color: navy;"><span lang="zxx"><u><a href="http://i.imgur.com/DvpvklR.png"><span style="color: #2a00ff;"><span style="font-family: Times New Roman, serif;">http://i.imgur.com/DvpvklR.png</span></span></a></u></span></span><span style="color: #2a00ff;"><span style="font-family: Times New Roman, serif;">"</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">.into(imageView);</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Glide.</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><i>with</i></span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">(</span></span><span style="color: #7f0055;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>this</b></span></span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">).load(</span></span><span style="color: #2a00ff;"><span style="font-family: Times New Roman, serif;">"</span></span><span style="color: navy;"><span lang="zxx"><u><a href="http://i.imgur.com/DvpvklR.png"><span style="color: #2a00ff;"><span style="font-family: Times New Roman, serif;">http://i.imgur.com/DvpvklR.png</span></span></a></u></span></span><span style="color: #2a00ff;"><span style="font-family: Times New Roman, serif;">"</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">)</span></span><span style="color: black;"><span style="font-family: Times New Roman, serif;">.into(imageView);</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Using
the Picasso or Glide are easy and straight forward.</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Advantage
of Glide here is... Inbuilt it supports caching...</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Let
us assume, I am having two ImageView where one is loaded with Picasso
and othere with Glide as shown below.</span></span><br />
<span style="color: black;"><span style="font-family: Times New Roman, serif;"></span></span><br />
<a name='more'></a></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">
</span><br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: Times New Roman, serif;"><code style="color: black; word-wrap: normal;"> // Picasso
ImageView imageView = (ImageView) findViewById(R.id.imageView1);
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Image 1");
}
});
Picasso.with(this).load("http://i.imgur.com/DvpvklR.png").into(imageView); </code></span></pre>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: Times New Roman, serif;"><code style="color: black; word-wrap: normal;">
</code></span></pre>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: Times New Roman, serif;"><code style="color: black; word-wrap: normal;">
// Glide
ImageView imageView2 = (ImageView) findViewById(R.id.imageView2);
imageView2.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Image 2");
}
});
Glide.with(this).load("http://i.imgur.com/DvpvklR.png").into(imageView2);
</code></span></pre>
<span style="font-family: Times New Roman, serif;">
</span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Run
the application by connecting to the internet, We can see downloading
the images repsectively.</span></span><br />
<span style="color: black;"><span style="font-family: Times New Roman, serif;"><br /></span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Know
turn off internet connection and kill the application from recent
apps and now launch application we can see the imageview2(Glide) is
loaded but not imageview1 (Picasso).</span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<h1 class="western" style="orphans: 0; page-break-after: avoid; widows: 0;">
<span style="color: navy;"><span lang="zxx"><span style="color: #4183c4;"><span style="font-family: Times New Roman, serif;"><span style="font-size: 13pt;">New
Features</span></span></span></span></span></h1>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">Glide
version 3.x supports large number of features...</span></span></span></span></div>
<ul>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;"><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Animated
GIF decoding</span></span></span></span></strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span></span>
</div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;"><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Local
video stills</span></span></span></span></strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span></span>
</div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;"><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Thumbnail
support</span></span></span></span></strong></span></span></span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;"><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Lifecycle
integration</span></span></span></span></strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span></span>
</div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;"><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Transcoding</span></span></span></span></strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span></span>
</div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Consolas, sans-serif;"><span style="font-size: x-small;"><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Animations</span></span></span></span></strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span></span>
</div>
</li>
<li><div style="margin-bottom: 0in;">
<strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">OkHttp
and Volley Support</span></span></span></span></strong></div>
<div style="margin-bottom: 0in;">
</div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Including
the ability to use Drawables objects as placeholders during loads,
request prioritization, width and height overrides and the ability to
cache transformed thumbnails and/or the original source.</span></span></span></span></strong><strong><span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>
</b></span></span></span></strong>
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">By
default Glide uses a custom HttpUrlConnection based stack, but also
includes utility libraries plug in to Google's Volley project or
Square's OkHttp library instead.</span><span style="color: black;">
</span></span></span>
</div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">In
addition to the new features introduced in the the 3.x version, Glide
carries over all of the originals from the 2.x version:</span></span></div>
<ul>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Background
image loading.</span></span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Automatic
job cancellation in lists where views are re-used.</span></span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Memory
and disk caching</span></span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Bitmap
and resource pooling to minimize jank.</span></span></div>
</li>
<li><div style="margin-bottom: 0in;">
<span style="color: black;"><span style="font-family: Times New Roman, serif;">Arbitrary
transformations.</span></span></div>
</li>
</ul>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">There
are pros and cons in any library and I am not supporting any of the
tool/library here.</span></div>
<br />
<div style="margin-bottom: 0in;">
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.6333332061768px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments, feedback are welcome...</span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com4tag:blogger.com,1999:blog-4023775337223455601.post-30524251310738325202014-09-06T16:11:00.000+05:302014-09-06T16:11:45.840+05:30Android L: UI Widgets : RecyclerView <div dir="ltr" style="text-align: left;" trbidi="on">
<div align="LEFT">
<span style="color: black;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><code class="western"><span style="color: #006600;">RecyclerView</span></code><span style="color: #222222;">
is a more advanced and flexible version of </span><code class="western"><span style="color: #006600;">ListView</span></code><span style="color: #222222;">.
This widget is a container for large sets of views that can be
recycled and scrolled very efficiently. Use the </span><code class="western"><span style="color: #006600;">RecyclerView</span></code><span style="color: #222222;">
widget when you have lists with elements that change dynamically.</span></span></span></div>
<div align="LEFT">
<span style="color: black;"><span style="font-size: small;"><span style="color: #222222; font-family: Georgia, Times New Roman, serif;"><br /></span></span></span></div>
<div style="line-height: 0.15in; margin-bottom: 0.16in;">
<span style="font-family: Georgia, Times New Roman, serif;"><code class="western"><span style="color: #006600;">RecyclerView</span></code><span style="color: #222222;">
is easy to use, because it provides:</span></span></div>
<ul>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222; font-family: Georgia, Times New Roman, serif;">A
layout manager for positioning items</span></div>
</li>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222; font-family: Georgia, Times New Roman, serif;">Default
animations for common item operations</span></div>
</li>
</ul>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: #222222; font-family: Georgia, Times New Roman, serif; line-height: 0.2in;">You
also have the flexibility to define custom layout managers and
animations for this widget.</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-size: small;"><span style="color: #222222; font-family: Georgia, Times New Roman, serif;"><br /></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;">To
use the </span><code class="western"><span style="color: #006600;">RecyclerView</span></code><span style="color: #222222;">
widget, we have to specify an adapter and a layout manager. </span></span>
</span></div>
<h2 style="text-align: left;">
<code class="western"><span style="color: black;"><span style="font-family: Georgia, Times New Roman, serif; font-size: small;">LayoutManager</span></span></code></h2>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;"><span style="font-size: small;">The
</span></span><code class="western"><span style="color: black;"><span style="font-size: small;">LayoutManager</span></span></code><span style="color: black;"><span style="font-size: small;">
is probably the most interesting part of the </span></span><code class="western"><span style="color: black;"><span style="font-size: small;">RecyclerView</span></span></code><span style="color: black;"><span style="font-size: small;">.
This class is responsible for the layout of all child views. There is
</span></span><strong><span style="color: black;"><span style="font-size: small;"><b>one
default implementation</b></span></span></strong><span style="color: black;"><span style="font-size: small;">
available: </span></span><code class="western"><span style="color: black;"><span style="font-size: small;"><b>LinearLayoutManager</b></span></span></code><span style="color: black;"><span style="font-size: small;">
which you can use for vertical as well as horizontal lists. </span></span><span style="color: #222222;"><span style="font-size: small;">To
create a custom layout, you extend the </span></span><code class="western"><span style="color: #006600;"><span style="font-size: small;">RecyclerView.LayoutManager</span></span></code><code class="western"><span style="color: #222222;"><span style="font-size: small;">
</span></span></code><span style="color: #222222;"><span style="font-size: small;">class.</span></span><span style="color: black;"><span style="font-size: small;">
</span></span>
</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #3f7f5f;">//
use a linear layout manager</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #0000c0;">mLayoutManager</span><span style="color: black;">
= </span><span style="color: #7f0055;"><b>new</b></span><span style="color: black;">
LinearLayoutManager(</span><span style="color: #7f0055;"><b>this</b></span><span style="color: black;">);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #0000c0;">mRecyclerView</span><span style="color: black;">.setLayoutManager(</span><span style="color: #0000c0;">mLayoutManager</span><span style="color: black;">);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #3f7f5f;">//
improve performance if you know that changes in content</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #3f7f5f;">//
do not change the size of the RecyclerView</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #0000c0;">mRecyclerView</span><span style="color: black;">.setHasFixedSize(</span><span style="color: #7f0055;"><b>true</b></span><span style="color: black;">);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<h3 style="font-weight: normal; text-align: left;">
<span style="color: #333333;"><span style="font-size: small;"><span style="color: black; font-family: Georgia, Times New Roman, serif;">Animations</span></span></span></h3>
<div style="line-height: 0.15in; margin-bottom: 0.16in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #222222;">Animations
for adding and removing items are enabled by default in </span><code class="western"><span style="color: #006600;">RecyclerView</span></code><span style="color: #222222;">.
</span>
</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #222222;">use
the </span><code class="western"><span style="color: #006600;">RecyclerView.setItemAnimator</span></code><span style="color: #222222;">
method</span><span style="color: black;">
for animations, to customize just extend </span><span style="color: #222222;">the
</span><code class="western"><span style="color: #006600;">RecyclerView.ItemAnimator</span></code><span style="color: #222222;">
class</span><span style="color: black;"><span style="font-size: small;">
</span></span><span style="color: black;">
</span>
</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="border: none; line-height: 150%; margin-bottom: 0in; padding: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;">Android
provide </span><strong><span style="color: black;">DefaultItemAnimator</span></strong><strong><span style="color: black;"><span style="font-size: small;"><span style="font-weight: normal;">
and we can customize according to our needs.</span></span></span></strong></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif; font-size: small;"><span style="color: black;"> </span><span style="color: #0000c0;">mRecyclerView</span><span style="color: black;">.setItemAnimator(</span><span style="color: #7f0055;"><b>new</b></span><span style="color: black;">
DefaultItemAnimator());</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<h2 style="text-align: left;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;"><span style="font-size: small;"><span style="font-weight: normal;">A</span></span></span><code class="western"><span style="color: black;"><span style="font-size: small;">dapter:</span></span></code></span></h2>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;">To
create an adapter, you extend the </span><code class="western"><span style="color: #006600;">RecyclerView.Adapter</span></code><span style="color: #222222;">
class. </span><span style="color: black;">
</span></span>
</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: black;"><span style="font-size: small;">The
RecyclerView.Adapter class contains few </span></span><code class="western"><span style="color: black;"><span style="font-size: small;">notifyItemXXXX()</span></span></code><span style="color: black;"><span style="font-size: small;">methods.
Which help us in modifying the View. </span></span>
</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">Two
methods used in the example are insert and remove and they are</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">notifyItemInserted(position);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">notifyItemRemoved(position);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;"> <span style="color: #0000c0;">mRecyclerView</span>.setAdapter(<span style="color: #0000c0;">mAdapter</span>);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-family: Georgia, Times New Roman, serif;">//
insert or remove item from the view. This methods are in the adapter
class.</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: #7f0055;">public void </span>addToList(String name) {</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: #7f0055;">int</span> position = 0;</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: #7f0055;">if</span> (<span style="color: blue;">mDataset</span>.size() > 1) {</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span>position = <span style="color: #7f0055;">new</span> Random().nextInt(<span style="color: blue;">mDataset</span>.size() - 1);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span>}</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: blue;">mDataset</span>.add(position, name);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span>notifyItemInserted(position);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="color: #7f0055;">public void </span>removeItemFromList(String name) {</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: #7f0055;">int</span> position = <span style="color: blue;">mDataset</span>.indexOf(name);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: #7f0055;">if</span> (position != -1) {</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span style="color: blue;">mDataset</span>.remove(position);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span>notifyItemRemoved(position);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="color: #7f0055; white-space: pre;"> </span>}</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="font-family: Georgia, Times New Roman, serif;"><b><span style="color: #333333;">Source Code</span></b><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="color: #333333; font-family: Georgia, Times New Roman, serif;">You can download the source code by clicking here: <a href="https://sites.google.com/site/vardhanexp/recyclerviewsample/RecyclerViewSample.zip?attredirects=0&d=1">Sample RecyclerView</a> . This project is built using eclipse IDE. Unzip and import the project into Eclipse, it’s a good idea to use the Project by clean and rebuild from the project menu.</span></div>
<div class="MsoNormal">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif;">Screenshot:</span><br />
<span style="font-family: Georgia, Times New Roman, serif;">Initial screen with four items.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5439rx5wHXoeAPAMPhJSYFODe57PMP978xFCywhEalhX2gLgIvSO4FUvW30qBYPoDVDj5t46PG-MVj5-8DjIOjuv0LMF9443FAj7QJBhipB08gvxbeaFWPcJhw8b3QhzoMsT_t59vcoM/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5439rx5wHXoeAPAMPhJSYFODe57PMP978xFCywhEalhX2gLgIvSO4FUvW30qBYPoDVDj5t46PG-MVj5-8DjIOjuv0LMF9443FAj7QJBhipB08gvxbeaFWPcJhw8b3QhzoMsT_t59vcoM/s1600/2.png" height="320" width="177" /></a>
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifYasAAVEuA6gdYGFPHrddXjgRxjqvI-DRVRZNqiHL9MSkKqKNJaVAeq_UDx09aVhB3MzvloLYyMpyus4Uke3uvazFq5wnBgaNgAgvq-0gx304YzM-tEOp75KFCOWEluiFDj36tt69Ny8/s1600/1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifYasAAVEuA6gdYGFPHrddXjgRxjqvI-DRVRZNqiHL9MSkKqKNJaVAeq_UDx09aVhB3MzvloLYyMpyus4Uke3uvazFq5wnBgaNgAgvq-0gx304YzM-tEOp75KFCOWEluiFDj36tt69Ny8/s1600/1.png" height="320" width="177" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b><span style="font-size: small;">Added two rows to the recyclerView</span></b></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJs27eRPd2m2mPbqWTzNhIa5q16NuKBaGnyeJuXUtcODWS_e7O1-YjhAoORELAID9SAySdeySgnliIjoX57WuYppip5yyiV9pu3XwKmrXG0OSk19wWnrTmHxfIpzmvcSdFqUi24P8awRU/s1600/0.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJs27eRPd2m2mPbqWTzNhIa5q16NuKBaGnyeJuXUtcODWS_e7O1-YjhAoORELAID9SAySdeySgnliIjoX57WuYppip5yyiV9pu3XwKmrXG0OSk19wWnrTmHxfIpzmvcSdFqUi24P8awRU/s1600/0.png" height="320" width="177" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b><span style="font-size: small;">Removed one item which is added from RecyclerView<br /></span></b></td></tr>
</tbody></table>
</div>
<div style="margin: 0in;">
<span style="color: grey; font-family: Georgia, Times New Roman, serif;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: Georgia, Times New Roman, serif;">Whether this post is helpful?<o:p></o:p></span></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: Georgia, Times New Roman, serif; line-height: 17.6333332061768px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments and feedback are welcome</span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-8284212325263937342014-09-05T12:56:00.001+05:302014-09-22T02:19:19.616+05:30Android: RecyclerView cannot be resolved to a type<div dir="ltr" style="text-align: left;" trbidi="on">
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="color: #e06666; font-size: 13pt;">RecyclerView cannot be resolved to a type? </span></span><span style="color: #e06666; font-family: 'Palatino Linotype', serif; font-size: 17px;">How to resolve</span><span style="color: #e06666; font-family: 'Palatino Linotype', serif; font-size: 17px;"> it?</span></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<span style="color: #6aa84f;"><strong><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">We
need recyclerview-v7 Support Library to solve</span></span></strong><strong><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">
the issue. but how to get? letc check...</span></span></strong></span></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">Check
whether Recyclerview is existing in the SDK or not because it is a
<strong><span style="color: #444444;"><span style="font-weight: normal;">part
of the support library.</span></span></strong></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><strong><span style="color: #444444;"><span style="font-weight: normal;">If
you're not find the folder “recyclerview-v7” in the following sdk directory "..\sdk\extras\android\m2repository\com\android\support" then follow
the steps otherwise follow from step 3.</span></span></strong></span></span></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><strong><span style="color: #444444;">Steps
to achieve:</span></strong></span></span></div>
<ol>
<div align="LEFT" style="margin-bottom: 0in;">
</div>
<li><div align="LEFT">
<span style="font-family: Segoe UI;"><span style="font-size: 9pt;"><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">Select
the latest Android </span></span></span></span></strong><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><b>SDK
Tools</b></span></span></span></strong><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">,
</span></span></span></span></strong><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><b>Platform-tools</b></span></span></span></strong><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">,
and </span></span></span></span></strong><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><b>Build-tools.</b></span></span></span></strong></span></span></div>
</li>
<li><div align="LEFT">
<span style="font-family: Segoe UI;"><span style="font-size: 9pt;"><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">Select
latest Android Support Library & Android Support Repository.</span></span></span></span></strong></span></span></div>
</li>
<li><div style="border: none; line-height: 0.25in; margin-bottom: 0in; padding: 0in;">
<span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">After
updating </span></span></span><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">Android
Support Repository </span></span></span></span></strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">from
SDK Manager go
to</span></span></span><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">..\sdk\extras\android\m2repository\com\android\support\recyclerview-v7\21.0.0-rc1</span></span></span></span></strong></div>
</li>
<li><div style="border: none; line-height: 0.25in; margin-bottom: 0in; padding: 0in;">
<span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">Unzip
</span></span></span><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">recyclerview-v7-21.0.0-rc1.aar</span></span></span></span></strong></div>
</li>
<li><div style="border: none; line-height: 0.25in; margin-bottom: 0in; padding: 0in;">
<span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">After
unzipping recyclerview-v7-21.0.0-rc1.aar you will get </span></span></span><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">classes.jar</span></span></span></span></strong></div>
</li>
<li><div style="border: none; line-height: 0.25in; margin-bottom: 0in; padding: 0in;">
<span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">rename
classes.jar to recyclerView.jar for feature reference and add to
your Android app under </span></span></span><strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="font-weight: normal;">/lib
</span></span></span></span></strong><span style="color: #444444;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">folder</span></span></span></div>
</li>
</ol>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<strong style="text-indent: 0in;">Overview:</strong></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<strong style="text-indent: 0in;"><span style="font-weight: normal;"><span style="color: #363636; font-family: 'Segoe UI'; font-size: 13pt;">RecyclerView</span></span></strong><span style="color: #363636; font-family: 'Segoe UI'; font-size: 9pt; text-indent: 0in;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">
updates and replaces ListView. It's claimed to be easier to use and
feature performance improvements in dynamic views.</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="text-indent: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><code class="western"><span style="color: #006600;"><span style="font-family: Palatino Linotype, serif;">RecyclerView
</span></span></code><span style="color: #222222;">is
easy to use, because it provides:</span></span></span></div>
<ul>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">A
layout manager for positioning items</span></span></span></div>
</li>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">Default
animations for common item operations</span></span></span></div>
</li>
</ul>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">The
most important classes of the RecyclerView API.</span></span></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" style="width: 100%px;">
<colgroup><col width="128*"></col>
<col width="128*"></col>
</colgroup><tbody>
<tr valign="TOP">
<td width="50%"><div align="CENTER" style="text-indent: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><b>Class</b></span></span></div>
</td>
<td width="50%"><div align="CENTER" style="text-indent: 0in;">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><b>Usage</b></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><div align="CENTER">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">Adapter</span></span></div>
</td>
<td valign="TOP" width="50%"><div align="LEFT">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="color: #222222;">The
Adapter is also responsible for making a </span><code class="western"><a href="http://developer.android.com/reference/android/view/View.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Palatino Linotype, serif;">View</span></span></span></a></code><code class="western"><span style="color: #222222;"><span style="font-family: Palatino Linotype, serif;">
</span></span></code><span style="color: #222222;">for
each item in the data set.</span> </span></span>
</div>
</td>
</tr>
<tr>
<td width="50%"><div align="CENTER">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">LayoutManager</span></span></div>
</td>
<td valign="TOP" width="50%"><div align="LEFT">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="color: #222222;">A
</span><strong><span style="color: #222222;"><b>layout
manager </b></span></strong><span style="color: #222222;">positions
item views inside a </span><code class="western"><span style="color: #006600;"><span style="font-family: Palatino Linotype, serif;">RecyclerView</span></span></code><code class="western"><span style="color: #222222;"><span style="font-family: Palatino Linotype, serif;">
</span></span></code><span style="color: #222222;">and
determines when to reuse item views that are no longer visible to
the user.</span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><div align="CENTER">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;">ItemAnimator</span></span></div>
</td>
<td valign="TOP" width="50%"><div align="LEFT">
<span style="font-family: Palatino Linotype, serif;"><span style="font-size: 13pt;"><span style="color: #222222;">Animations
for adding and removing items are enabled by default in
</span><code class="western"><span style="color: #006600;"><span style="font-family: Palatino Linotype, serif;">RecyclerView</span></span></code>
</span></span>
</div>
</td>
</tr>
</tbody></table>
<br />
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
Thanks for reading :)</div>
<div align="LEFT" style="margin-bottom: 0in; text-indent: 0in;">
Any suggestions can be added in comments. feedback are welcome.</div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-88992487699505239032014-09-04T23:39:00.002+05:302014-09-22T02:23:27.552+05:30Android: Notification in L<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="western">
<span style="font-size: large;">Notification in Android L:</span></h1>
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 10pt;">In
L, notifications receive an important structural visual and
functional update:</span></span></span><br />
<ul>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 10pt;">Visual
changes to notifications as part of material design</span></span></span></div>
</li>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 10pt;">Notifications
are now available on the device lock screen, yet sensitive content
can still be hidden behind it</span></span></span></div>
</li>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 10pt;">A
new presentation format called Heads-up for receiving high priority
notifications while using the device</span></span></span></div>
</li>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 10pt;">Cloud-synced
notifications - act on a notification on your Android tablet and it
is also dismissed on your phone.</span></span></span></div>
</li>
<li><div style="border: none; line-height: 0.2in; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 10pt;">And
starting now (in Android 4.4W, API Level 20, the platform release
for Android Wear), your notifications will bridge to Android Wear
devices. You can extend the functionality of notifications on Wear
in two different ways. First, you can add speech input and canned
responses to Actions on Wear, allowing users to complete tasks from
their wrists. Second, you can write Wear apps that hook into your
notifications to go even further in terms of creating interactive
experiences for users.</span></span></span></div>
</li>
</ul>
<br />
For more information of notifications ref <a href="https://developer.android.com/preview/notifications.html">android notifications</a>.<br />
<br />
Sample Code for showing notification<br />
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> /**
* Send a sample notification using the NotificationCompat API.
*/
public void sendNotification(View view) {
Intent intent = new Intent(
Intent.ACTION_VIEW,
Uri.parse("http://developer.android.com/reference/android/app/Notification.html"));
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0,
intent, 0);
NotificationCompat.Builder builder = new NotificationCompat.Builder(
this);
builder.setSmallIcon(R.drawable.ic_stat_notification);
// Set the intent that will fire when the user taps the notification.
builder.setContentIntent(pendingIntent);
builder.setAutoCancel(true);
builder.setLargeIcon(BitmapFactory.decodeResource(getResources(),
R.drawable.ic_launcher));
builder.setContentTitle("BasicNotifications Sample");
builder.setContentText("Time to learn about notifications!");
builder.setSubText("Tap to view documentation about notifications.");
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID, builder.build());
}
</code></pre>
<br />
Output:<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqG3f7PM2UCtLFaVn0EGtKwvVH1awMRgUCO0XrqHlrAmO4zMCNEAmQY_SxUi3mAD8Z1IVgD_M1YfBOpwrBU_NuPRYs7AcIj-lWvE9DvjOlt3legTJ-0v4PnytEaurA2pFoygjuCrAaJYWD/s1600/notificaiton.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqG3f7PM2UCtLFaVn0EGtKwvVH1awMRgUCO0XrqHlrAmO4zMCNEAmQY_SxUi3mAD8Z1IVgD_M1YfBOpwrBU_NuPRYs7AcIj-lWvE9DvjOlt3legTJ-0v4PnytEaurA2pFoygjuCrAaJYWD/s1600/notificaiton.png" height="320" width="186" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijj03izzq8zrJ3xXUhyqe7S3wsuzM3vAQhAbDWLB24Z3nvHNo5Vb-czJpQnYd7wV2ffFQWVk98lTN4axt5XJzQStlUuWwjC2UIbzDKb37gl05Ulwkd4OBW3LJaLgc8wHxGLdQ8RNEjlUOf/s1600/notification_appeared.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijj03izzq8zrJ3xXUhyqe7S3wsuzM3vAQhAbDWLB24Z3nvHNo5Vb-czJpQnYd7wV2ffFQWVk98lTN4axt5XJzQStlUuWwjC2UIbzDKb37gl05Ulwkd4OBW3LJaLgc8wHxGLdQ8RNEjlUOf/s1600/notification_appeared.png" height="320" width="248" /></a>
<br />
<br />
In first pic, we can see the notification received in the status bar.<br />
On drag of screen from top. We can see, how the basic notification appears.<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-19564161271859072622014-09-03T12:05:00.000+05:302014-09-22T14:28:08.295+05:30Quick glance of Android L features<div dir="ltr" style="text-align: left;" trbidi="on">
<h1 class="western">
Android L</h1>
<h4 class="western" style="font-weight: normal;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="color: #222222;">Android
L is a next version of kitkat, Coming with new designs, features and
updates... </span></span></span></span>
</h4>
<h4 align="LEFT" class="western" style="font-weight: normal;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Android
L is Faster, better looking and more efficient.</span></span></span></h4>
<h3 class="western">
<div align="LEFT" style="line-height: 0.24in; margin-bottom: 0in;">
<span style="color: #2b2b2b;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-weight: normal;"><span style="background: #ffffff;">Android
L is going to change the way it looks with material design- These
projects extend Android to the TV (Android TV), to the car (Android
Auto) and to wearables (Android Wear), among others. </span></span></span></span></span>
</div>
<div align="LEFT" style="font-weight: normal; line-height: 0.24in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-weight: normal;">See
the </span></span></span></span><a href="http://developer.android.com/preview/api-overview.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-weight: normal;">API
overview</span></span></span></span></span></a><span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-weight: normal;">
</span></span></span></span><span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-weight: normal;">for
more information on the rest of the new and updated features. Lets
look a quick view of all the API's.</span></span></span></span><br />
<a name='more'></a></div>
</h3>
<table border="1" bordercolor="#000000" cellpadding="4" cellspacing="0" style="page-break-before: always; width: 100%px;">
<colgroup><col width="128*"></col>
<col width="128*"></col>
</colgroup><tbody>
<tr valign="TOP">
<td width="50%"><div align="CENTER">
<span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><b>Changes</b></span></span></div>
</td>
<td width="50%"><div align="CENTER">
<span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><b>Usage</b></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western">
<a href="https://www.blogger.com/null" name="ART"></a><span style="font-family: Roboto, sans-serif;"><span style="font-size: small;"><span style="color: #333333;"><span style="font-style: normal;"><span style="font-weight: normal;">Android
Runtime (ART)</span></span></span></span></span></h3>
</td>
<td valign="TOP" width="50%"><ul>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">The
new Android runtime (ART) is available on some of the newest
Android devices, though all of them currently have Dalvik as the
default runtime.</span></span></span></div>
</li>
<li><div style="border: none; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;">App
developers should make sure their apps are compatible with ART,
especially if you use JNI to run native code or if you use
certain tools that produce non-standard code (such as some
obfuscators).</span></span></span></span></div>
</li>
<li><div style="border: none; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<a href="https://www.blogger.com/null" name="GC_Migration"></a>
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">Addressing
Garbage Collection (GC) Issues</span></span></span></span></div>
</li>
<li><div style="border: none; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;">Improved
debugging support</span></span></span></span></div>
</li>
<li><div style="border: none; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<a href="https://www.blogger.com/null" name="JNI_Issues"></a>
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;">Preventing
JNI Issues</span></span></span></span></div>
</li>
<li><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;"><span style="font-style: normal;"><span style="font-weight: normal;">Preventing
Stack Size Issues</span></span></span></span></span><br />
</li>
<li><a href="https://www.blogger.com/null" name="AOT_Fails"></a><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;"><span style="font-weight: normal;">Fixing
AOT (</span></span><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">ART's
Ahead-Of-Time</span></span></span><span style="color: #333333;"><span style="font-weight: normal;">)Compilation
Issues</span></span></span></span><br />
</li>
</ul>
</td>
</tr>
<tr>
<td colspan="2" valign="TOP" width="100%"><div align="CENTER">
<span style="font-family: Roboto, sans-serif;"><span style="font-size: small;"><b>User
Interfaces (</b><span style="color: #333333;"><span style="font-style: normal;"><span style="font-weight: normal;">Material
design)</span></span></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Material
design</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><ul>
<li><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">A
new theme</span></span></span></div>
</li>
<li><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">New
widgets for complex views</span></span></span></div>
</li>
<li><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">New
APIs for custom shadows and animations</span></span></span></span></span><br />
</li>
</ul>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Material
Theme</span></span></span></h3>
<h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<br />
</h3>
</td>
<td valign="TOP" width="50%"><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">The
new material theme provides:</span></span></span></span></span></code><br />
<ul>
<li><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">System
widgets that let you set their color palette</span></span></span></span></span></code><br />
</li>
<li><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">Touch
feedback animations for the system widgets</span></span></span></span></span><br />
</li>
<li><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">Activity
transition animations</span></span></span></span></span><br />
</li>
</ul>
<code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">The
material theme is defined as:</span></span></span></span></span></code><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">
</span></span></span></span></span></code>
<br />
<code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">@android:style/Theme.Material
</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">(dark
version)</span></span></span></span></span><br />
<code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">@android:style/Theme.Material.Light
</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">(light
version)</span></span></span></span></span><br />
<code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">@android:style/Theme.Material.Light.DarkActionBar</span></span></span></span></span></code><br />
<br />
<span style="color: #333333; font-family: 'Times New Roman', serif;">Customize
the Color Palette</span><br />
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #333333;"><span style="font-style: normal;"><span style="font-weight: normal;">Customize
the Status and Navigation Bar</span></span></span></span></span><br />
<br /></td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">New
Widgets</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">The
Android L Developer Preview includes two new widgets for
displaying complex views:</span></span></span></div>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0in;">
<br /></div>
<div style="font-style: normal; margin-bottom: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><b>RecyclerView</b></span></span></code></span></span></span></div>
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">The
new </span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">RecyclerView</span></span></span></span></code><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">
</span></span></span></span></code><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">widget
is a more advanced version of </span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">ListView</span></span></span></span></code><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">
</span></span></span></span></code><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">that
provides performance improvements for dynamic views and is easier
to use.</span></span></span> </span></span>
<br />
<h3 class="western" style="font-style: normal;">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Animations : </span></span></span><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">Animations
for adding and removing items are enabled by default in
</span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">RecyclerView</span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-weight: normal;">.</span></span></span></span></h3>
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><b>CardView</b></span></span></span></code></span></span><br />
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">The
new </span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">CardView</span></span></span></span></code><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">
</span></span></span></span></code><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">widget
lets you display important pieces of information inside cards that
have a consistent look and feel.</span></span></span> </span></span>
<br />
<br />
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">To
create a card with a shadow, use the </span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">android:elevation</span></span></span></span></code><code class="western"><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">
</span></span></span></span></code><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">attribute</span></span></span>
</span></span>
<br />
<br />
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">Here's
how to specify properties of </span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">CardView</span></span></span></span></code><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">:</span></span></span></span></span><br />
<ul>
<li><div style="border: none; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">To
set the corner radius in your layouts, use the
</span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">card_view:cardCornerRadius
</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">attribute.</span></span></span></span></span></div>
</li>
<li><div style="border: none; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">To
set the corner radius in your code, use the </span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">CardView.setRadius
</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">method.</span></span></span></span></span></div>
</li>
<li><div style="border: none; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">To
set the background color of a card, use the
</span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">card_view:cardBackgroundColor
</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">attribute.</span></span></span></span></span></div>
</li>
</ul>
<br />
<br /></td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Views
and Shadows</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">The
elevation of a view determines the size of its shadow: views with
higher Z values cast bigger shadows. Views only cast shadows on
the Z=0 plane under an orthographic projection</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<br /></div>
<a href="https://developer.android.com/preview/material/views-shadows.html#elevation"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">View
Elevation</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/views-shadows.html#shadows"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Shadows
and Outlines</span></span></span></span></span></span></a><br />
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="text-decoration: none;"><span style="font-style: normal;"><span style="font-weight: normal;">The
bounds of a view's background drawable determine the default shape
of its shadow.</span></span></span></span><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-style: normal;"><span style="font-weight: normal;">
</span></span></span></span></span></span>
<br />
<br />
<a href="https://developer.android.com/preview/material/views-shadows.html#clip"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Clipping
Views</span></span></span></span></span></span></a><br />
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">clipping
views is an expensive operation, don't animate the shape you use
to clip a view. To achieve this effect, use a </span></span><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><a href="https://developer.android.com/preview/material/animations.html#reveal">Reveal
Effect</a> </span></span></span></span><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">animation.
</span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Animations</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><a href="https://developer.android.com/preview/material/animations.html#touch"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Touch
Feedback</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/animations.html#reveal"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Reveal
Effect</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/animations.html#transitions"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Activity
Transitions</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/animations.html#curvedmotion"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Curved
Motion</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/animations.html#viewstate"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Animating
View State Changes</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/animations.html#drawabletint"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Drawable
Tinting</span></span></span></span></span></span></a><br />
<a href="https://developer.android.com/preview/material/animations.html#colorextract"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Extracting
Colors from an Image</span></span></span></span></span></span></a></td>
</tr>
<tr>
<td colspan="2" width="100%"><h3 align="CENTER" class="western">
<span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">Notifications</span></span></h3>
</td>
</tr>
<tr>
<td width="50%"><h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Base
Layout</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="ExpandedLayouts"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Expanded
layouts</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="actions"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Actions</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="notifications_on_android_wear"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Notifications
on Android Wear</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Bridging
notifications</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Bridging
actions</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Heads-up
Notification</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="ongoing_notifications"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Ongoing
notifications</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Ranking
and Ordering</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">On
the lockscreen notification</span></span></span></h3>
<h3 align="LEFT" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">The
user decides what shows on the secure lockscreen</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Visual
changes to notifications as part of material design</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Notifications
are now available on the device lock screen, yet sensitive content
can still be hidden behind it</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">A
new presentation format called Heads-up for receiving high
priority notifications while using the device</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Cloud-synced
notifications - act on a notification on your Android tablet and
it is also dismissed on your phone.</span></span></span></div>
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">And
starting now (in Android 4.4W, API Level 20, the platform release
for Android Wear), your notifications will bridge to Android Wear
devices. You can extend the functionality of notifications on Wear
in two different ways. First, you can add speech input and canned
responses to Actions on Wear, allowing users to complete tasks
from their wrists. Second, you can write Wear apps that hook into
your notifications to go even further in terms of creating
interactive experiences for users.</span></span></span></span></span><br />
<br /></td>
</tr>
<tr>
<td colspan="2" width="100%"><h2 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Graphics"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">Graphics</span></span></span></h2>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="OpenGLES-3-1"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Support
for OpenGL ES 3.1</span></span></span></h3>
<div align="CENTER" style="font-style: normal; font-weight: normal;">
<br /></div>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">adds
Java interfaces and native support for OpenGL ES 3.1. Key new
functionality provided in OpenGL ES 3.1 includes:</span></span></span></div>
<ul>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Compute
shaders</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Separate
shader objects</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Indirect
draw commands</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Multisample
and stencil textures</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Shading
language improvements</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Extensions
for advanced blend modes and debugging</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Backward
compatibility with OpenGL ES 2.0 and 3.0</span></span></span></div>
</li>
</ul>
<pre class="western"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #000088;"><span style="font-style: normal;"><span style="font-weight: normal;"><uses-feature</span></span></span><span style="color: black;"><span style="font-style: normal;"><span style="font-weight: normal;"> </span></span></span><span style="color: #882288;"><span style="font-style: normal;"><span style="font-weight: normal;">android:glEsVersion</span></span></span><span style="color: #666600;"><span style="font-style: normal;"><span style="font-weight: normal;">=</span></span></span><span style="color: #880000;"><span style="font-style: normal;"><span style="font-weight: normal;">"0x00030001"</span></span></span><span style="color: black;"><span style="font-style: normal;"><span style="font-weight: normal;"> </span></span></span><span style="color: #000088;"><span style="font-style: normal;"><span style="font-weight: normal;">/></span></span></span></span></span></pre>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="AndroidExtensionPack"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Android
Extension Pack</span></span></span></h3>
<div align="CENTER" style="font-style: normal; font-weight: normal;">
<br /></div>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">The
extension pack supports:</span></span></span></div>
<ul>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Guaranteed
fragment shader support for shader storage buffers, images, and
atomics (fragment shader support is optional in OpenGL ES 3.1.)</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Tessellation
and geometry shaders</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">ASTC
(LDR) texture compression format</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Per-sample
interpolation and shading</span></span></span></div>
</li>
<li><div style="border: none; font-style: normal; font-weight: normal; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Different
blend modes for each color attachment in a frame buffer</span></span></span></div>
</li>
</ul>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><h2 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Multimedia"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">Multimedia</span></span></span></h2>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="Camera-v2"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Camera
API for advanced camera capabilities</span></span></span></h3>
<h3 align="CENTER" class="western" style="page-break-after: avoid;">
<br /><br />
</h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">New
</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.hardware.camera2
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">API
to facilitate fine-grain photo capture and image processing. </span></span></span></span></span>
</div>
<div style="font-style: normal; font-weight: normal;">
<br />
<br /></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Now
programmatically access the camera devices available to the system
with </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">CameraManager.getCameraIdList()
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">and
connect to a specific device with</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">CameraManager.openCamera()</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.
To start capturing images, create a </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">CameraCaptureSession
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">and
specify the</span></span><code class="western"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><a href="https://developer.android.com/reference/android/view/Surface.html">Surface</a>
</span></span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">objects
for the captured images. The </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">CameraCaptureSession
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">can
be configured to take single shots or multiple images in a burst. </span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="AudioPlayback"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Audio
playback</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">changes
in </span></span><code class="western"><a href="https://developer.android.com/reference/android/media/AudioTrack.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">AudioTrack</span></span></span></span></a></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="MediaPlaybackControl"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Media
playback control</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">We
can now build our own media controller app with the new
</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.media.session.MediaController</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">class,
which provides simplified transport controls APIs that replace
those in </span></span><code class="western"><a href="https://developer.android.com/reference/android/media/RemoteControlClient.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">RemoteControlClient</span></span></span></span></a></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.
</span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><h2 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Storage"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">Storage</span></span></span></h2>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="DirectorySelection"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Directory
selection</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><h1 class="western" style="font-style: normal;">
<span style="color: #333333;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Storage
Access Framework</b></span></span></span></h1>
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #222222;"><span style="font-style: normal;"><span style="font-weight: normal;">The
SAF includes the following:</span></span></span></span></span><br />
<strong><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><b>Document
provider</b></span></span></span></span></strong><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">—A
content provider that allows a storage service (such as Google
Drive) to reveal the files it manages. A document provider is
implemented as a subclass of the</span></span></span></span></span><code class="western"><a href="https://developer.android.com/reference/android/provider/DocumentsProvider.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">DocumentsProvider</span></span></span></span></span></span></a></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;"> class.
The document-provider schema is based on a traditional file
hierarchy, though how your document provider physically stores
data is up to you. The Android platform includes several built-in
document providers, such as Downloads, Images, and Videos.</span></span></span></span></span><br />
<strong><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><b>Client
app</b></span></span></span></span></strong><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">—A
custom app that invokes
the</span></span></span></span></span><code class="western"><a href="https://developer.android.com/reference/android/content/Intent.html#ACTION_OPEN_DOCUMENT"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">ACTION_OPEN_DOCUMENT</span></span></span></span></span></span></a></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;"> and/or </span></span></span></span></span><code class="western"><a href="https://developer.android.com/reference/android/content/Intent.html#ACTION_CREATE_DOCUMENT"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">ACTION_CREATE_DOCUMENT</span></span></span></span></span></span></a></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;"> intent
and receives the files returned by document providers.</span></span></span></span></span><br />
<strong><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><b>Picker</b></span></span></span></span></strong><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">—A
system UI that lets users access documents from all document
providers that satisfy the client app's search criteria.</span></span></span></span></span><br />
<div style="font-style: normal; font-weight: normal; margin-bottom: 0.16in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Some
of the features offered by the SAF are as follows:</span></span></span></div>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0.16in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Lets
users browse content from all document providers, not just a
single app.</span></span></span></div>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0.16in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Makes
it possible for your app to have long term, persistent access to
documents owned by a document provider. Through this access users
can add, edit, save, and delete files on the provider.</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Supports
multiple user accounts and transient roots such as USB storage
providers, which only appear if the drive is plugged in.</span></span></span></div>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><h2 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Wireless"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">Wireless
& Connectivity</span></span></span></h2>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Multinetwork"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Multiple
network connections</span></span></span></h3>
<div align="CENTER" style="font-style: normal; font-weight: normal;">
<br /></div>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">New
multi-networking APIs </span></span></span>
</div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">These
let your app dynamically scan for available networks with specific
capabilities, and establish a connection to them. This is useful
when your app requires a specialized network, such as an SUPL,
MMS, or carrier-billing network, or if you want to send data using
a particular type of transport protocol. </span></span></span>
</div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="BluetoothBroadcasting"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Bluetooth
broadcasting</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">An
Android device can now act as a Bluetooth LE </span></span><em><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><i>peripheral
device</i></span></span></em><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.
</span></span></span></span></span>
</div>
<div style="font-style: normal; font-weight: normal;">
<br />
<br /></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">The
new </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.bluetooth.le</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> APIs
enable your apps to broadcast advertisements, scan for responses,
and form connections with nearby BLE devices. You must add the
</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.permission.BLUETOOTH_ADMIN</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">permission
in your manifest in order for your app to use the new advertising
and scanning features. </span></span></span></span></span>
</div>
<div style="font-style: normal; font-weight: normal;">
<br /></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="NFCEnhancements"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">NFC
enhancements</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">enhancements
to enable wider and more flexible use of NFC:</span></span></span></div>
<ul>
<li><div style="border: none; font-style: normal; font-weight: normal; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Android
Beam is now available in the share menu.</span></span></span></div>
</li>
<li><div style="border: none; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">Your
app can invoke the Android Beam on the user’s device to share
data by calling</span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">android.nfc.NfcAdapter.invokeBeam()</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">.
This avoids the need for the user to manually tap the device
against another NFC-capable device to complete the data transfer.</span></span></span></span></span></div>
</li>
<li><div style="border: none; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">You
can use the new </span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">android.nfc.NdefRecord.createTextRecord()</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;"> method
to create an NDEF record containing UTF-8 text data.</span></span></span></span></span></div>
</li>
<li><div style="border: none; margin-bottom: 0.05in; padding: 0in;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">If
you are developing a payment app, you now have the ability to
register an NFC application ID (AID) dynamically by
calling </span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">android.nfc.cardemulation.CardEmulation.registerAidsForService()</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">.
You can also
use </span></span></span></span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;">android.nfc.cardemulation.CardEmulation.setPreferredService()</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="font-style: normal;"><span style="font-weight: normal;"> to
set the preferred card emulation service that should be used when
a specific activity is in the foreground.</span></span></span></span></span></div>
</li>
</ul>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><div align="CENTER" style="font-style: normal; font-weight: normal;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-size: large;">Power
Efficiency</span></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="JobScheduler"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Scheduling
jobs</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">New
</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.app.job.JobScheduler
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">API
that lets you optimize battery life by defining jobs for the
system to run asynchronously at a later time or under specified
conditions (such as when the device is charging).</span></span></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="PowerMeasurementTools"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Developer
tools for power measurement</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><strong><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>batterystats</b></span></span></strong><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">
</span></span></span></span></span>
</div>
<dl>
<dt style="font-style: normal; font-weight: normal;"><span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><strong><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Battery
Historian</b></span></span></strong></span></span></span></dt>
</dl>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><h2 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Enterprise"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">Enterprise</span></span></span></h2>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="ManagedProvisioning"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Managed
provisioning</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">A </span></span><a href="https://developer.android.com/guide/topics/admin/device-admin.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">device
administrator</span></span></span></span></a><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> can
initiate a managed provisioning process to add a co-present but
separate </span></span><em><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><i>managed
profile</i></span></span></em><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> to
a device, if the user has an existing personal account. Apps that
are associated with managed profiles will appear alongside
non-managed apps in the user’s Launcher, Recent apps screen, and
notifications. </span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal; page-break-after: avoid;">
<a href="https://www.blogger.com/null" name="TaskLocking"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Task
locking</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">A
new task locking API that lets you temporarily restrict users from
leaving your app or being interrupted by notifications </span></span></span>
</div>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><div align="CENTER" style="font-style: normal; font-weight: normal;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-size: large;">Printing
Framework</span></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="PDFRender"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Render
PDF as bitmap</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">We
can now render PDF document pages into bitmap images for printing
by using the new</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.graphics.pdf.PdfRenderer</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> class.
You must specify a </span></span><code class="western"><a href="https://developer.android.com/reference/android/os/ParcelFileDescriptor.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">ParcelFileDescriptor</span></span></span></span></a></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> that
is seekable (that is, the content can be randomly accessed) on
which the system writes the the printable content. Your app can
obtain a page for rendering with </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">openPage()</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">,
then call </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">render()</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> to
turn the opened </span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">PdfRenderer.Page</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"> into
a bitmap. </span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><div align="CENTER" style="font-style: normal; font-weight: normal;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-size: large;">Testing
& Accessibility</span></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="TestingA11yImprovements"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Testing
and accessibility improvements</span></span></span></h3>
<span style="font-family: Roboto, sans-serif;"><br /></span>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222; font-family: 'Times New Roman', serif;">We
can execute shell commands from your instrumentation test</span></div>
<div style="font-style: normal; font-weight: normal;">
<br /></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">We
can use the new
</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">to
define standard or customized actions to perform on an
</span></span><code class="western"><a href="https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">AccessibilityNodeInfo</span></span></span></span></a></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">.</span></span></span></span></span></div>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><h2 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="IME"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: large;">IME</span></span></span></h2>
</td>
</tr>
<tr>
<td width="50%"><h3 align="CENTER" class="western" style="font-style: normal; font-weight: normal;">
<a href="https://www.blogger.com/null" name="Switching"></a>
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;">Easier
switching between input languages</span></span></span></h3>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Users
can more easily switch between all </span></span><a href="https://developer.android.com/guide/topics/text/creating-input-method.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">input
method editors (IME)</span></span></span></span></a><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">supported
by the platform. </span></span></span></span></span>
</div>
</td>
</tr>
<tr>
<td colspan="2" width="100%"><div align="CENTER" style="font-style: normal; font-weight: normal;">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: medium;"><span style="font-size: large;">Manifest
Declarations</span></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><div align="CENTER" style="font-style: normal; font-weight: normal;">
<div align="CENTER">
<span style="color: #333333;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 15pt;"><span style="color: #006600;">FEATURE_LEANBACK </span></span></span></span></div>
</div>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Declares
that your app must be installed only on devices that support the
</span></span><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><a href="https://developer.android.com/training/tv/index.html">Android
TV</a> </span></span></span></span><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">user
interface. </span></span></span></span></span>
</div>
<div style="font-style: normal; font-weight: normal;">
<br /></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><uses-feature
android:name="android.software.leanback"</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android:required="true"
/></span></span></span></div>
</td>
</tr>
<tr>
<td width="50%"><div align="CENTER" style="font-style: normal; font-weight: normal;">
<div align="CENTER">
<span style="color: #006600;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: 15pt;">FEATURE_WEBVIEW </span></span></span></div>
</div>
</td>
<td valign="TOP" width="50%"><div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Roboto, sans-serif;"><span style="font-size: x-small;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">Declares
that your app must only be installed on devices that fully
implement the</span></span><code class="western"><span style="color: #006600;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android.webkit.*
</span></span></span></code><span style="font-family: Times New Roman, serif;"><span style="font-size: small;">APIs.</span></span></span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<br /></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><uses-feature
android:name="android.software.webview"</span></span></span></div>
<div style="font-style: normal; font-weight: normal;">
<span style="color: #222222;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;">android:required="true"
/></span></span></span></div>
</td>
</tr>
</tbody></table>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-55095909934889769432014-08-13T14:28:00.002+05:302014-09-22T02:24:01.095+05:30Solution/Precaution to avoid android.os.TransactionTooLargeException<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Exception: </b><img alt=":mad:" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/icon_mad.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><br />
<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> </code><code style="word-wrap: normal;"><span style="color: red;">java.lang.RuntimeException: android.os.TransactionTooLargeException
at android.accounts.AccountManager.addAccountExplicitly(AccountManager.java:568)
</span></code></pre>
<br />
<b>Reason: </b><img alt=";))" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/teehee.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><br />
<b><br /></b>
The Binder transaction failed because it was too large.<br />
During a remote procedure call, the arguments and the return value of the call are transferred as Parcel objects stored in the Binder transaction buffer. If the arguments or the return value are too large to fit in the transaction buffer, then the call will fail and <b>TransactionTooLargeException</b> will be thrown.<br />
<br />
<b><span style="color: orange;">Possibility Cases: </span></b><img alt=":-w" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/waiting.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><b><span style="color: orange;"> </span></b><br />
<br />
There are two possible outcomes when a remote procedure call throws <b>TransactionTooLargeException</b>.<br />
<br />
<ul style="text-align: left;">
<li>Either the client was unable to send its request to the service (most likely if the arguments were too large to fit in the transaction buffer).</li>
<li>The service was unable to send its response back to the client (most likely if the return value was too large to fit in the transaction buffer).</li>
</ul>
It is not possible to tell which of these outcomes actually occurred. The client should assume that a partial failure occurred.<br />
<br />
<b><span style="color: blue;">Assumption: </span></b><img alt=":-?" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/thinking.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><br />
<br />
While adding account to <a href="http://developer.android.com/reference/android/accounts/AccountManager.html" target="_blank">AccountManager</a>. Adds an account directly to the AccountManager with the help of service call.<br />
When there is a huge amount of data getting exchanged between a service and an application, we will get android.os.TransactionTooLargeException.<br />
<br />
<b><span style="color: #274e13;">Solution/Precaution to avoid <a href="http://developer.android.com/reference/android/os/TransactionTooLargeException.html" target="_blank">android.os.TransactionTooLargeException</a> </span></b><img alt="*-:)" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/idealightbulb.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><br />
<br />
We don't have direct solution but we can take precaution to avoid exception.<br />
<ol style="text-align: left;">
<li>Try to keep all transactions relatively small.</li>
<li>Do not exchange huge data (roughly not greater than 512KB) between services and application because the Binder transaction buffer has a limited fixed size, currently 1Mb, which is shared by all transactions in progress for the process. </li>
</ol>
<div>
<br /></div>
<br />
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments and feedback are welcome...</span></div>
</div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-33528342445928875982014-08-06T10:48:00.000+05:302014-09-22T02:24:23.693+05:30Solution for ClientProtocolException Caused by CircularRedirectException.<span style="font-family: Courier New, Courier, monospace;">Exception occurred while hitting URL:</span><img alt="X(" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/angry.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><img alt=":((" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/crying.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><br />
<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Courier New, Courier, monospace;"> org.apache.http.client.ClientProtocolException
07-28 04:26:53.349: W/System.err(1276): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:557)
07-28 04:26:53.349: W/System.err(1276): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
07-28 04:26:53.349: W/System.err(1276): at com.loopj.android.http.AsyncHttpRequest.makeRequest(AsyncHttpRequest.java:78)
07-28 04:26:53.349: W/System.err(1276): at com.loopj.android.http.AsyncHttpRequest.makeRequestWithRetries(AsyncHttpRequest.java:102)
07-28 04:26:53.349: W/System.err(1276): at com.loopj.android.http.AsyncHttpRequest.run(AsyncHttpRequest.java:58)
07-28 04:26:53.349: W/System.err(1276): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
07-28 04:26:53.349: W/System.err(1276): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
07-28 04:26:53.349: W/System.err(1276): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
07-28 04:26:53.349: W/System.err(1276): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
07-28 04:26:53.349: W/System.err(1276): at java.lang.Thread.run(Thread.java:841)
07-28 04:26:53.349: W/System.err(1276): Caused by: org.apache.http.client.CircularRedirectException: Circular redirect to 'redirectURI'
07-28 04:26:53.353: W/System.err(1276): at org.apache.http.impl.client.DefaultRedirectHandler.getLocationURI(DefaultRedirectHandler.java:173)
07-28 04:26:53.353: W/System.err(1276): at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:923)
07-28 04:26:53.353: W/System.err(1276): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:475)
07-28 04:26:53.353: W/System.err(1276): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
</span></code></pre>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<h3>
<span style="color: blue; font-family: Courier New, Courier, monospace;">Details / Information about the Exception: </span><img alt=":-?" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/thinking.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /></h3>
<br />
<span style="font-family: Courier New, Courier, monospace;"><span style="color: blue;">ProtocolException </span>: Signals that an HTTP protocol violation has occurred. For example a malformed status line or headers, a missing message body, etc.</span><br />
<span style="font-family: Courier New, Courier, monospace;">When RedirectHandler determines the location request is expected to be redirected to given the response from the target server and the current request execution context.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">public static final String <span style="color: blue;">ALLOW_CIRCULAR_REDIRECTS </span>= "<span style="color: blue;">http.protocol.allow-circular-redirects</span>";</span><br />
<span style="font-family: Courier New, Courier, monospace;">Defines whether circular redirects (redirects to the same location) should be allowed. The HTTP spec is not sufficiently clear whether circular redirects are permitted, therefore optionally they can be enabled</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">When the redirection and the parameter of "http.protocol.allow-circular-redirects" is false it works for the first time and from the second time it throws CircularRedirectException("Circular redirect to '" + redirectURI + "'")</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="color: #cc0000; font-family: Courier New, Courier, monospace;"><b>We may get doubt, why first time we aren't getting the exception and allowed but not the second time? </b></span><img alt="*confused*" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/confused.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><br />
<span style="color: #cc0000; font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="font-family: Courier New, Courier, monospace;">Let look getLocationURI method of DefaultRedirectHandler.java class, we can found the code snippet as follows.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Courier New, Courier, monospace;"> if (redirectLocations.contains(redirectURI)) {
throw new CircularRedirectException("Circular redirect to '" + redirectURI + "'");
} else {
redirectLocations.add(redirectURI);
}
</span></code></pre>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">When first time we hit, the redirectLocations object is null and it will initializes</span><br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); color: black; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"><span style="font-family: Courier New, Courier, monospace;"> RedirectLocations redirectLocations = (RedirectLocations) context.getAttribute(REDIRECT_LOCATIONS);
if (redirectLocations == null) {
redirectLocations = new RedirectLocations();
context.setAttribute(REDIRECT_LOCATIONS, redirectLocations);
}
</span></code></pre>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">So, the redirectURI wont be available in the redirectLocations object. When we hit the second time, the redirectURI is existing in the redirectLocations object. So, the apache throwing CircularRedirectException.</span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<h3>
<span style="color: blue; font-family: Courier New, Courier, monospace;"><b>Solutions: </b></span><img alt=":-bd" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/thumbsup.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /></h3>
<span style="font-family: Courier New, Courier, monospace;">Here we have 2 solutions, either one of them we can use.</span><br />
<span style="font-family: Courier New, Courier, monospace;">1. getHttpClient().getParams().setParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS, true);</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">2. extend DefaultRedirectHandler and modify getLocationURI method.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif";"><span style="font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments / </span><span style="font-size: 15px; line-height: 17.633333206176758px;">feedback's</span><span style="font-size: 11.5pt; line-height: 17.633333206176758px;"> are welcome. </span></span><img alt=":-h" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/wave.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com0tag:blogger.com,1999:blog-4023775337223455601.post-33945575181349467002014-07-27T11:31:00.000+05:302014-09-22T02:24:56.431+05:30Android Supporting tools for Developers / Designers<div dir="ltr" style="text-align: left;" trbidi="on">
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;">This
post is going to give some useful tools which android developers
could be found easy during application development. I have listed
down few useful tools below.</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="color: #0b5394; font-family: Georgia, Times New Roman, serif;"><b>Tools
Used for Designers / Developers</b></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://angrytools.com/android/button/"><span style="color: navy;"><span lang="zxx"><u><b>Android
</b></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: #ff3333;"><b>Button</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><b>
Maker</b></u></span></span></a></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #555555;">Android
Button Maker is online tool to generate buttons code for Android
Apps. Android API provide Drawable Resources where XML file defines
geometric shape, including colors, border and gradients.</span><br /><span style="color: #555555;">These
button is generating based on shape drawable XML code which load
faster compare to normal png buttons. You can customize button
properties in setting panel and get source code.</span>
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpYcQp14y6hwZK1t530NCXJwPfDVQC4SP6xcdlvNdlrBCg6qf6fscUKHZfmdOF-h3bZhXwBw2bWOzDFxmk9PsN4N6M42r-_zNgUy1QAfqYPNzToeJZe7PGMiWr8g9E3978ybg94QksqnCp/s1600/ButtonMaker.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpYcQp14y6hwZK1t530NCXJwPfDVQC4SP6xcdlvNdlrBCg6qf6fscUKHZfmdOF-h3bZhXwBw2bWOzDFxmk9PsN4N6M42r-_zNgUy1QAfqYPNzToeJZe7PGMiWr8g9E3978ybg94QksqnCp/s1600/ButtonMaker.png" height="224" width="320" /></a></div>
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<a href="http://angrytools.com/android/pixelcalc/"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: navy;"><span lang="zxx"><u><span style="color: black;"><b>Android
</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: #ee0000;"><b>Pixel
</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: black;"><b>Calculator</b></span></u></span></span></span></a></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">Android
uses Density Independent Pixel (dpi) values to scales the actual
screen size. To get device pixel density use
getResources().getDisplayMetrics().density;
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><strong><span style="color: black;">Open
Source Utilities to Optimize PNG Images</span></strong>
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #666666;">There
are free tools such as</span> <span style="color: navy;"><span lang="zxx"><a href="http://optipng.sourceforge.net/" target="_blank"><span style="color: #007fa8;">OptiPNG</span></a></span></span><span style="color: #555555;">
</span><span style="color: #555555;">or
</span><span style="color: navy;"><span lang="zxx"><a href="http://pmt.sourceforge.net/pngcrush" target="_blank"><span style="color: #007fa8;">PNGCrush</span></a></span></span>
<span style="color: #494949;">or
</span><strong><a href="https://tinypng.com/" target="_blank"><span style="color: #1b93df;">TinyPNG</span></a></strong><span style="color: #666666;">
for optimizing PNG image files. These tools are open-source and use
command line utilities for optimizing PNG images. They can compress
the image by using various combinations of algorithms, such as
changing the bit depth, replacing unwanted chucks of data with text,
delta filters, and so forth to provide the smallest compressed
output.</span></span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">If
your app is highly depend on art/creative then you should think over
optimizing and shrinking art/creative to decrease file size, it would
help you to decrease APK size.</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #666666;"><br /></span><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://romannurik.github.io/AndroidAssetStudio/"><span style="color: navy;"><span lang="zxx"><u><b>Android
</b></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: #ff3333;"><b>Asset</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><b>
Studio</b></u></span></span></a></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">A
web-based set of tools for generating graphics and other assets that
would eventually be in an Android application's res/ directory.</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">Currently
available asset generators area available for:</span></div>
<ul>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://romannurik.github.io/AndroidAssetStudio/icons-launcher.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Launcher
icons</b></span></span></a></u></span></span></div>
</li>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://romannurik.github.io/AndroidAssetStudio/icons-actionbar.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Action
bar and tab icons</b></span></span></a></u></span></span></div>
</li>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://romannurik.github.io/AndroidAssetStudio/icons-notification.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Notification
icons</b></span></span></a></u></span></span></div>
</li>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://romannurik.github.io/AndroidAssetStudio/icons-nav-drawer-indicator.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Navigation
drawer indicator</b></span></span></a></u></span></span></div>
</li>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://romannurik.github.io/AndroidAssetStudio/icons-generic.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Generic
icons</b></span></span></a></u></span></span></div>
</li>
</ul>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.blogger.com/null" name="group-misc"></a>OTHER
GENERATORS <span style="color: #888888;">—
</span><span style="color: #888888;">MISCELLANEOUS
ASSET CREATION TOOLS</span></span></div>
<ul>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://romannurik.github.io/AndroidAssetStudio/nine-patches.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Simple
nine-patch generator</b></span></span></a></u></span></span></div>
</li>
<li><div align="JUSTIFY">
<span style="color: navy;"><span lang="zxx"><u><a href="http://developer.android.com/distribute/tools/promote/device-art.html"><span style="color: #0099cc;"><span style="font-family: Georgia, Times New Roman, serif;"><b>Official
Android Device Art Generator</b></span></span></a></u></span></span></div>
</li>
</ul>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="https://www.blogger.com/null" name="group-community"></a>COMMUNITY
TOOLS <span style="color: #888888;">—
</span><span style="color: #888888;">SIMILAR
TOOLS FROM THE OPEN SOURCE COMMUNITY</span></span></div>
<ul>
<li><div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: navy;"><span lang="zxx"><u><a href="http://jgilfelt.github.com/android-actionbarstylegenerator/"><span style="color: #0099cc;"><b>Android
Action Bar Style Generator</b></span></a></u></span></span><span style="color: #0099cc;"><b>
</b></span><span style="color: #333333;"><b>by
Jeff Gilfelt</b></span></span></div>
</li>
<li><div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: navy;"><span lang="zxx"><u><a href="http://android-holo-colors.com/"><span style="color: #0099cc;"><b>Android
Holo Colors Generator</b></span></a></u></span></span><span style="color: #0099cc;"><b>
</b></span><span style="color: #333333;"><b>by
Jérôme Van Der Linden</b></span></span></div>
</li>
</ul>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="color: #0b5394; font-family: Georgia, Times New Roman, serif;"><b>Tools
Used for Developers</b></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://code.google.com/p/android-unused-resources/"><span style="color: navy;"><span lang="zxx"><u><b>Remove
</b></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: #ff3333;"><b>Unused</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><b>
Resources</b></u></span></span></a></span></div>
<div align="JUSTIFY">
<span style="color: #555555; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #555555;">During
development you typically add a lot of resources such as files,
layouts, or drawables. As you go back and made changes and
improvements, some of these resources are no longer used, and get
left in your code. To detect such unused resources and remove them
from your APK file, use the </span><span style="color: navy;"><span lang="zxx"><a href="http://code.google.com/p/android-unused-resources/" target="_blank"><span style="color: #007fa8;">android-unused-resources</span></a></span></span><span style="color: #007fa8;">
</span><span style="color: #555555;">tool.
It scans your project and identifies unused resources. Removing them
minimizes the build time and reduces the APK file size.</span></span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><br /><br />
</span></div>
<div align="JUSTIFY">
<a href="https://www.buzzingandroid.com/tools/android-layout-finder/"><span style="font-family: Georgia, Times New Roman, serif;"><span style="color: navy;"><span lang="zxx"><u><b>Android
</b></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: #ff3333;"><b>Layout</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><b>
Finder</b></u></span></span></span></a></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">The
Android Layout Finder helps you create the code that ties your
Android UI and Java code together.</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">It's
real easy! Just paste your Android XML layout code in the first text
field, pick the views that you need, and your code is automatically
generated for you.</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">No
more typing out all those nearly identical findViewById() and
findFragmentById() calls in your activities or fragments whenever you
change your Android layouts.</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">This
tools having special output settings, which helps us in generating
code type using RoboGuice, member variable and so on.</span><br />
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6IwRbSvN6R0tIsSldEPaSen9ons6T69szJgcGZUf4P_yBxnBMIxFjYE6sfAPCp0ydEXkdHe_rf_WNr4M2kzzPOFbVGZbVVF1ueopcfZfh8jzGdpfqQ3scU0vb8QjvpMdc2-Kb4SvsslEu/s1600/layoutFinder.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6IwRbSvN6R0tIsSldEPaSen9ons6T69szJgcGZUf4P_yBxnBMIxFjYE6sfAPCp0ydEXkdHe_rf_WNr4M2kzzPOFbVGZbVVF1ueopcfZfh8jzGdpfqQ3scU0vb8QjvpMdc2-Kb4SvsslEu/s1600/layoutFinder.png" height="170" width="320" /></a></div>
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><span style="color: #666666;"><span lang="en-US">Similar
to the above layout to Java code generator, we have one
</span><a href="https://code.google.com/p/android-code-generator-plugin/">android-code-generator-plugin</a>
<span lang="en-US">for
eclipse which generates code from xml, which </span><span lang="en-US">Generating
Activity Class code based on XML layout.</span></span><span style="color: black;"><span lang="en-US">
</span></span>
</span></div>
<div align="JUSTIFY" lang="en-US">
<span style="font-family: Georgia, Times New Roman, serif;"><br />
</span></div>
<div align="JUSTIFY">
<span style="font-family: Georgia, Times New Roman, serif;"><a href="http://www.jsonschema2pojo.org/"><span style="color: navy;"><span lang="zxx"><u><b>JSON
</b></u></span></span><span style="color: navy;"><span lang="zxx"><u><span style="color: #ff3333;"><b>to</b></span></u></span></span><span style="color: navy;"><span lang="zxx"><u><b>
POJO </b></u></span></span></a>
</span></div>
<div align="JUSTIFY">
<span style="color: #2d2d2d; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">Generate
Plain Old Java Objects from JSON or JSON-Schema.
</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">This
tools helps in giving annotation style like Jackson 2.x,
Jackson
1.x, Gson.</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">Note:
Your
input Json Cannot be more than 51200 characters.</span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br />
</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWnaZg7LgyEEIaJw-NQkxqHPm_HjMD6iOOEsCWzGLmFYIiaP43QaJmnnwVc2h5DiqMO17sHg2cV7WF84UNDT7ZBlhZwfzjEQ_kHjLhT9nfdJnaE02ePb08gsB6nwnMPVNMX3e7oBgGUqYq/s1600/jsontopojo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWnaZg7LgyEEIaJw-NQkxqHPm_HjMD6iOOEsCWzGLmFYIiaP43QaJmnnwVc2h5DiqMO17sHg2cV7WF84UNDT7ZBlhZwfzjEQ_kHjLhT9nfdJnaE02ePb08gsB6nwnMPVNMX3e7oBgGUqYq/s1600/jsontopojo.png" height="197" width="320" /></a></div>
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br /></span>
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;"><br /></span></div>
<div align="JUSTIFY">
<span style="color: #666666; font-family: Georgia, Times New Roman, serif;">There
are some other tool for Json to POJO conversion, but it is not like
the above one, we can't copy and paste the Json, rather than we
should give the json url as input. For more info check
<a href="http://jsongen.byingtondesign.com/">Jsongen.byingtondesign</a></span></div>
<div align="JUSTIFY">
<br /></div>
<div align="JUSTIFY">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div align="JUSTIFY">
</div>
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments and feedback are welcome.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com1tag:blogger.com,1999:blog-4023775337223455601.post-72017850670333201122014-07-11T23:45:00.001+05:302014-09-22T02:24:36.501+05:30Android: iOS Style Badge App Icon for Sony, Samsung and HTC devices<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">This
post is continue to one of my old post </span><span style="font-family: 'Times New Roman', serif;"><a href="http://vardhan-justlikethat.blogspot.in/2013/11/android-get-ios-style-badge-app-icon.html">Android Get iOS Style Badge App Icon</a></span></div>
<div style="margin-bottom: 0in;">
<br />
Know a days we are seeing facebook,whatsapp and lots of apps are using badges on the app icon and they are not replacing any app icon and they are able to achieve badge on app icon and we should be having question, How it is possible?<br />
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">iOS
style badge icon is achieved in android by few manufactures (Sony,
Samsung, HTC...) but the way of implementation is different from each
one of the manufacture for the badge on app icon.</span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">Before
implementing the badge on app icon, check the manufacture and then
support.</span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: #3f7f5f;">//
The manufacturer of the product/hardware. </span></span></span>
</div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><span style="color: black;">Build.</span><span style="color: #0000c0;"><i>MANUFACTURER</i></span><span style="color: black;">;
</span></span></span>
</div>
<div align="LEFT" style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;">Lets
go with each of the manufacture implementation:</span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Sony:</b></span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Manifest
File changes:</b></span></span></div>
<div style="margin-bottom: 0in;">
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
</code></pre>
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Code
Changes:</b></span></span></div>
<div style="margin-bottom: 0in;">
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> try {
intent.setAction("com.sonyericsson.home.action.UPDATE_BADGE");
intent.putExtra("com.sonyericsson.home.intent.extra.badge.ACTIVITY_NAME", "com.vardhan.notificationbadgesample.MainActivity");
intent.putExtra("com.sonyericsson.home.intent.extra.badge.SHOW_MESSAGE", true);
intent.putExtra("com.sonyericsson.home.intent.extra.badge.MESSAGE", badgeno);
intent.putExtra("com.sonyericsson.home.intent.extra.badge.PACKAGE_NAME", "com.vardhan.notificationbadgesample");
sendBroadcast(intent);
} catch (Exception localException) {
Log.e("CHECK", "Sony : " + localException.getLocalizedMessage());
}
</code></pre>
<br />
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>HTC:</b></span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Manifest
File changes:</b></span></span></div>
<div style="margin-bottom: 0in;">
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT" />
</code></pre>
<br />
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Code
Changes:</b></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black;"> </span>
</div>
<div align="LEFT" style="margin-bottom: 0in;">
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> try {
Intent localIntent1 = new Intent("com.htc.launcher.action.UPDATE_SHORTCUT");
localIntent1.putExtra("packagename", "com.vardhan.notificationbadgesample");
localIntent1.putExtra("count", badgeno);
sendBroadcast(localIntent1);
Intent localIntent2 = new Intent("com.htc.launcher.action.SET_NOTIFICATION");
ComponentName localComponentName = new ComponentName(this, "com.vardhan.notificationbadgesample.MainActivity");
localIntent2.putExtra("com.htc.launcher.extra.COMPONENT", localComponentName.flattenToShortString());
localIntent2.putExtra("com.htc.launcher.extra.COUNT", 10);
sendBroadcast(localIntent2);
} catch (Exception localException) {
Log.e("CHECK", "HTC : " + localException.getLocalizedMessage());
}
</code></pre>
<br />
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Samsung:</b></span></span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Manifest
File changes:</b></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />
</code></pre>
<br />
<br /></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif;"><span style="font-size: small;"><b>Code
Changes:</b></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> try {
ContentResolver localContentResolver = getContentResolver();
Uri localUri = Uri.parse("content://com.sec.badge/apps");
ContentValues localContentValues = new ContentValues();
localContentValues.put("package", "com.vardhan.notificationbadgesample");
localContentValues.put("class", "com.vardhan.notificationbadgesample.MainActivity");
localContentValues.put("badgecount", Integer.valueOf(badgeno));
String str = "package=? AND class=?";
String[] arrayOfString = new String[2];
arrayOfString[0] = "com.vardhan.notificationbadgesample";
arrayOfString[1] = "com.vardhan.notificationbadgesample.MainActivity";
int update = localContentResolver.update(localUri, localContentValues, str, arrayOfString);
if (update == 0) {
localContentResolver.insert(localUri, localContentValues);
}
} catch (IllegalArgumentException localIllegalArgumentException) {
Log.e("CHECK", "Samsung1F : " + localIllegalArgumentException.getLocalizedMessage());
} catch (Exception localException) {
Log.e("CHECK", "Samsung : " + localException.getLocalizedMessage());
}
</code></pre>
</div>
<br />
<br />
<b style="background-color: white; line-height: 20.066667556762695px; text-align: justify;"><span style="color: #333333; font-family: "Book Antiqua","serif";">Output</span></b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5-OmyzdKa-1wSIdLllmzoNh4Ss5XwnGDXt6KD-AsGw7ImOjQejVuQd2OjBjROy1ylMjDwWIsnf-3UZfThTk71-ouedbMMbTa8a6lb7aGwifSWZMaCmzblKMhFAi0R48TH6yJIOpDBqPU/s1600/device-2014-07-11-234048.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5-OmyzdKa-1wSIdLllmzoNh4Ss5XwnGDXt6KD-AsGw7ImOjQejVuQd2OjBjROy1ylMjDwWIsnf-3UZfThTk71-ouedbMMbTa8a6lb7aGwifSWZMaCmzblKMhFAi0R48TH6yJIOpDBqPU/s1600/device-2014-07-11-234048.png" height="320" width="180" /></a></div>
<br />
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<b><span style="color: #333333; font-family: "Book Antiqua","serif";">Source Code</span></b><span style="font-family: 'Book Antiqua', serif; font-size: 13.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="color: #333333; font-family: "Book Antiqua","serif";">You can download the source code by clicking <a href="https://sites.google.com/site/vardhanexp/badgeicononappicon/NotificationBadgeSample.zip?attredirects=0&d=1">Source Code Click Here</a>: . This project is built using eclipse IDE. Unzip and import the project into Eclipse, it’s a good idea to use the Project by clean and rebuild from the project menu. It works in all API levels above 9</span></div>
<div class="MsoNormal">
<br /></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? comments/feedback are welcome.</span></div>
<br />Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com8tag:blogger.com,1999:blog-4023775337223455601.post-42131312973712894272014-07-01T12:41:00.002+05:302014-09-22T02:25:12.745+05:30Android : Workaround for webview not loading https url<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">Basic
steps to show WebView in the application</span></div>
<ol>
<li><div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">Use
WebView element in the layout xml.</span></div>
</li>
<li><div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">Provide
internet permission in the AndroidManifest.xml file.</span></div>
</li>
<li><div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">loadUrl
on WebView object.</span></div>
</li>
</ol>
<ol>
<li><div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">main.xml
in the res/layout folder</span></div>
</li>
</ol>
<div>
<span style="font-family: Courier New, monospace;">
</span><br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: Courier New, monospace;"><code style="color: black; word-wrap: normal;"> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<WebView
android:id="@+id/ displayWebview "
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
</code></span></pre>
<span style="font-family: Courier New, monospace;">
</span></div>
<ol start="2">
<li><div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">Application
must have access to the Internet. To get Internet access, request
the </span><span style="color: blue;"><u><a href="http://developer.android.com/reference/android/Manifest.permission.html#INTERNET"><span style="font-family: Courier New, monospace;">INTERNET</span></a></u></span><span style="font-family: Courier New, monospace;">
permission in the AndroidManifest.xml file</span></div>
</li>
</ol>
<div>
<span style="font-family: 'Courier New', monospace;">
</span>
<br />
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy1WEvRGrgoNEnxYvkl1GF7gKfdUt5WxuIvrDql0qrSF9fZpgYNpGXrR9K5LfHMThVg3iUOi30SBdwKViZSMtx16U51NN_L4eGtRgm1WKi_2uycVZwTOqoHrzV_NfHb-9fcQhAcsP6HCkG/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><span style="font-family: 'Courier New', monospace;"><code style="color: black; word-wrap: normal;"> <manifest ... >
<uses-permission android:name="android.permission.INTERNET" />
...
</manifest>
</code></span></pre>
<span style="font-family: 'Courier New', monospace;">
</span></div>
<ol start="3">
<li><div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">call
the loadUrl() on webview object inside the onCreate() method of your
activity class and pass the url as a parameter to it .</span><span style="font-family: Courier New, monospace;"><span style="font-size: small;">
</span></span>
</div>
</li>
</ol>
<div lang="" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">WebView
webView = (WebView) findViewById(R.id.displayWebview);</span></div>
<div style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">webView.setWebViewClient(new
WebViewClient()); </span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">webView.loadUrl("https://www.google.co.in/");</span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: small;"><b>Problem:</b></span></span><span style="font-family: Courier New, monospace;">
WebView is not loading if the request is https.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">When
we try url with https request, we may face blank page or error
message saying “web page not available”</span></div>
<div style="margin-bottom: 0in;">
<br /></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: small;"><b>Issue:</b></span></span></div>
<div align="JUSTIFY" style="margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">WebView
support ssl default and If we want to support third party then with
few methods like setCertificate and so on we can make it. However,
WebView Shows blank screen if it is not supporting the certificates.
So, Catch the exception in </span><span style="font-family: Courier New, monospace;">onReceivedSslError
method and do respective action when certificate is not supported.
When certificate is not supported we may get blank screen or “Web
Page not available, The webpage at might be temporarily down or it
may have moved permanently to a new web address”.</span></div>
<div style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: small;"><b>Solution:</b></span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;">There
is a Work around to solve the issue by Overriding onReceivedSslError
method of WebViewClient as shown below.</span></div>
<div lang="" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">webView</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
= (WebView) findViewById(R.id.</span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">displayWebview</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">);</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">webView</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">.setWebViewClient</span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">(</span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>new
</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">Web</span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">ViewClient()
{</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"> @Override</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>public</b></span></span></span><span style="color: black;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>
</b></span></span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>void
</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">onReceivedSslError(</span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>final</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
WebView view, </span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>final</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
SslErrorHandler handler, SslError error) {</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">Log.d("CHECK",
"onReceivedSslError");</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">AlertDialog.Builder
builder = </span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>new</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
AlertDialog.Builder(this);</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">AlertDialog
alertDialog = builder.create();</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">String
message = "Certificate error.";</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>switch</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
(error.getPrimaryError()) {</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>case</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">
SslError.</span></span><span style="color: #0000cc; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">SSL_UNTRUSTED</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">:</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">message
= "</span></span><span style="color: #2a00ff; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">The
certificate authority is not trusted.</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">";</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>break</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">;</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b></b></span></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>case</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">
SslError.</span></span><span style="color: #0000cc; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">SSL_EXPIRED</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">:</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">message
= "</span></span><span style="color: #2a00ff; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">The
certificate has expired.</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">";</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>break</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">;</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b></b></span></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>case</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
SslError.</span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">SSL_IDMISMATCH</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">:</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">message
= "</span></span><span style="color: #2a00ff; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">The
certificate Hostname mismatch.</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">";</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; line-height: 100%;"> </span><span style="font-family: 'Courier New', monospace; line-height: 100%;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>break</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">;</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b></b></span></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>case</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
SslError.</span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">SSL_NOTYETVALID</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">:</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">message
= "</span></span><span style="color: #2a00ff; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">The
certificate is not yet valid.</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">";</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; line-height: 100%;"> </span><span style="font-family: 'Courier New', monospace; line-height: 100%;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>break</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">;</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">}</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">message
+= " </span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">Do
you want to continue anyway?</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">";</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">alertDialog.setTitle("</span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">SSL
Certificate Error</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">");</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">alertDialog.setMessage(message);</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace; font-size: 15px;"> </span><span style="font-family: 'Courier New', monospace; font-size: 15px;"> </span><span style="font-family: 'Courier New', monospace; font-size: 15px;"> </span><span style="font-family: 'Courier New', monospace; font-size: 15px;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">alertDialog.setButton(DialogInterface.</span></span><span style="color: #0000cc; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">BUTTON_POSITIVE</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">,</span></span><span style="font-family: 'Courier New', monospace; font-size: 15px; line-height: 100%;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">"</span></span><span style="color: #0000cc; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">OK</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">",</span></span><span style="font-family: 'Courier New', monospace; font-size: 15px; line-height: 100%;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>new</b></span></span></span><span style="font-family: 'Courier New', monospace; font-size: 15px; line-height: 100%;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">OnClickListener() {</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">@Override</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>public</b></span></span></span><span style="color: black;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>
</b></span></span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>void
</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">onClick(DialogInterface
dialog, </span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>int</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
which) {</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; line-height: 100%;"> </span><span style="font-family: 'Courier New', monospace; line-height: 100%;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">Log.d("CHECK",
"Button ok pressed");</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">//
Ignore SSL certificate errors</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">handler.proceed();</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">}</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">});</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">alertDialog.setButton(DialogInterface.</span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">BUTTON_NEGATIVE</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">,
"</span></span><span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">Cancel</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">",
</span></span><span style="color: #7f0055;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>new</b></span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">
OnClickListener() {</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">@Override</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"></span></span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>public</b></span></span></span><span style="color: black; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>
</b></span></span></span><span style="color: #7f0055; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;"><b>void
</b></span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">onClick(DialogInterface
dialog, int which) {</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">Log.d("</span></span><span style="color: #0000cc; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">CHECK</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">",
"</span></span><span style="color: #0000cc; line-height: 100%;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">Button
cancel pressed</span></span></span><span style="font-family: Courier New, monospace; line-height: 100%;"><span style="font-size: 11pt;">");</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">handler.cancel();</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace; font-size: 11pt; line-height: 100%;">}</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">});</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">alertDialog.show();</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: 'Courier New', monospace;"> </span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">}</span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">}); </span></span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<span style="color: #0000cc;"><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">webView</span></span></span><span style="font-family: Courier New, monospace;"><span style="font-size: 11pt;">.loadUrl("https://www.google.co.in/");</span></span></div>
<br />
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? comments / feedback are welcome.</span></div>
<div align="JUSTIFY" style="line-height: 100%; margin-bottom: 0in;">
<br /></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com6tag:blogger.com,1999:blog-4023775337223455601.post-89593847345301181722014-06-19T16:19:00.000+05:302014-09-22T02:26:15.723+05:30Navigation Drawer Icon in Action Bar without Using Drawer Layout<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="margin-bottom: 0in;">
<span style="font-size: small;">This post help us to get navigation
drawer icon without android drawer layout in the Action Bar.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif; font-size: small;">Enable
action bar icon to support navigation drawer toggle.</span></div>
<div style="margin-bottom: 0in;">
<span style="color: #3f7f5f; font-size: small;"> <span style="font-family: Times New Roman, serif;">//
Set whether home should be displayed as an "up" <u>affordance</u>.</span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: #3f7f5f; font-size: small;"> <span style="font-family: Times New Roman, serif;">//
Set this to true if selecting "home" returns up by a single
level in your UI rather than back to the top level or front page.</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
<span style="font-family: Times New Roman, serif;">getActionBar().setDisplayHomeAsUpEnabled(<span style="color: #7f0055;"><b>true</b></span><span style="color: black;">);</span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: black;"> </span></span></div>
<div style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"> </span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #3f7f5f;">//</span><span style="color: #3f7f5f;"><span style="font-style: normal;"><span style="font-weight: normal;">Enable
or disable the "home" button in the corner of the action
bar.</span></span></span><span style="color: #3f7f5f;"> </span></span>
</div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
<span style="font-family: Times New Roman, serif;">getActionBar().setHomeButtonEnabled(<span style="color: #7f0055;"><b>true</b></span><span style="color: black;">);</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">We should be aware of
<a href="https://developer.android.com/design/patterns/navigation-drawer.html">navigation
drawer</a> before starting, navigation drawer helps user to bring the
navigation drawer onto the screen by swiping from the left edge of
the screen or by touching the application icon on the action bar. </span>
</div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">On Tap of application
icon, Navigation drawer opens by using DrawerLayout listeners, where
ActionBarDrawerToggle supports us from toggling the drawer. </span>
</div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><a href="https://developer.android.com/reference/android/support/v4/app/ActionBarDrawerToggle.html">ActionBarDrawerToggle</a></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">This class provides a
handy way to tie together the functionality of DrawerLayout and the
framework ActionBar to implement the recommended design for
navigation drawers.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">ActionBarDrawerToggle(Activity
activity, DrawerLayout drawerLayout, int drawerImageRes, int
openDrawerContentDescRes, int closeDrawerContentDescRes)</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">Construct a new
ActionBarDrawerToggle.</span></div>
<div style="margin-bottom: 0in;">
<span style="color: #222222; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">The
given </span></span></span></span><span style="font-size: small;"><code class="western"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;"><a href="https://developer.android.com/reference/android/app/Activity.html">Activity</a>
</span></span></span></span></span></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">will
be linked to the specified </span></span></span></span><code class="western"><a href="https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html"><span style="color: #258aaf;"><span style="text-decoration: none;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">DrawerLayout</span></span></span></span></span></a></code><span style="color: #222222;"><span style="font-family: Times New Roman, serif;"><span style="font-style: normal;"><span style="font-weight: normal;">.
The provided drawer indicator drawable will animate slightly
off-screen as the drawer is opened, indicating that in the open state
the drawer will move off-screen when pressed and in the closed state
the drawer will move on-screen when pressed.</span></span></span></span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">String resources must be provided to
describe the open/close drawer actions for accessibility services.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">Parameters</span></div>
<span style="font-size: small;">
</span><br />
<table border="0" cellpadding="2" cellspacing="0" style="width: 655px;">
<colgroup><col width="192"></col></colgroup><colgroup><col width="455"></col>
</colgroup><tbody>
<tr>
<td width="192"><span style="font-size: small;">activity</span></td>
<td width="455"><span style="font-size: small;">The Activity hosting the drawer</span></td>
</tr>
<tr>
<td width="192"><span style="font-size: small;">drawerLayout</span></td>
<td width="455"><span style="font-size: small;">The DrawerLayout to link to the given Activity's ActionBar</span></td>
</tr>
<tr>
<td width="192"><span style="font-size: small;">drawerImageRes</span></td>
<td width="455"><span style="font-size: small;">A Drawable resource to use as the drawer indicator</span></td>
</tr>
<tr>
<td width="192"><span style="font-size: small;">openDrawerContentDescRes</span></td>
<td width="455"><span style="font-size: small;">A String resource to describe the "open drawer"
action for accessibility</span></td>
</tr>
<tr>
<td width="192"><span style="font-size: small;">closeDrawerContentDescRes</span></td>
<td width="455"><span style="font-size: small;">A String resource to describe the "close drawer"
action for accessibility</span></td>
</tr>
</tbody></table>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;">The third parameter is the drawable
which we are seeing beside the action bar icon.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><b>Now the question, How can we update
the navigation drawer icon without DrawerLayout?</b></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif; font-size: small;">Just
call <span style="color: black;">updateNavigationDrawerIcon method after
enabling the action bar methods.</span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"> </span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b>public</b></span><span style="color: black;">
</span><span style="color: #7f0055;"><b>void</b></span><span style="color: black;">
updateNavigationDrawerIcon(Drawable drawable) {</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
<span style="font-family: Times New Roman, serif;">Method
setHomeAsUpIndicator;</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b><span style="color: black;">
</span>try</b></span><span style="color: black;">
{</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span>setHomeAsUpIndicator
= ActionBar.<span style="color: #7f0055;"><b>class</b></span><span style="color: black;">.getDeclaredMethod(</span><span style="color: #2a00ff;">"setHomeAsUpIndicator"</span><span style="color: black;">,
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;">
</span>Drawable.</span><span style="color: #7f0055;"><b>class</b></span><span style="color: black;">);</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span>setHomeAsUpIndicator.invoke(getActionBar(),
drawable);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span>}
<span style="color: #7f0055;"><b>catch</b></span><span style="color: black;">
(NoSuchMethodException e) {</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;">
</span></span>Log.<span style="color: black;"><i>e</i></span><span style="color: black;">(</span><span style="color: #2a00ff;">"CHECK"</span><span style="color: black;">,
</span><span style="color: #2a00ff;">"No Such Method"</span><span style="color: black;">);</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;">
</span>
</span>View
home = findViewById(android.R.id.<span style="color: #0000c0;"><i>home</i></span><span style="color: black;">);</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;">
</span></span>ViewGroup
parent = (ViewGroup) home.getParent();</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="color: black;">
</span>
</span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b>int</b></span><span style="color: black;">
childCount = parent.getChildCount();</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
</span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b><span style="color: black;">
</span>if</b></span><span style="color: black;">
(childCount == 2) {</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="color: black;">
</span> </span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b><span style="color: black;">
</span>final</b></span><span style="color: black;">
View first = parent.getChildAt(0);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="color: black;">
</span>
</span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b><span style="color: black;"> </span>final</b></span><span style="color: black;">
View second = parent.getChildAt(1);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="color: black;"><span style="color: black;">
</span>
</span> </span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b>final</b></span><span style="color: black;">
View up = first.getId() == android.R.id.</span><span style="color: #0000c0;"><i>home</i></span><span style="color: black;">
? second : first;</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"> </span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;">
</span>
</span>((ImageView)
up).setImageDrawable(drawable);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;">
</span>
</span>}</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span>}
<span style="color: #7f0055;"><b>catch</b></span><span style="color: black;">
(Exception e) {</span></span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span>e.printStackTrace();</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span>}</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"> <span style="font-family: Times New Roman, serif;">}</span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times New Roman, serif; font-size: small;">On
click of app icon, we will be invoking onOptionsItemSelected method.</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"> </span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #646464;">@Override</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b>public</b></span><span style="color: black;">
</span><span style="color: #7f0055;"><b>boolean</b></span><span style="color: black;">
onOptionsItemSelected(MenuItem item) {</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span>switch</b></span><span style="color: black;">
(item.getItemId()) {</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b>case</b></span><span style="color: black;">
android.R.id.</span><span style="color: #0000c0;"><i>home</i></span><span style="color: black;">:</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span></span></span></span></span></span>Log.<span style="color: black;"><i>d</i></span><span style="color: black;">(</span><span style="color: #2a00ff;">"CHECK"</span><span style="color: black;">,
</span><span style="color: #2a00ff;">"Navigation Icon is selected"</span><span style="color: black;">);</span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #3f7f5f;">//
Use for slide from left to right</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #0000c0;">slide_me</span><span style="color: black;">.toggleLeftDrawer();</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span><span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b>break</b></span><span style="color: black;">;</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"><span style="font-family: Times New Roman, serif;"><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span>}</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;">
</span><span style="font-family: Times New Roman, serif; font-size: small;"><span style="color: #7f0055;"><b><span style="color: black;"><span style="font-family: Times New Roman, serif;"><span style="color: black;">
</span></span></span>return</b></span><span style="color: black;">
</span><span style="color: #7f0055;"><b>super</b></span><span style="color: black;">.onOptionsItemSelected(item);</span></span></div>
<div align="LEFT" style="margin-bottom: 0in;">
<span style="color: black; font-size: small;"> <span style="font-family: Times New Roman, serif;">}</span></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div style="margin-bottom: 0in;">
<span style="font-family: Times,"Times New Roman",serif; font-size: small;">Output:</span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf1PJBc_eABs1mP6UU_wvTNeZ05uUhYE0oP64pQv9VufBh0IKMXmuVs0VBKwVSjbAIQpkwtdAjRgRQ6xQkMPk4jeTgu6A_c6Wz4QJLdWQvb8zsGNIPT4uRlPYij_esuV-JRE571Xz9vb03/s1600/1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgf1PJBc_eABs1mP6UU_wvTNeZ05uUhYE0oP64pQv9VufBh0IKMXmuVs0VBKwVSjbAIQpkwtdAjRgRQ6xQkMPk4jeTgu6A_c6Wz4QJLdWQvb8zsGNIPT4uRlPYij_esuV-JRE571Xz9vb03/s1600/1.png" height="320" width="192" /></a>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4HN7q-jQUWy8fQXMys1j_u7AXzjn5FPMSxo6x0xmi5aiBX_1kYDa5ZlyRoH4pZLmp2xCe5wPXzKnJKs1_wNS40_MCcb5Kf9y3Gak-XxlAjoaNDacLw5Krh0OW5GDf5LRhAC0b3S8wIPy6/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4HN7q-jQUWy8fQXMys1j_u7AXzjn5FPMSxo6x0xmi5aiBX_1kYDa5ZlyRoH4pZLmp2xCe5wPXzKnJKs1_wNS40_MCcb5Kf9y3Gak-XxlAjoaNDacLw5Krh0OW5GDf5LRhAC0b3S8wIPy6/s1600/2.png" height="320" width="192" /></a></span></div>
<div style="margin-bottom: 0in;">
<span style="font-size: small;"><br /></span>
<span style="font-size: small;"><br /></span>
<br />
<div class="MsoNormal" style="background: none repeat scroll 0% 0% white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="font-size: small;"><b><span style="color: #333333; font-family: "Book Antiqua","serif";">Source Code</span></b></span></div>
<div class="MsoNormal" style="background: none repeat scroll 0% 0% white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<span style="color: #333333; font-family: "Book Antiqua","serif"; font-size: small;">You can download the
source code by <a href="https://sites.google.com/site/vardhanexp/navdrawericonwithoutdrawerlayout/ActionBarWithNavigationIcon.zip?attredirects=0&d=1">Source Code Click Here</a>. This project is built using
eclipse IDE. Unzip and import the project into Eclipse, it’s a good idea to use
the Project by clean and rebuild from the project menu. It works in all API
levels above 14.</span></div>
<div class="MsoNormal">
<span style="font-size: small;"><br /></span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: small;">Thanks for reading :) </span></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: small;">Whether this post is helpful?</span></div>
<span style="font-size: small;"><br /></span>
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: small; line-height: 115%;">Have something to add to this post? If you have any other quick
thoughts/hints that you think people will find useful? Share it in the
comments.</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/11691190078991338208noreply@blogger.com1tag:blogger.com,1999:blog-4023775337223455601.post-41843901278588307082014-06-05T23:39:00.000+05:302014-09-22T02:26:30.641+05:30Android Immersive Mode for Dialog<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">This
post is going to be discussed about the problem of Immersive Mode for Dialog.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Before going to the details we need to know about
Immersive Mode and the usage?</span></b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Everyone
knows andorid came up with KitKat 4.4 version and it bought new features and
improvements.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Such
in case, Immersive mode is one among them, which allows developers to take
advantage of full screen from edge to edge on phones and tablets, hiding all
system UI such as the status bar and navigation bar.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="line-height: 14.25pt;">
<span lang="EN-US" style="color: #222222; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">To
make sure that users always have easy, consistent access to system UI from
full-screen immersive mode, Android 4.4 supports a new gesture — in immersive
mode, an edge swipe from the top or bottom of the screen now reveals the system
UI.</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">
<o:p></o:p></span></div>
<div class="MsoNormal" style="line-height: 14.25pt;">
<br /></div>
<div class="MsoNormal" style="line-height: 14.25pt;">
<span lang="EN-US" style="color: #222222; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">To
return to immersive mode, users can touch the screen outside of the bar bounds
or wait for a short period for the bars to auto-hide. For a consistent user
experience, the new gesture also works with previous methods of hiding the
status bar.</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">
<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">How to Use the Immersive Mode?<o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-bidi-font-weight: bold;">// This
snippet hides the system bars.</span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div style="border: solid silver 1.0pt; mso-border-alt: solid silver .25pt; mso-element: para-border-div; padding: 2.0pt 1.0pt 1.0pt 1.0pt;">
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">private</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">void</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> hideSystemUI</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">()</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">{</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">// Set
the IMMERSIVE flag.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">// Set
the content to appear under the system bars so that the content</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">//
doesn't resize when the system bars hide and show.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> mDecorView</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">setSystemUiVisibility</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">(</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #660066; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">SYSTEM_UI_FLAG_LAYOUT_STABLE<o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">|</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #660066; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION<o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">|</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #660066; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN<o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">|</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #660066; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">SYSTEM_UI_FLAG_HIDE_NAVIGATION </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">// hide nav bar</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">|</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #660066; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">SYSTEM_UI_FLAG_FULLSCREEN </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">// hide status bar</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">|</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #660066; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 150%;">SYSTEM_UI_FLAG_IMMERSIVE</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">);<o:p></o:p></span></div>
<div class="PreformattedText" style="border: none; line-height: 150%; mso-border-alt: solid silver .25pt; mso-padding-alt: 2.0pt 1.0pt 1.0pt 1.0pt; padding: 0cm;">
<span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;">}</span><b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 150%;"><o:p></o:p></span></b></div>
</div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Origin Code Snippet: </span></b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><a href="https://developer.android.com/training/system-ui/immersive.html"><b>Immersive
Training Material</b></a><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Before
setting the View Flags, know about them. <o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" style="border-collapse: collapse; border: none; margin-left: 2.75pt; mso-border-alt: solid windowtext .5pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext; mso-padding-alt: 2.75pt 2.75pt 2.75pt 2.75pt; mso-table-layout-alt: fixed;">
<tbody>
<tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 11.0cm;" valign="top" width="416"><div align="center" class="TableContents" style="text-align: center;">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Flag<o:p></o:p></span></b></div>
</td>
<td style="border-left: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 186.9pt;" valign="top" width="249"><div align="center" class="TableContents" style="text-align: center;">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Impact</span></b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 11.0cm;" valign="top" width="416"><div class="MsoNormal">
<span lang="EN-US" style="color: #cc6699; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">View</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">.</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">SYSTEM_UI_FLAG_LAYOUT_STABLE</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 186.9pt;" valign="top" width="249"><div class="TableContents">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Action bar is hidden<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 11.0cm;" valign="top" width="416"><div class="MsoNormal">
<span lang="EN-US" style="color: #cc6699; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">View</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION<o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 186.9pt;" valign="top" width="249"><div class="TableContents">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Hides Navigation Bar<o:p></o:p></span></div>
</td>
</tr>
<tr>
<td style="border-top: none; border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 11.0cm;" valign="top" width="416"><div class="MsoNormal">
<span lang="EN-US" style="color: #cc6699; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">View</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN </span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
</td>
<td style="border-bottom: solid windowtext 1.0pt; border-left: none; border-right: solid windowtext 1.0pt; border-top: none; mso-border-alt: solid windowtext .5pt; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt; padding: 2.75pt 2.75pt 2.75pt 2.75pt; width: 186.9pt;" valign="top" width="249"><div class="TableContents">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Hides Status Bar<o:p></o:p></span></div>
</td>
</tr>
</tbody></table>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Coming to the Problem:</span></b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">When we use Spinner, Alert Dialog, and Dialog and … Immersive mode
is not working.<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">For more Information visit the link </span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><a href="https://code.google.com/p/android/issues/detail?id=68031"><span style="color: black;">Android Issue regrading Immersive Mode</span></a><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Why this Problem is Occurring for
Dialog and so on...?</span></b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">Each Dialog, Alert Dialog, Spinners are having their own window
and it is not accessing application window.</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">So the flags which we are used for application window is not
impacting the Dialog, Alert Dialog window.</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">How to Solve this Issue for Dialog
Box?</span></b><b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-bidi-font-weight: bold;">Here we should know about the<b> </b></span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><a href="http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_NOT_FOCUSABLE">FLAG_NOT_FOCUSABLE</a>
</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">flag, which helps
us in solving the issue </span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-bidi-font-weight: bold;">and then </span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">just add the same Immersive Flags to the Dialog, it works as we
expect.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt; mso-bidi-font-weight: bold;">Setting this flag implies that the window will not
need to interact with a soft input method</span>. <span style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">So, Once the dialog is created
and shown then clear the flag, otherwise we can’t get access to the Navigation
Bar UI keys like back, home and etc..</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Look at the snippet:<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="PreformattedText">
<b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">final</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> Dialog dialog = </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">new</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> Dialog(v.getContext());<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.setCanceledOnTouchOutside(</span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">false</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.getWindow().setFlags(WindowManager.LayoutParams.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">FLAG_NOT_FOCUSABLE</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">, WindowManager.LayoutParams.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">FLAG_NOT_FOCUSABLE</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.getWindow().addFlags(WindowManager.LayoutParams.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">FLAG_ALT_FOCUSABLE_IM</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> |
WindowManager.LayoutParams.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">FLAG_KEEP_SCREEN_ON</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.getWindow().getDecorView().setSystemUiVisibility(<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> View.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> <o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> |
View.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">SYSTEM_UI_FLAG_LAYOUT_STABLE</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> <o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">
| View.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">SYSTEM_UI_FLAG_HIDE_NAVIGATION</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> <o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">
| View.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">SYSTEM_UI_FLAG_FULLSCREEN</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">
| View.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">SYSTEM_UI_FLAG_IMMERSIVE_STICKY</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> <o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">
| View.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.setContentView(R.layout.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">dialog_custom</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.setTitle(</span><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">"Immersive Mode Dialog"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.findViewById(R.id.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">dialogBtnYes</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">).setOnClickListener(</span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">new</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> OnClickListener() {<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> </span><span lang="EN-US" style="color: #646464; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">@Override</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">
</span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">public</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">void</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> onClick(View v) {</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"> dialog.dismiss();<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"> }<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"> });<o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.findViewById(R.id.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">dialogBtnNo</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">).setOnClickListener(</span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">new</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> OnClickListener() {<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> </span><span lang="EN-US" style="color: #646464; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">@Override</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">
</span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">public</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">void</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"> onClick(View v) {</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"> dialog.dismiss();<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">
}<o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"> });<o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">dialog.show();<o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">dialog.getWindow().clearFlags(WindowManager.LayoutParams.</span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">FLAG_NOT_FOCUSABLE</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;">);</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Now check the dialog box, how it appears...<o:p></o:p></span></div>
<div class="PreformattedText">
<br /></div>
<br />
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Happy Coding.. :) <o:p></o:p></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><br /></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><b>Screen shot:</b></span></div>
<div class="PreformattedText">
<br /></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><b><br /></b></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuV86OFMn-UNPRRZKU3cpbRKModT2k-_lXUxd-QFb7TeZyfVq3_X8AvXnYF2G3t7s9LFY35v88x3OI2H_xWeqRhRY2dxOPRVW3b-HXKsg1hdduQScOmyFOoxFfObPfsn5svoov6Brhwc/s1600/device-2014-06-03-105620.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOuV86OFMn-UNPRRZKU3cpbRKModT2k-_lXUxd-QFb7TeZyfVq3_X8AvXnYF2G3t7s9LFY35v88x3OI2H_xWeqRhRY2dxOPRVW3b-HXKsg1hdduQScOmyFOoxFfObPfsn5svoov6Brhwc/s1600/device-2014-06-03-105620.png" height="320" width="180" /></a></div>
<br />
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><b><br /></b></span></div>
<div class="PreformattedText">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 11.5pt;"><br /></span></div>
<div class="MsoNormal" style="background: white; line-height: 15.05pt; margin-bottom: 0in; text-align: justify; vertical-align: baseline;">
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 15.05pt; margin: 0cm 0cm 0.0001pt; vertical-align: baseline;">
<b><span style="color: #333333; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Source Code</span></b><span style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 15.05pt; margin: 0cm 0cm 0.0001pt; vertical-align: baseline;">
<span style="color: #333333; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">You can download the
source code by clicking here:<span class="apple-converted-space"> </span><a href="https://sites.google.com/site/vardhanexp/immersivemodefordialog/ImmeriveModeForDialog.zip?attredirects=0&d=1">Source</a>. This
project is built using eclipse IDE. Unzip and import the project into Eclipse,
it’s a good idea to use the Project by clean and rebuild from the project menu.
It works from API level 19.</span><span style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0cm;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0cm;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) </span><span style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0cm;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is
helpful?</span><span style="font-family: 'Bookman Old Style', serif; font-size: 11.5pt;"><o:p></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; text-align: start;">
<br /></div>
<div style="margin-bottom: .0001pt; margin: 0cm;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Have something to add to
this post? If you have any other quick thoughts/hints that you think people
will find useful? feedback's are welcome...</span></div>
</div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com4tag:blogger.com,1999:blog-4023775337223455601.post-59657937290318905832014-05-25T00:09:00.000+05:302014-09-22T02:25:55.396+05:30Android Custom Navigation Drawer Using ExpandableListView with Highlight for selected item<div style="background: white; line-height: 18.0pt; margin-bottom: .0001pt; margin: 0cm; mso-outline-level: 4; text-align: justify; vertical-align: baseline;">
<div class="MsoNormal" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; line-height: 15.05pt; margin-bottom: 0in; vertical-align: baseline;">
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">This
post is improvements to the previous posts discussed on customization
of navigation drawer and highlighting specific row of expandable
listview.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Since
there are few comments regarding the highlight of expandable list
view post, thought to show with new post using custom navigation
drawer. But how can we see the highlight of the expandable list view
in handset, let’s take navigation drawer and customize it to use
expandable list view.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Before
starting, I have faced few problems before starting
expandablelistview and few questions are shown below. They are?</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";">1. How
and why onchildclicklistener won’t respond but ongroupclicklistener
responding?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";">2. Whether
we can have different background to the group view and child view?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";">3. How
to highlight the group row or child row on selecting?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";">4. How
to give the feedback on selection of other row when there is a
highlight shown on the other row?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Let’s
start knowing the solution for the questions faced.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";">1. How
to get respond for </span></span><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>OnChildClickListener</b></span></span></span><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";"><b> </b></span></span><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";">and
where will be the problem?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Solution</b></span></span></span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><b>:</b></span></span><span style="color: #00b050;"> </span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";">return
true in isChildSelectable method of custom adapter.</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Reason</b></span></span></span><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><b>:</b></span></span><span style="color: #333333;"> </span><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";">When
we extend </span></span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>BaseExpandableListAdapter</b></span></span> <span style="font-family: "Bookman Old Style", "serif";">of </span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>ExpandableListView</b></span></span> <span style="font-family: "Bookman Old Style", "serif";">adapter,
we will be forced to override few methods. In one of the abstract
method, we have </span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>isChildSelectable(int
groupPosition, int childPosition)</b></span></span> <span style="font-family: "Bookman Old Style", "serif";">which
in turn </span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>returns</b></span></span><span style="font-size: 11pt;"> </span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>false</b></span></span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"> </span></span><span style="font-family: "Bookman Old Style", "serif";">default
when we implement. Since it is false, we are unable to get
respond </span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>OnChildClickListener</b></span></span><span style="font-family: "Bookman Old Style", "serif";">.
Turn it </span><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>true</b></span></span><span style="font-size: 11pt;"> </span><span style="font-family: "Bookman Old Style", "serif";">to
solve the porblem.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";">2. Whether
we can have different backgrounds to group and child views?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Solution</b></span></span></span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><b>:</b></span></span><span style="color: #00b050;"> </span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";">Yes</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Reason:</b></span></span><span style="color: #4f81bd;"> </span><span style="font-family: "Bookman Old Style", "serif";">use
custom adapter for expandablelistview and override getGroupView and
getChildView method, and use different inflater.inflate xml’s to
achieve it.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: "Bookman Old Style", "serif";">Create
2 layouts, one for group view and other for child view, let say
as </span><span style="font-family: "Courier New";">custom_list_view.xml
and custom_list_view_child.xml</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Inflate
the layouts in the respective methods of getGroupView and
getChildView and add android:background=" " to the layout.</span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";">3. How
to highlight the respective rows?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Solution:</b></span></span></span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><b> </b></span></span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";">By
using drawable xml’s and ItemChecked method of ExpandableListView.</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Reason:</b></span></span> <span style="font-family: "Bookman Old Style", "serif";">drawable
xml specify which color has to be shown on active of row and
ItemChecked method specify which row has to be highlighted.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in; text-indent: -0.25in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #4f81bd;"><span style="font-family: "Bookman Old Style", "serif";">4. How
to give feedback for other rows in the list view?</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Solution:</b></span></span></span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";"><b> </b></span></span><span style="color: #00b050;"><span style="font-family: "Bookman Old Style", "serif";">By
adding state_pressed item in the drawable xml’s.</span></span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-size: 12pt;"><span style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 11pt;"><b>Reason:</b></span></span> <span style="font-family: "Bookman Old Style", "serif";">Since
the drawable xml is mapped to the layout, the action of the row is
handled by the drawable xml. So, by adding state_pressed in the xml,
we can get feedback when user press on the other row of the xml.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;"><b>Source
Code</b></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">You
can download the source code by clicking </span></span></span><a href="https://sites.google.com/site/vardhanexp/customnavigationdrawerwithrowselection/CustomNavigationDrawer.zip?attredirects=0&d=1%20"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Here</span></span></a><span style="color: #333333;"><span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">. This
project is built using eclipse IDE. Unzip and import the project into
Eclipse, it’s a good idea to use the Project by clean and rebuild
from the project menu. It works in all API levels above 14.</span></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<br /></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;"><b>Output</b></span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">We
can see, all four question answered in the below image.</span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Customized
Navigation Drawer</span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Background
color's : White for Group View and Orange for Child Views.</span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Highlighted
Color : Blue</span></span></div>
<div align="JUSTIFY" style="line-height: 0.25in; margin-bottom: 0in; margin-left: 0.5in;">
<span style="font-family: "Bookman Old Style", "serif";"><span style="font-size: 12pt;">Feedback
Color : Green</span></span></div>
</div>
<div class="MsoNormal" style="line-height: normal; text-align: start;">
<b><br /></b>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcCNGzSIMvZdKxEKMfi5GlNyD7W_0hlikux5BjWbHD6rM9KTeMuj2hHqFs8HZ7a3wx97PCYhkJOjDAQ2_qDq8Is8_k7vgYNO5nYDaLf6NG8_S1v3l4Im9o7CAfwvRUwFxi5FXaXTOd-cc/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcCNGzSIMvZdKxEKMfi5GlNyD7W_0hlikux5BjWbHD6rM9KTeMuj2hHqFs8HZ7a3wx97PCYhkJOjDAQ2_qDq8Is8_k7vgYNO5nYDaLf6NG8_S1v3l4Im9o7CAfwvRUwFxi5FXaXTOd-cc/s1600/Untitled.png" height="320" width="192" /></a></div>
<b><br /></b>
<b><br /></b>
</div>
<div style="line-height: normal; margin: 0in; text-align: start;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Thanks for reading :) <o:p></o:p></span></div>
<div style="line-height: normal; margin: 0in; text-align: start;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<div style="line-height: normal; text-align: start;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; text-align: start;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments.</span></div>
</div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com7tag:blogger.com,1999:blog-4023775337223455601.post-5298471471923068262014-05-21T22:29:00.000+05:302014-09-22T02:26:52.968+05:30Android: Solution for Custom Navigation Drawer not responding to Click<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">This post is about
to solve and share the issue of navigation drawer when there is no action of
the items of the list view.<o:p></o:p></span></div>
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><br /></span></div>
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">Why the navigation drawer is not responding to the click's ? </span><img alt=":-?" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/thinking.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%; text-align: left;" /></div>
<div class="MsoBodyText" style="text-align: justify;">
<br /></div>
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">First we should
know few information of navigation drawer.<o:p></o:p></span></div>
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">What is
Navigation Drawer? How to customize it? and lot more…<o:p></o:p></span></div>
<div class="MsoBodyText" style="text-align: justify;">
<br /></div>
<div class="MsoBodyText" style="text-align: justify;">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">What is Navigation Drawer?<o:p></o:p></span></b></div>
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">The <a href="https://developer.android.com/design/patterns/navigation-drawer.html">navigation
drawer</a> is a panel that displays the app’s main navigation options on
the left edge of the screen. It is hidden most of the time, but is revealed
when the user swipes a finger from the left edge of the screen or, while at the
top level of the app, the user touches the app icon in the action bar. <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">To add a navigation drawer, declare
your user interface with a </span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt;"><a href="http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html"><span class="SourceText"><span style="color: windowtext; text-decoration: none;">DrawerLayout</span></span></a></span><span class="SourceText"><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt;">
</span></span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">object as the
root view of your layout. Inside the </span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt;"><a href="http://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html"><span class="SourceText"><span style="color: windowtext; text-decoration: none;">DrawerLayout</span></span></a></span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">, add one view
that contains the main content for the screen (your primary layout when the
drawer is hidden) and another view that contains the contents of the navigation
drawer. <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 12pt; text-align: justify;">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">What is DrawerLayout?<o:p></o:p></span></b></div>
<div class="MsoBodyText" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><a href="https://developer.android.com/reference/android/support/v4/widget/DrawerLayout.html">DrawerLayout</a>
acts as a top-level container for window content that allows for interactive
"drawer" views to be pulled out from the edge of the window.<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">How to customize the navigation drawer?<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">Since the drawer layout adds only two
views, and one view contains content of the screen and other view contains the
navigation drawer content. So, we can use only two views in customization also.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">Foe Eg: android example looks like
this.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="PreformattedText">
<br /></div>
<div style="background: #F7F7F7; border: solid silver 1.0pt; mso-border-alt: solid silver .25pt; mso-element: para-border-div; padding: 1.0pt 1.0pt 1.0pt 1.0pt;">
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><android .support.v4.widget.drawerlayout="" span=""><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></android></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">xmlns:android</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"http://schemas.android.com/apk/res/android"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:id</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@+id/drawer_layout"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_width</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_height</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><!--
The main content view --></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><framelayout span=""><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></framelayout></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:id</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@+id/content_frame"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_width</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_height</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">/></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><!--
The navigation drawer --></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><listview span=""><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:id</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@+id/left_drawer"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></listview></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_width</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"240dp"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_height</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_gravity</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"start"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:choiceMode</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"singleChoice"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:divider</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@android:color/transparent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:dividerHeight</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"0dp"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:background</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"#111"</span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">/><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"></span></div>
</div>
</div>
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><o:p></o:p></span>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">Customization example
follows as:</span><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="PreformattedText">
<br /></div>
<div style="background: #F7F7F7; border: solid silver 1.0pt; mso-border-alt: solid silver .25pt; mso-element: para-border-div; padding: 1.0pt 1.0pt 1.0pt 1.0pt;">
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><android .support.v4.widget.drawerlayout="" span=""><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></android></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">xmlns:android</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"http://schemas.android.com/apk/res/android"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:id</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@+id/drawer_layout"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_width</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_height</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><!--
The main content view --></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><framelayout span=""><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></framelayout></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:id</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@+id/content_frame"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_width</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_height</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">/></span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #006600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><!--
The navigation drawer →</span><span lang="EN-US" style="color: teal; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><o:p></o:p></span></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm; text-indent: 35.45pt;">
<span lang="EN-US" style="color: teal; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><</span><span lang="EN-US" style="color: #3f7f7f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">LinearLayout
</span><span lang="EN-US" style="color: #7f007f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">android:id</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">=</span><i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">"@+id/drawer_view"<o:p></o:p></span></i></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"> </span></i><i><span lang="EN-US" style="color: #7f007f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">android:layout_width</span></i><i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">=</span></i><i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">"match_parent"<o:p></o:p></span></i></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<i><span lang="EN-US" style="color: #2a00ff; font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 21px;"> </span></i><i><span lang="EN-US" style="color: #7f007f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">android:layout_height</span></i><i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">=</span></i><i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">"match_parent"<o:p></o:p></span></i></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<i><span lang="EN-US" style="color: #2a00ff; font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 21px;"> </span></i><i><span lang="EN-US" style="color: #7f007f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">android:layout_gravity</span></i><i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">=</span></i><i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">"start"<o:p></o:p></span></i></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<i><span lang="EN-US" style="color: #2a00ff; font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 21px;"> </span></i><i><span lang="EN-US" style="color: #7f007f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">android:background</span></i><i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">=</span></i><i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">"@android:color/white"<o:p></o:p></span></i></div>
<div class="MsoNormal" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<i><span lang="EN-US" style="color: #2a00ff; font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 21px;"> </span></i><i><span lang="EN-US" style="color: #7f007f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">android:orientation</span></i><i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">=</span></i><i><span lang="EN-US" style="color: #2a00ff; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">"vertical"
</span></i><i><span lang="EN-US" style="color: teal; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">></span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><listview span=""><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"> </span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:id</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@+id/left_drawer"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></listview></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_width</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"240dp"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_height</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"match_parent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:layout_gravity</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"start"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:choiceMode</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"singleChoice"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:divider</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"@android:color/transparent"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:dividerHeight</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"0dp"</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt; line-height: 150%;">
</span><span lang="EN-US" style="color: #882288; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">android:background</span><span lang="EN-US" style="color: #666600; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">=</span><span lang="EN-US" style="color: #880000; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">"#111"</span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;">/></span><span lang="EN-US" style="color: teal; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm; text-indent: 35.45pt;">
<span lang="EN-US" style="color: teal; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"></</span><span lang="EN-US" style="color: #3f7f7f; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">LinearLayout</span><span lang="EN-US" style="color: teal; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">></span><span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"><o:p></o:p></span></div>
<div class="PreformattedText" style="background-position: initial initial; background-repeat: initial initial; border: none; line-height: 150%; padding: 0cm;">
<span lang="EN-US" style="color: #000088; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%;"></span></div>
</div>
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; line-height: 150%; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><o:p></o:p></span>
<br />
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">When we try to use the custom
navigation drawer, there is scope where your navigation drawer linear layout change
the view not being front, even the view is shown as front, we can call as Z
ordering.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<b><span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">What is Z order?<o:p></o:p></span></b></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">The views are added in the group,
should be order in the tree. <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">This scenario we can face in android
2.3 versions (gingerbread) when we scroll navigation drawer, then we won’t have
action on list view of the navigation drawer. <o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">Finally we came to the issue what we are discussing about while start of the post, let’s look how to solve the
issue below.<o:p></o:p></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<img alt="*-:)" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/idealightbulb.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%; text-align: left;" />Issue is regarding the Z order of the view.</div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<b>Then How to solve this Z order <img alt=":?:" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/icon_question.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%; text-align: left;" /></b></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><span style="color: black; font-family: 'Bookman Old Style', serif;">We should know about the </span></span><span style="font-family: 'Bookman Old Style', serif; font-size: 14px;"><a href="http://developer.android.com/reference/android/view/View.html#bringToFront()" style="font-weight: bold;">bringToFront()</a> method of View Class. Which solves our problem.</span></div>
<div class="MsoNormal" style="text-align: justify;">
<span style="font-family: 'Bookman Old Style', serif; font-size: 14px;"><br /></span></div>
<div class="MsoNormal" style="text-align: justify;">
<span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;"><span style="color: black; font-family: 'Bookman Old Style', serif;">Know, we will use the above method in the scroll listener of list view, by calling the </span><b style="color: black; font-family: 'Bookman Old Style', serif;"><a href="http://developer.android.com/reference/android/view/View.html#bringToFront()">bringToFront()</a></b><span style="color: black; font-family: 'Bookman Old Style', serif;"> of the list and then </span><b style="color: black; font-family: 'Bookman Old Style', serif;"><a href="http://developer.android.com/reference/android/view/View.html#requestLayout()">requestLayout()</a></b><span style="color: black; font-family: 'Bookman Old Style', serif;"> of the drawer when the scroll states is idle as shows</span></span></div>
<div class="MsoNormal" style="text-align: justify;">
<br /></div>
<div class="MsoNormal">
<span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">mDrawerList</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">.setOnScrollListener(</span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">new</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">
OnScrollListener() {<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><span lang="EN-US" style="color: #646464; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">@Override</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">public</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">void</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">
onScrollStateChanged(AbsListView view, </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">int</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">
scrollState) {<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">if</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">
(scrollState == </span><i><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">SCROLL_STATE_IDLE</span></i><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">) {<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">mDrawerList</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">.bringToFront();<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><span lang="EN-US" style="color: #0000c0; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">mDrawerLayout</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">.requestLayout();<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> } <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> <o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><span lang="EN-US" style="color: #646464; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">@Override</span><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">public</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">void</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">
onScroll(AbsListView view, </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">int</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> firstVisibleItem, </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">int</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">
visibleItemCount, </span><b><span lang="EN-US" style="color: #7f0055; font-family: "Bookman Old Style","serif"; font-size: 10.5pt; mso-bidi-font-family: Consolas; mso-fareast-font-family: Consolas;">int</span></b><span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> totalItemCount) {<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> }<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">});<o:p></o:p></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"><br /></span></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">Issue is fixed...</span><img alt=":-bd" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/thumbsup.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /></div>
<div class="MsoNormal">
<span lang="EN-US" style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;">Hope you have enjoyed by reading post...</span><img alt=":smile:" class="wp-smiley" src="http://spiritcompanion.com/wp-includes/images/smilies/icon_smile.gif" style="background-color: white; border: none; color: #333333; float: none; font-family: 'Palatino Linotype', Georgia, 'Times New Roman', serif; font-size: 16px; height: auto; line-height: 25.600000381469727px; max-width: 100%;" /><span style="font-family: 'Bookman Old Style', serif; font-size: 10.5pt;"> </span></div>
<br />
<br />
<b>Improvements</b><br />
<br />
If you want to see an example of customizing navigation drawer then, see <a href="http://vardhan-justlikethat.blogspot.in/2014/05/android-custom-navigation-drawer-using.html.">Custom Navigation Drawer</a> This example supports from API levels.<br />
<div style="margin: 0in;">
<br /></div>
<div style="margin: 0in;">
<span style="color: grey; font-family: "Bookman Old Style","serif"; font-size: 11.5pt;">Whether this post is helpful?<o:p></o:p></span></div>
<br />
<div class="MsoNormal">
<span lang="EN-US" style="font-family: "Bookman Old Style","serif"; font-size: 10.5pt;"><span style="color: grey; font-family: 'Bookman Old Style', serif; font-size: 11.5pt; line-height: 17.633333206176758px;">Have something to add to this post? If you have any other quick thoughts/hints that you think people will find useful? Share it in the comments.</span> </span></div>
Vardhan DShttp://www.blogger.com/profile/06902854396009389430noreply@blogger.com8