Showing posts with label if. Show all posts
Showing posts with label if. Show all posts

I can get another if I break it Announcing Noto Nastaliq Urdu

| 0 comments |
Today, we are excited to release an early version of Noto Nastaliq Urdu.

Nastaliq’s rich typographic tradition presents particular challenges to computerized typography. We’ve been working over a year to solve technical and design issues for an Urdu Nastaliq (aka Nastaleeq) font. This early version is by no means complete and perfect. We expect to work closely with the community to incorporate comments and suggestions.

This preview font can be downloaded from the Noto homepage or the Noto repository, and is also available as a webfont on Google Fonts Early Access.

This is a sample web page to showcase Noto Nastaliq Urdu as a webfont. Go ahead open it. If your browser renders it correctly, you will see something like this:


Text in the image is from a poem by Urdu poet Mirza Ghalib. It means “I can get another if I break it / so a clay cup trumps a grail.” This font can be challenging to the current generation of browsers and font renderers. It partially broke a few of them; we have been working with browser manufacturers to fix all those issues.

We are looking forward to your feedback and bug reports. Please contact us through https://code.google.com/p/noto/issues/entry. Known issues can be found here.

Posted by Behdad Esfahbod, Software Engineer, Fonts & Text Rendering, Google Internationalization Engineering
Read More..

How to check if the phone is connected to the Internet

| 0 comments |
to check whether your phone is connected to the Internet, use the following code:
ConnectivityManager con=(ConnectivityManager)getSystemService(Activity.CONNECTIVITY_SERVICE);
boolean wifi=con.getNetworkInfo(ConnectivityManager.TYPE_WIFI).isConnectedOrConnecting();
boolean internet=con.getNetworkInfo(ConnectivityManager.TYPE_MOBILE).isConnectedOrConnecting();

these lines check for internet connection whether it is through WiFi or Mobile Internet.

you need to add the following permission to the AndroidManifest.xml file
<uses-permission android_name="android.permission.ACCESS_NETWORK_STATE" />

Another method is what our freind Kevin mentioned in the comments, is to check if a certain website is reachable or not like this:
public static boolean isOnline() {
try {
InetAddress.getByName("google.ca").isReachable(3);
return true;
} catch (UnknownHostException e){
return false;
} catch (IOException e){
return false;
}
}

we check if a site is reachable within a certain timeout or not.
Read More..