<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7197565677037157261</id><updated>2014-04-30T12:25:54.790-07:00</updated><category term="Android"/><category term="example"/><category term="tutorial"/><category term="wifi"/><category term="Memory Management"/><category term="String"/><category term="Basics"/><category term="Transparent"/><category term="AsyncTask"/><category term="Dialog"/><category term="Drawable"/><category term="ImageView"/><category term="Thread"/><category term="WebView"/><category term="domain"/><category term="icon"/><category term="search engine"/><category term="ssid"/><category term="width"/><category term="Action Bar"/><category term="AndroidManifest.xml"/><category term="BSSID"/><category term="BatteryManager"/><category term="Bitmap"/><category term="Browser"/><category term="CPU"/><category term="EXIF"/><category term="EditText"/><category term="Full Screen"/><category term="IMEI"/><category term="Image"/><category term="Intent"/><category term="Log"/><category term="MAC"/><category term="OS"/><category term="Power"/><category term="PowerManager"/><category term="Question mark"/><category term="RSSI"/><category term="Refresh"/><category term="Res"/><category term="SDCard"/><category term="SMS"/><category term="Screen lock"/><category term="SharedPreferences"/><category term="Style"/><category term="Ticker"/><category term="UID"/><category term="UIThread"/><category term="URL"/><category term="Version"/><category term="acquire"/><category term="activity"/><category term="adb"/><category term="api"/><category term="app"/><category term="command"/><category term="compare"/><category term="connection"/><category term="cursor"/><category term="dalvikvm"/><category term="default"/><category term="design"/><category term="dip"/><category term="dp"/><category term="email"/><category term="facebook"/><category term="font size"/><category term="free"/><category term="freelance"/><category term="gmail"/><category term="heap"/><category term="height"/><category term="hprof"/><category term="ip address"/><category term="iphone"/><category term="javamail"/><category term="linux"/><category term="listview"/><category term="manufacturer"/><category term="minSdkVersion"/><category term="model"/><category term="network id"/><category term="notification"/><category term="outsource"/><category term="pixel"/><category term="promote"/><category term="px"/><category term="runONUiThread"/><category term="send"/><category term="serial"/><category term="setBackgroundDrawable"/><category term="smtp"/><category term="status"/><category term="target"/><category term="text message"/><category term="uninstall"/><category term="unique id"/><category term="website"/><title type='text'>zeal4everything</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>56</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-4341776480005271233</id><published>2014-04-30T11:28:00.000-07:00</published><updated>2014-04-30T12:25:54.796-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="email"/><category scheme="http://www.blogger.com/atom/ns#" term="example"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail"/><category scheme="http://www.blogger.com/atom/ns#" term="javamail"/><category scheme="http://www.blogger.com/atom/ns#" term="send"/><category scheme="http://www.blogger.com/atom/ns#" term="smtp"/><title type='text'>[Android] How to send email(Gmail) programmatically without launching a third party app (new intent)</title><content type='html'>First you need following &quot;javamail-android&quot; libraries: (&lt;a href=&quot;https://code.google.com/p/javamail-android/downloads/list&quot;&gt;download&lt;/a&gt;)&lt;br /&gt;&lt;ul&gt;&lt;li&gt;additionnal.jar&amp;nbsp;&lt;/li&gt;&lt;li&gt;mail.jar&lt;/li&gt;&lt;li&gt;activation.jar&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Copy them to \libs folder and add copied jars to your project library.&lt;br /&gt;&lt;br /&gt;You need following permissions:&lt;br /&gt;&lt;pre style=&quot;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%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;   &amp;lt;uses-permission android:name=&quot;android.permission.GET_ACCOUNTS&quot; /&amp;gt;  &lt;br /&gt;   &amp;lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&amp;gt;  &lt;br /&gt;   &amp;lt;uses-permission android:name=&quot;android.permission.USE_CREDENTIALS&quot; /&amp;gt;  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;OAuth2Authenticator.java:&lt;br /&gt;&lt;pre style=&quot;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%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt;   &lt;br /&gt; import android.accounts.Account;  &lt;br /&gt; import android.accounts.AccountManager;  &lt;br /&gt; import android.accounts.AccountManagerCallback;  &lt;br /&gt; import android.accounts.AccountManagerFuture;  &lt;br /&gt; import android.app.Activity;  &lt;br /&gt; import android.os.AsyncTask;  &lt;br /&gt; import android.os.Bundle;  &lt;br /&gt; import android.util.Log;  &lt;br /&gt;   &lt;br /&gt; import com.sun.mail.smtp.SMTPTransport;  &lt;br /&gt; import com.sun.mail.util.BASE64EncoderStream;  &lt;br /&gt;   &lt;br /&gt; import java.util.Properties;  &lt;br /&gt;   &lt;br /&gt; import javax.activation.DataHandler;  &lt;br /&gt; import javax.mail.Message;  &lt;br /&gt; import javax.mail.Session;  &lt;br /&gt; import javax.mail.URLName;  &lt;br /&gt; import javax.mail.internet.InternetAddress;  &lt;br /&gt; import javax.mail.internet.MimeMessage;  &lt;br /&gt; import javax.mail.util.ByteArrayDataSource;  &lt;br /&gt;   &lt;br /&gt;   &lt;br /&gt; public class OAuth2Authenticator {  &lt;br /&gt;   &lt;br /&gt;   private static Session mSession;  &lt;br /&gt;   &lt;br /&gt;   private AccountManager mAccountManager;  &lt;br /&gt;   private String mToken;  &lt;br /&gt;   private Account mAccount = null;  &lt;br /&gt;   private Activity mActivity;  &lt;br /&gt;   private static String TEST_ACCOUNT_EMAIL = &quot;(your_account_that_is_added_to_Android_device)@gmail.com&quot;;  &lt;br /&gt;   &lt;br /&gt;   public OAuth2Authenticator(Activity activity) {  &lt;br /&gt;     mActivity = activity;  &lt;br /&gt;     mAccountManager = AccountManager.get(mActivity);  &lt;br /&gt;   &lt;br /&gt;     Account[] accounts = mAccountManager.getAccounts();  &lt;br /&gt;   &lt;br /&gt;     // For this tutorial, we manually set the email account(TEST_ACCOUNT_EMAIL). However, you should create some kind of UI for users to select the Gmail account  &lt;br /&gt;     for (Account a : accounts) {  &lt;br /&gt;       if (a.name.equals(TEST_ACCOUNT_EMAIL) &amp;amp;&amp;amp; a.type.equals(&quot;com.google&quot;)) {  &lt;br /&gt;         mAccount = a;  &lt;br /&gt;       }  &lt;br /&gt;     }  &lt;br /&gt;     if (mAccount != null) {  &lt;br /&gt;       AccountManagerFuture&amp;lt;Bundle&amp;gt; future = mAccountManager.getAuthToken(mAccount, &quot;oauth2:https://mail.google.com/&quot;, null, mActivity, new OnTokenAcquired(), null);  &lt;br /&gt;     }  &lt;br /&gt;   &lt;br /&gt;   }  &lt;br /&gt;   &lt;br /&gt;   private class OnTokenAcquired implements AccountManagerCallback&amp;lt;Bundle&amp;gt; {  &lt;br /&gt;     @Override  &lt;br /&gt;     public void run(AccountManagerFuture&amp;lt;Bundle&amp;gt; result) {  &lt;br /&gt;       try {  &lt;br /&gt;         Bundle bundle = result.getResult();  &lt;br /&gt;         mToken = bundle.getString(AccountManager.KEY_AUTHTOKEN);  &lt;br /&gt;         new SendMailTask().execute();  &lt;br /&gt;       } catch (Exception e) {  &lt;br /&gt;         Log.e(&quot;OnTokenAcquired&quot;, e.getMessage());  &lt;br /&gt;       }  &lt;br /&gt;     }  &lt;br /&gt;   }  &lt;br /&gt;   &lt;br /&gt;   private class SendMailTask extends AsyncTask&amp;lt;Void, Void, Void&amp;gt; {  &lt;br /&gt;   &lt;br /&gt;     @Override  &lt;br /&gt;     protected Void doInBackground(Void... params) {  &lt;br /&gt;       try {  &lt;br /&gt;         sendMail(&quot;subject&quot;, &quot;body message&quot;, TEST_ACCOUNT_EMAIL, mToken, &quot;(recipient_address)@(somemail).com&quot;);  &lt;br /&gt;       } catch (Exception e) {  &lt;br /&gt;         Log.e(&quot;SendMailTask&quot;, &quot;error:&quot; + e.getMessage());  &lt;br /&gt;       }  &lt;br /&gt;       return null;  &lt;br /&gt;     }  &lt;br /&gt;   }  &lt;br /&gt;   &lt;br /&gt;   private SMTPTransport connectToSmtp(String host, int port, String userEmail,  &lt;br /&gt;                     String oauthToken, boolean debug) throws Exception {  &lt;br /&gt;   &lt;br /&gt;     Properties props = new Properties();  &lt;br /&gt;     props.put(&quot;mail.smtp.starttls.enable&quot;, &quot;true&quot;);  &lt;br /&gt;     props.put(&quot;mail.smtp.starttls.required&quot;, &quot;true&quot;);  &lt;br /&gt;     props.put(&quot;mail.smtp.sasl.enable&quot;, &quot;false&quot;);  &lt;br /&gt;     mSession = Session.getInstance(props);  &lt;br /&gt;     mSession.setDebug(debug);  &lt;br /&gt;     final URLName unusedUrlName = null;  &lt;br /&gt;     SMTPTransport transport = new SMTPTransport(mSession, unusedUrlName);  &lt;br /&gt;     // If the password is non-null, SMTP tries to do AUTH LOGIN.  &lt;br /&gt;     final String emptyPassword = null;  &lt;br /&gt;     transport.connect(host, port, userEmail, emptyPassword);  &lt;br /&gt;     byte[] response = String.format(&quot;user=%s\1auth=Bearer %s\1\1&quot;, userEmail, oauthToken).getBytes();  &lt;br /&gt;     response = BASE64EncoderStream.encode(response);  &lt;br /&gt;     transport.issueCommand(&quot;AUTH XOAUTH2 &quot; + new String(response), 235);  &lt;br /&gt;     return transport;  &lt;br /&gt;   }  &lt;br /&gt;   &lt;br /&gt;   public synchronized void sendMail(String subject, String body, String user,  &lt;br /&gt;                    String oauthToken, String recipients) {  &lt;br /&gt;     try {  &lt;br /&gt;   &lt;br /&gt;       SMTPTransport smtpTransport = connectToSmtp(&quot;smtp.gmail.com&quot;,  &lt;br /&gt;           587,  &lt;br /&gt;           user,  &lt;br /&gt;           oauthToken,  &lt;br /&gt;           true);  &lt;br /&gt;       MimeMessage message = new MimeMessage(mSession);  &lt;br /&gt;       DataHandler handler = new DataHandler(new ByteArrayDataSource(body.getBytes(), &quot;text/plain&quot;));  &lt;br /&gt;       message.setSender(new InternetAddress(user));  &lt;br /&gt;       message.setSubject(subject);  &lt;br /&gt;       message.setDataHandler(handler);  &lt;br /&gt;       if (recipients.indexOf(&#39;,&#39;) &amp;gt; 0)  &lt;br /&gt;         message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));  &lt;br /&gt;       else  &lt;br /&gt;         message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));  &lt;br /&gt;       smtpTransport.sendMessage(message, message.getAllRecipients());  &lt;br /&gt;     } catch (Exception e) {  &lt;br /&gt;       Log.e(&quot;sendMail&quot;, e.getMessage());  &lt;br /&gt;     }  &lt;br /&gt;   }  &lt;br /&gt; }  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;MainActivity.java:&lt;br /&gt;&lt;pre style=&quot;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%;&quot;&gt;&lt;code style=&quot;color: black; word-wrap: normal;&quot;&gt; new OAuth2Authenticator(this);  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/4341776480005271233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/android-how-to-send-emailgmail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/4341776480005271233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/4341776480005271233'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/android-how-to-send-emailgmail.html' title='[Android] How to send email(Gmail) programmatically without launching a third party app (new intent)'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-1019383894656856487</id><published>2014-04-18T13:26:00.003-07:00</published><updated>2014-04-18T13:40:44.605-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="example"/><category scheme="http://www.blogger.com/atom/ns#" term="SMS"/><category scheme="http://www.blogger.com/atom/ns#" term="text message"/><title type='text'>Android: how to send SMS(text message) programmatically</title><content type='html'>&lt;br /&gt;You need SEND_SMS permission:&lt;br /&gt; &lt;pre class=&quot;brush: xml&quot;&gt;&lt;uses-permission android:name=&quot;android.permission.SEND_SMS&quot;&gt;&lt;/uses-permission&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Code:&lt;/div&gt;&lt;pre class=&quot;brush: java&quot;&gt;        try {&lt;br /&gt;            SmsManager smsManager = SmsManager.getDefault();&lt;br /&gt;            String sPhoneNumber = &quot;1-222-3333&quot;;&lt;br /&gt;            String sMessage = &quot;Hello World&quot;;&lt;br /&gt;            smsManager.sendTextMessage(sPhoneNumber, null, sMessage, null, null);&lt;br /&gt;            Toast.makeText(this, &quot;Message has been sent&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;        } catch (Exception e) {&lt;br /&gt;            Toast.makeText(this, &quot;Message send failed&quot;, Toast.LENGTH_LONG).show();&lt;br /&gt;        }&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Warning:&lt;/b&gt;&lt;/span&gt; Make sure your app doesn&#39;t send SMS without user&#39;s knowledge. It will violate the &lt;a href=&quot;https://play.google.com/about/developer-content-policy.html&quot;&gt;Google&#39;s policy&lt;/a&gt; and your app will be suspended.&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;background-color: white; color: #444444; font-family: arial, sans-serif; font-size: 13px; line-height: 20.020000457763672px; margin: 10px 10px 10px 30px; padding: 0px;&quot;&gt;&lt;li&gt;Do not send SMS, email, or other messages on behalf of the user without providing the user with the ability to confirm content and intended recipient.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span style=&quot;color: #444444; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 20.020000457763672px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: #444444; font-family: arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 20.020000457763672px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/1019383894656856487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/android-how-to-send-smstext-message.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/1019383894656856487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/1019383894656856487'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/android-how-to-send-smstext-message.html' title='Android: how to send SMS(text message) programmatically'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-8697350161310648411</id><published>2014-04-18T03:00:00.000-07:00</published><updated>2014-04-18T03:09:06.729-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="minSdkVersion"/><category scheme="http://www.blogger.com/atom/ns#" term="target"/><title type='text'>Developer&#39;s Guide: What API level should you target for your app? (minSdkVersion)</title><content type='html'>This is my personal opinion. (Not a correct answer)&lt;br /&gt;(Note: I am writing this on April 18, 2014. Things might be different later)&lt;br /&gt;&lt;br /&gt;Please check the latest &lt;a href=&quot;http://developer.android.com/about/dashboards/index.html?utm_source=ausdroid.net&quot;&gt;version distribution dashboard&lt;/a&gt;&amp;nbsp;first.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Free app or paid app?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;If you are making a paid app, it is OK to target relatively latest versions only. I say version 14 (Android 4.0+) [or version 15 (Android 4.0.3+) since not many devices use version 14 anyways]. There is a big jump from 2.x to 4.x no need an extra work to support 2.x devices when your main income is from the paid app (or in-app-purchase).&lt;br /&gt;&lt;br /&gt;Why? I found most paid apps are purchased from the latest devices anyways. People who use older devices are pretty much satisfied with apps they already have and they don&#39;t tend to look for paid apps (compared to people who uses the latest devices). I don&#39;t make games so I am not sure if above logic applies for games too.&lt;br /&gt;&lt;br /&gt;If your income is a free app with ad then you want to cover as much as possible. Still, I believe 2.x devices are not worth it at this time.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Think about testing&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;You might think the more device support the better. Not always! If your app doesn&#39;t work properly on some devices (or some older versions), they will give you bad ratings/reviews and your overall ratings will decrease. One of my apps got more popular when I actually removed the support for older devices for this reason.&lt;br /&gt;&lt;br /&gt;Again, this is my personal opinion from my experience.</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/8697350161310648411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/developers-guide-you-are-not-sure-what.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/8697350161310648411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/8697350161310648411'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/developers-guide-you-are-not-sure-what.html' title='Developer&#39;s Guide: What API level should you target for your app? (minSdkVersion)'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-4409397379830879462</id><published>2014-04-16T16:19:00.002-07:00</published><updated>2014-04-16T16:23:43.434-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="example"/><category scheme="http://www.blogger.com/atom/ns#" term="notification"/><category scheme="http://www.blogger.com/atom/ns#" term="Ticker"/><title type='text'>Android: Show notification example</title><content type='html'>&lt;br /&gt;Show notification:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class=&quot;brush: java&quot;&gt;        Intent intent = new Intent(context, ExampleReceiver.class);&lt;br /&gt;        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);&lt;br /&gt;        NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);&lt;br /&gt;        Notification n;&lt;br /&gt;        Bitmap bm = BitmapFactory.decodeResource(context.getResources(), R.drawable.ic_launcher);&lt;br /&gt;        if (Build.VERSION.SDK_INT &amp;gt;= Build.VERSION_CODES.JELLY_BEAN) {&lt;br /&gt;            n = new Notification.Builder(context)&lt;br /&gt;                    .setContentTitle(&quot;title&quot;)&lt;br /&gt;                    .setContentText(&quot;Short message\nContent message&quot;)&lt;br /&gt;                    .setTicker(&quot;ticker message&quot;)&lt;br /&gt;                    .setSmallIcon(R.drawable.notification_icon)&lt;br /&gt;                    .setLargeIcon(bm)&lt;br /&gt;                    .setStyle(new Notification.BigTextStyle().bigText(&quot;Long message.\nTesting..Testing..\nlooooooooooooooooon message&quot;))&lt;br /&gt;                    .setContentIntent(paramIntent)&lt;br /&gt;                    .setAutoCancel(true).build();&lt;br /&gt;        } else {&lt;br /&gt;            n = new Notification.Builder(context)&lt;br /&gt;                    .setContentTitle(&quot;title&quot;)&lt;br /&gt;                    .setContentText(&quot;Short message\nContent message&quot;)&lt;br /&gt;                    .setTicker(&quot;ticker message&quot;)&lt;br /&gt;                    .setSmallIcon(R.drawable.notification_icon)&lt;br /&gt;                    .setLargeIcon(bm)&lt;br /&gt;                    .setContentIntent(paramIntent)&lt;br /&gt;                    .setAutoCancel(true).getNotification();&lt;br /&gt;        }&lt;br /&gt;        n.flags = n.flags | Notification.FLAG_NO_CLEAR;&lt;br /&gt;        notificationManager.notify(0, n);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Show only the ticker and make it go disappear:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: java&quot;&gt;        Intent intent = new Intent(context, ExampleReceiver.class);&lt;br /&gt;        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);&lt;br /&gt;        NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);&lt;br /&gt;        Notification n;&lt;br /&gt;        if (Build.VERSION.SDK_INT &amp;gt;= Build.VERSION_CODES.JELLY_BEAN) {&lt;br /&gt;            n = new Notification.Builder(context)&lt;br /&gt;                    .setTicker(&quot;ticker message&quot;)&lt;br /&gt;                    .setSmallIcon(R.drawable.notification_icon)&lt;br /&gt;                    .setAutoCancel(true)&lt;br /&gt;                    .build();&lt;br /&gt;        } else {&lt;br /&gt;            n = new Notification.Builder(context)&lt;br /&gt;                    .setTicker(&quot;ticker message&quot;)&lt;br /&gt;                    .setSmallIcon(R.drawable.notification_icon)&lt;br /&gt;                    .setAutoCancel(true)&lt;br /&gt;                    .getNotification();&lt;br /&gt;        }&lt;br /&gt;        notificationManager.notify(0, n);&lt;br /&gt;        notificationManager.cancel(0);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/4409397379830879462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/android-show-notification-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/4409397379830879462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/4409397379830879462'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/android-show-notification-example.html' title='Android: Show notification example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-9136225831958533861</id><published>2014-04-16T15:01:00.000-07:00</published><updated>2014-04-16T15:01:50.392-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="adb"/><category scheme="http://www.blogger.com/atom/ns#" term="uninstall"/><title type='text'>How to uninstall through adb command when multiple devices are connected</title><content type='html'>Sometimes when you have a physical device and an emulator connected to your computer, adb command doesn&#39;t work.&lt;br /&gt;&lt;br /&gt;This will display serial number of connected devices:&lt;br /&gt;&lt;pre class=&quot;brush: java&quot;&gt;adb devices -l&lt;/pre&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://3.bp.blogspot.com/-L-BXjfsKPk4/U078is_94kI/AAAAAAAAAGE/QPsAkHdR23g/s1600/adb1.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://3.bp.blogspot.com/-L-BXjfsKPk4/U078is_94kI/AAAAAAAAAGE/QPsAkHdR23g/s1600/adb1.png&quot; height=&quot;152&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now knowing the serial number of &amp;nbsp;my physical device (in this case: 8d5351c6062aa124), type adb uninstall command:&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;brush: java&quot;&gt;adb -s (serial number) uninstall (com.package.name)&lt;/pre&gt;&lt;br /&gt;in my case:&lt;br /&gt;&lt;pre class=&quot;brush: java&quot;&gt;adb -s 8d5351c6062aa124 uninstall (com.package.name)&lt;/pre&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/9136225831958533861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/how-to-uninstall-through-adb-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/9136225831958533861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/9136225831958533861'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/how-to-uninstall-through-adb-command.html' title='How to uninstall through adb command when multiple devices are connected'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-L-BXjfsKPk4/U078is_94kI/AAAAAAAAAGE/QPsAkHdR23g/s72-c/adb1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-7880809086824313080</id><published>2014-04-14T08:36:00.002-07:00</published><updated>2014-04-14T09:01:20.236-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="app"/><category scheme="http://www.blogger.com/atom/ns#" term="design"/><category scheme="http://www.blogger.com/atom/ns#" term="freelance"/><category scheme="http://www.blogger.com/atom/ns#" term="icon"/><category scheme="http://www.blogger.com/atom/ns#" term="iphone"/><category scheme="http://www.blogger.com/atom/ns#" term="outsource"/><title type='text'>How to outsource/freelance Android app icon design for a cheap price?</title><content type='html'>You make apps and you have a terrible icon so no one downloads your app. Here&#39;s a solution:&lt;br /&gt;&lt;br /&gt;Here&#39;s what I&#39;ve learned (so far).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://www.fiverr.com/search/gigs?utf8=%E2%9C%93&amp;amp;search_in=everywhere&amp;amp;query=app+icon&amp;amp;x=0&amp;amp;y=0&amp;amp;jls_se99912_1_auto=1&quot;&gt;Fiverr&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The cheapest place to do is &lt;a href=&quot;http://www.fiverr.com/&quot;&gt;fiverr&lt;/a&gt;.&lt;br /&gt;Watch out! Not everything is $5.&lt;br /&gt;They make you add this and that feature for extra $5~$20. But if you search carefully, some designers satisfies all your needs in $5.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Warning&lt;/b&gt;: Make sure you provide EVERYTHING you want your icon to be like. Don&#39;t expect them to read your mind and receive an awesome icon. Sometimes you have no idea what kind of icon is suitable. Even so, do some research because most likely they don&#39;t spend time to do research either. You end up, wasting your time and their time, and your money. (Been there, done that).&lt;br /&gt;&lt;br /&gt;Provide either:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A pencil sketch of expected icon (take a photo and send to the designer)&lt;/li&gt;&lt;li&gt;A link or screenshot of an existing icon (maybe some other competitor icon) and tell them you want this style.&lt;/li&gt;&lt;li&gt;A detail description. (Color of the icon, add a shadow effect or flat icon, etc etc)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;You still have a chance to go back and forth and request modification until you&#39;re satisfied but you should provide detail expectation ahead of time so that you don&#39;t waste the designer&#39;s time.&lt;br /&gt;&lt;br /&gt;In my experience, when I requested for an awesome icon and explained what my app does, they made me a crappy icon. I had to provide EXACTLY what to do, they did a good job.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://www.freelancer.com/job-search/icon-design-price/1/&quot;&gt;Freelancer&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;It seems you pay hourly, I haven&#39;t done it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;http://99designs.ca/&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;99designs&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;You provide a description and multiple designers make an icon for you. You simply pick the best one and give the money to the winner. The benefit is that you can compare and pick the best icon that you like. Not cheap so I haven&#39;t done it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;a href=&quot;http://zeal4everything.blogspot.ca/2014/04/where-to-get-free-android-icons.html&quot;&gt;Use Free Icon&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Use license-free free icons. See my &#39;&lt;a href=&quot;http://zeal4everything.blogspot.ca/2014/04/where-to-get-free-android-icons.html&quot;&gt;Where to get a free Android icons?&lt;/a&gt;&#39;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please add a comment if you know other places.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/7880809086824313080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/how-to-outsourcefreelance-android-app.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7880809086824313080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7880809086824313080'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/how-to-outsourcefreelance-android-app.html' title='How to outsource/freelance Android app icon design for a cheap price?'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-3281559363883145031</id><published>2014-04-14T08:02:00.000-07:00</published><updated>2014-04-14T08:04:15.389-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="free"/><category scheme="http://www.blogger.com/atom/ns#" term="icon"/><title type='text'>Where to get a free Android icons?</title><content type='html'>Here&#39;s the list of places you can search for the free icons.&lt;br /&gt;Make sure you set filter for &quot;Commercial free&quot; if your app is &#39;paid&#39; app or has an &#39;ad&#39; (you make some sort of profit)&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.iconarchive.com/&quot;&gt;http://www.iconarchive.com/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://www.iconfinder.com/&quot;&gt;https://www.iconfinder.com/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://findicons.com/&quot;&gt;http://findicons.com/&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://iconizer.net/en/free_icons&quot;&gt;http://iconizer.net/en/free_icons&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You can also search &#39;Google image&#39; with &quot;(search word) + icon&quot; and set &#39;Labeled for reuse&#39; filter.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://2.bp.blogspot.com/-4s9GjYYob8E/U0v4CujIxxI/AAAAAAAAAF0/Z7BVshpXQ5A/s1600/googleimage.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://2.bp.blogspot.com/-4s9GjYYob8E/U0v4CujIxxI/AAAAAAAAAF0/Z7BVshpXQ5A/s1600/googleimage.png&quot; height=&quot;225&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Please add a comment if you know other places.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/3281559363883145031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/where-to-get-free-android-icons.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/3281559363883145031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/3281559363883145031'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2014/04/where-to-get-free-android-icons.html' title='Where to get a free Android icons?'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-4s9GjYYob8E/U0v4CujIxxI/AAAAAAAAAF0/Z7BVshpXQ5A/s72-c/googleimage.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-5599918499193098723</id><published>2013-03-27T17:22:00.001-07:00</published><updated>2013-03-27T17:22:29.636-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="compare"/><category scheme="http://www.blogger.com/atom/ns#" term="Drawable"/><title type='text'>Android: How to compare Drawables</title><content type='html'>&lt;br /&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; drawable1.getConstantState().equals(drawable2.getConstantState());&lt;br /&gt;&lt;br /&gt;It doesn&#39;t compare actual data (bytes of images)&amp;nbsp;so it is fast and memory efficient.</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/5599918499193098723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-how-to-compare-drawables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/5599918499193098723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/5599918499193098723'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-how-to-compare-drawables.html' title='Android: How to compare Drawables'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-8618077655170061333</id><published>2013-03-25T13:03:00.000-07:00</published><updated>2013-03-25T13:03:23.706-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="default"/><category scheme="http://www.blogger.com/atom/ns#" term="font size"/><category scheme="http://www.blogger.com/atom/ns#" term="Res"/><title type='text'>Android: How to use Android default font size example</title><content type='html'>  Small:&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-style: italic;&quot;&gt;&quot;DefaultMedium&quot;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;item&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-style: italic;&quot;&gt;&quot;android:textAppearance&quot;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?android:attr/textAppearanceSmall&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Medium:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-style: italic;&quot;&gt;&quot;DefaultMedium&quot;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;item&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-style: italic;&quot;&gt;&quot;android:textAppearance&quot;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?android:attr/textAppearanceMedium&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Large:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-style: italic;&quot;&gt;&quot;DefaultMedium&quot;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;item&lt;/span&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-style: italic;&quot;&gt;&quot;android:textAppearance&quot;&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;?android:attr/textAppearanceLarge&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;item&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Reference: Android&amp;nbsp;source code&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Android Styles.xml&lt;/strong&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml&quot;&gt;https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Android Res files&lt;/strong&gt;&lt;br /&gt;&lt;a href=&quot;https://github.com/android/platform_frameworks_base/tree/master/core/res/res&quot;&gt;https://github.com/android/platform_frameworks_base/tree/master/core/res/res&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/8618077655170061333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-how-to-use-android-default-font.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/8618077655170061333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/8618077655170061333'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-how-to-use-android-default-font.html' title='Android: How to use Android default font size example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-6955496775909897508</id><published>2013-03-22T12:37:00.000-07:00</published><updated>2013-03-22T12:37:01.909-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Action Bar"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Full Screen"/><title type='text'>Android: Full Screen &amp; No title/action bar example</title><content type='html'>  &lt;strong&gt;No Action bar:&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.requestWindowFeature(Window.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;FEATURE_NO_TITLE&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: red;&quot;&gt;Caution: this code has to be written BEFORE setContentView(...); or it will crash!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Full Screen:&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.getWindow().setFlags(WindowManager.LayoutParams.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;FLAG_FULLSCREEN&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, WindowManager.LayoutParams.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;FLAG_FULLSCREEN&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: #646464; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;@Override&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;protected&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; onCreate(Bundle savedInstanceState) {&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;super&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.onCreate(savedInstanceState);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.requestWindowFeature(Window.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;FEATURE_NO_TITLE&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;.getWindow().setFlags(WindowManager.LayoutParams.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;FLAG_FULLSCREEN&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, WindowManager.LayoutParams.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;FLAG_FULLSCREEN&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;setContentView(R.layout.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;layout_main&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/6955496775909897508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-full-screen-no-titleaction-bar.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/6955496775909897508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/6955496775909897508'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-full-screen-no-titleaction-bar.html' title='Android: Full Screen &amp; No title/action bar example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-7629649704733589810</id><published>2013-03-22T10:40:00.001-07:00</published><updated>2013-03-22T10:41:34.512-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="Question mark"/><category scheme="http://www.blogger.com/atom/ns#" term="String"/><title type='text'>Android: Question mark only in strings.xml resource example</title><content type='html'>Use backslash:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: #7f007f;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;=&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #2a00ff;&quot;&gt;&quot;quick_question&quot;&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;\?&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #3f7f7f;&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/7629649704733589810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-question-mark-only-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7629649704733589810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7629649704733589810'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-question-mark-only-in.html' title='Android: Question mark only in strings.xml resource example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-811128705508684193</id><published>2013-03-21T13:08:00.001-07:00</published><updated>2013-03-22T10:42:20.093-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="height"/><category scheme="http://www.blogger.com/atom/ns#" term="width"/><title type='text'>Android: Get screen width programmatically example</title><content type='html'>It returns number in &lt;u&gt;pixel&lt;/u&gt;&lt;br /&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #646464; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;@SuppressLint&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2a00ff; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&quot;NewApi&quot;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;/span&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #646464;&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;private&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;getScreenWidth() {&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; iMeasuredwidth = 0;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Point size = &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;new&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; Point();&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WindowManager w = getWindowManager();&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;if&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;(Build.VERSION.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;SDK_INT&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; &amp;gt;= Build.VERSION_CODES.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;HONEYCOMB_MR2&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;){&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;w.getDefaultDisplay().getSize(size);&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;iMeasuredwidth = size.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;else&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Display d = w.getDefaultDisplay(); &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;iMeasuredwidth = d.&lt;u&gt;&lt;s&gt;getWidth&lt;/s&gt;()&lt;/u&gt;; &lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 2;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;return&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt; iMeasuredwidth;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: black; font-family: Times New Roman; font-size: small;&quot;&gt; &lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;u&gt; &lt;/u&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/811128705508684193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-get-screen-width.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/811128705508684193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/811128705508684193'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-get-screen-width.html' title='Android: Get screen width programmatically example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-2552353622333530020</id><published>2013-03-21T12:59:00.001-07:00</published><updated>2013-03-22T10:42:30.201-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="dip"/><category scheme="http://www.blogger.com/atom/ns#" term="dp"/><category scheme="http://www.blogger.com/atom/ns#" term="pixel"/><category scheme="http://www.blogger.com/atom/ns#" term="px"/><title type='text'>Android: How to convert from dp to px? (example)</title><content type='html'>&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;From dp to pixel:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt;fromDp2Px(&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold; text-decoration: underline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt; dp, Context context)&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; Resources res = context.getResources();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; px = TypedValue.&lt;/span&gt;&lt;span style=&quot;color: black; font-style: italic;&quot;&gt;applyDimension&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(TypedValue.&lt;/span&gt;&lt;span style=&quot;color: #0000c0; font-style: italic;&quot;&gt;COMPLEX_UNIT_DIP&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, dp, res.getDisplayMetrics());&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;) px;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;strong&gt;or&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt;fromDp2Px(&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold; text-decoration: underline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt; dp, Context context)&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; Resources res = context.getResources();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;DisplayMetrics metrics = res.getDisplayMetrics();&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; px = dp * (metrics.&lt;/span&gt;&lt;span style=&quot;color: #0000c0;&quot;&gt;densityDpi&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; / 160f);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;) px;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;}&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;From&amp;nbsp;pixel to dp:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;private&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;static&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt;fromPx2Dp(&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold; text-decoration: underline;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black; text-decoration: underline;&quot;&gt; px, Context context)&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;final&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; Resources res = context.getResources();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;DisplayMetrics metrics = res.getDisplayMetrics();&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; dp = px / (metrics.&lt;/span&gt;&lt;span style=&quot;color: #0000c0;&quot;&gt;densityDpi&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; / 160f);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in 0in 0in 0.375in;&quot;&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;return&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: #7f0055; font-weight: bold;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;) dp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt; margin: 0in;&quot;&gt;}&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/2552353622333530020/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-how-to-convert-from-dp-to-px.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2552353622333530020'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2552353622333530020'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2013/03/android-how-to-convert-from-dp-to-px.html' title='Android: How to convert from dp to px? (example)'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-6030970497733328264</id><published>2012-06-12T12:42:00.002-07:00</published><updated>2012-06-12T12:43:42.209-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="activity"/><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="SharedPreferences"/><title type='text'>Android: SharedPreferences shared by different activities</title><content type='html'>&lt;strong&gt;Following code cannot be shared by different Activities:&lt;/strong&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;context.&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;getSharedPreferences&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2a00ff;&quot;&gt;&quot;PreferenceManager&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, context.&lt;/span&gt;&lt;i&gt;&lt;u&gt;&lt;span style=&quot;color: #0000c0;&quot;&gt;MODE_PRIVATE&lt;/span&gt;&lt;/u&gt;&lt;/i&gt;&lt;span style=&quot;color: black;&quot;&gt;).getString(key, defaultValue);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;If you save on one Activity and wants to load on the other activity, the other Activity cannot find it.&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;PreferenceManager.getDefaultSharedPreferences(context).getString(key, defaultValue);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/6030970497733328264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-sharedpreferences-shared-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/6030970497733328264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/6030970497733328264'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-sharedpreferences-shared-by.html' title='Android: SharedPreferences shared by different activities'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-2366125991158580650</id><published>2012-06-11T21:53:00.003-07:00</published><updated>2012-06-11T21:53:27.221-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="domain"/><category scheme="http://www.blogger.com/atom/ns#" term="search engine"/><title type='text'>Domain: How to register your domain to search engine?</title><content type='html'>&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;strong&gt;Google&lt;/strong&gt; - &lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;a href=&quot;http://www.google.com/webmasters/tools/&quot;&gt;www.google.com/webmasters/tools/&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;strong&gt;Bing&lt;/strong&gt; - &lt;a href=&quot;http://www.bing.com/toolbox/webmaster&quot;&gt;www.bing.com/toolbox/webmaster&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/2366125991158580650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/domain-how-to-register-your-domain-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2366125991158580650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2366125991158580650'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/domain-how-to-register-your-domain-to.html' title='Domain: How to register your domain to search engine?'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-7430247975986931867</id><published>2012-06-11T21:48:00.003-07:00</published><updated>2012-06-11T21:48:55.994-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="domain"/><category scheme="http://www.blogger.com/atom/ns#" term="promote"/><category scheme="http://www.blogger.com/atom/ns#" term="search engine"/><category scheme="http://www.blogger.com/atom/ns#" term="website"/><title type='text'>Domain: How to promote your website to search engines? (for free)</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;iNeedHits&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; float: none; orphans: 2; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;-&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.ineedhits.com/free-tools/submit-free.aspx&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-position: 100% 50%; background-repeat: no-repeat; orphans: 2; widows: 2; word-spacing: 0px;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #0000ee; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;iNeedHits&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;  &lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;Submit Express&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; float: none; orphans: 2; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;-&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.submitexpress.com/submit.html&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-position: 100% 50%; background-repeat: no-repeat; orphans: 2; widows: 2; word-spacing: 0px;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #0000ee; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%; text-decoration: none; text-underline: none;&quot;&gt;Submit Express&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;  &lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;DreamSubmit&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; float: none; orphans: 2; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%;&quot;&gt;-&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href=&quot;http://www.dreamsubmit.net/free-website-submission/index.html&quot; style=&quot;-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-position: 100% 50%; background-repeat: no-repeat; orphans: 2; widows: 2; word-spacing: 0px;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: #0000ee; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8pt; line-height: 115%; text-decoration: none; text-underline: none;&quot;&gt;DreamSubmit&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/7430247975986931867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/domain-how-to-promote-your-website-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7430247975986931867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7430247975986931867'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/domain-how-to-promote-your-website-to.html' title='Domain: How to promote your website to search engines? (for free)'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-7903936709704766171</id><published>2012-06-11T21:33:00.000-07:00</published><updated>2012-06-11T21:33:23.217-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="serial"/><category scheme="http://www.blogger.com/atom/ns#" term="UID"/><category scheme="http://www.blogger.com/atom/ns#" term="unique id"/><title type='text'>Android: How to get device unique ID example</title><content type='html'>Available starting from 2.3+ (level 9)&lt;br /&gt;&lt;br /&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; example() {&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;String &lt;u&gt;sUID&lt;/u&gt; = Build.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;SERIAL&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;맑은 고딕&amp;quot;; mso-fareast-language: KO; mso-fareast-theme-font: minor-fareast;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/7903936709704766171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-how-to-get-device-unique-id.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7903936709704766171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/7903936709704766171'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-how-to-get-device-unique-id.html' title='Android: How to get device unique ID example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-6401460590201545767</id><published>2012-06-11T21:29:00.000-07:00</published><updated>2012-06-11T21:29:59.304-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="model"/><title type='text'>Android: Get device model name example</title><content type='html'>&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; example() {&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;String &lt;u&gt;sModel&lt;/u&gt; = Build.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;MODEL&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/6401460590201545767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-device-model-name-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/6401460590201545767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/6401460590201545767'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-device-model-name-example.html' title='Android: Get device model name example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-3514284770784569711</id><published>2012-06-11T21:26:00.001-07:00</published><updated>2012-06-11T21:26:12.349-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="CPU"/><title type='text'>Android: Get device CPU Processor example</title><content type='html'>&lt;br /&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; example() {&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;String &lt;u&gt;sCPU&lt;/u&gt; = Build.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;CPU_ABI&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/3514284770784569711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-device-cpu-processor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/3514284770784569711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/3514284770784569711'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-device-cpu-processor.html' title='Android: Get device CPU Processor example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-2023438198002567972</id><published>2012-06-11T21:24:00.003-07:00</published><updated>2012-06-11T21:24:46.054-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="manufacturer"/><title type='text'>Android: Get device manufacturer name example</title><content type='html'>&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; example() {&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;String &lt;u&gt;sManufacturer&lt;/u&gt; = Build.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;MANUFACTURER&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: &amp;quot;맑은 고딕&amp;quot;; mso-fareast-language: KO; mso-fareast-theme-font: minor-fareast;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/2023438198002567972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-device-manufacturer-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2023438198002567972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2023438198002567972'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-device-manufacturer-name.html' title='Android: Get device manufacturer name example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-2155377526744967987</id><published>2012-06-11T21:22:00.000-07:00</published><updated>2012-06-11T21:22:16.738-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="OS"/><category scheme="http://www.blogger.com/atom/ns#" term="Version"/><title type='text'>Android: Get Android OS version example</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;public&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: #7f0055; font-family: Consolas; font-size: 10pt;&quot;&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt; example() {&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;String &lt;u&gt;sOSVersion&lt;/u&gt; = Build.VERSION.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;RELEASE&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-spacerun: yes;&quot;&gt;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/2155377526744967987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-android-os-version-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2155377526744967987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/2155377526744967987'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-get-android-os-version-example.html' title='Android: Get Android OS version example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-1559811544133393938</id><published>2012-06-11T21:18:00.000-07:00</published><updated>2012-06-11T21:18:00.706-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="ssid"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Android: Wifi - Get hidden SSID example</title><content type='html'>&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiManager&lt;/u&gt;wifiManager = (&lt;u&gt;WifiManager&lt;/u&gt;) &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;getSystemService&lt;/u&gt;(Context.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;WIFI_SERVICE&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiInfo&lt;/u&gt;wifiInfo = wifiManager.getConnectionInfo();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;String hiddenSSID = wifiInfo.getHiddenSSID();&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/1559811544133393938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-hidden-ssid-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/1559811544133393938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/1559811544133393938'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-hidden-ssid-example.html' title='Android: Wifi - Get hidden SSID example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-1166253741070617361</id><published>2012-06-11T21:16:00.001-07:00</published><updated>2012-06-11T21:16:45.656-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Android: wifi - Get Network Link Speed exmaple</title><content type='html'>&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiManager&lt;/u&gt;wifiManager = (&lt;u&gt;WifiManager&lt;/u&gt;) &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;getSystemService&lt;/u&gt;(Context.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;WIFI_SERVICE&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiInfo&lt;/u&gt;wifiInfo = wifiManager.getConnectionInfo();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;String networkSpeed = wifiInfo.getLinkSpeed();&lt;/span&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/1166253741070617361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-network-link-speed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/1166253741070617361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/1166253741070617361'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-network-link-speed.html' title='Android: wifi - Get Network Link Speed exmaple'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-8578119325699461842</id><published>2012-06-11T21:11:00.003-07:00</published><updated>2012-06-11T21:11:47.739-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="network id"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Android: Wifi - Get network ID exmaple</title><content type='html'>&lt;br /&gt;  &lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiManager&lt;/u&gt;wifiManager = (&lt;u&gt;WifiManager&lt;/u&gt;) &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;getSystemService&lt;/u&gt;(Context.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;WIFI_SERVICE&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiInfo&lt;/u&gt;wifiInfo = wifiManager.getConnectionInfo();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;String networkId = wifiInfo.getNetworkId();&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/8578119325699461842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-network-id-exmaple.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/8578119325699461842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/8578119325699461842'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-network-id-exmaple.html' title='Android: Wifi - Get network ID exmaple'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7197565677037157261.post-620150470544993560</id><published>2012-06-11T21:09:00.001-07:00</published><updated>2012-06-11T21:09:58.870-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><category scheme="http://www.blogger.com/atom/ns#" term="RSSI"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Android: Wifi Get RSSI example</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiManager&lt;/u&gt;wifiManager = (&lt;u&gt;WifiManager&lt;/u&gt;) &lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 3;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;getSystemService&lt;/u&gt;(Context.&lt;/span&gt;&lt;i&gt;&lt;span style=&quot;color: #0000c0; font-family: Consolas; font-size: 10pt;&quot;&gt;WIFI_SERVICE&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin: 0cm 0cm 0pt; mso-layout-grid-align: none;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;u&gt;WifiInfo&lt;/u&gt;wifiInfo = wifiManager.getConnectionInfo();&lt;/span&gt;&lt;span style=&quot;font-family: Consolas; font-size: 10pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0cm 0cm 10pt;&quot;&gt;&lt;span style=&quot;color: black; font-family: Consolas; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;mso-tab-count: 1;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;String rssi = wifiInfo.getRssi();&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zeal4everything.blogspot.com/feeds/620150470544993560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-rssi-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/620150470544993560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7197565677037157261/posts/default/620150470544993560'/><link rel='alternate' type='text/html' href='http://zeal4everything.blogspot.com/2012/06/android-wifi-get-rssi-example.html' title='Android: Wifi Get RSSI example'/><author><name>zeal4everything</name><uri>http://www.blogger.com/profile/12587571944690166678</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>