Showing posts from August, 2013

Different layouts for different android phones and tablets

If you are developing a mobile app which for  both phones and tablets, sometimes you may be confused by the way the html pages with the fonts, images are rendered. Though the number of pixels in the higher end android phones shows 768pixels (or webkit-device-pixel-ratio =2) and for an android tablet 600pixels, so you must be thinking I should be using larger images and fonts for the 768 pixels rather than the tablet.


Here lies the concept of webkit-device-pixel-ratio.
As per this documentation,  A screen with low density has fewer available pixels per inch, whereas a screen with high density has more pixels per inch

So, even if the number of pixels in Nexus4 is 768, but the web-device-pixel-ratio is 2, hence for a lower end android device(320pixel) and a higher end android device with device-pixel-ratio=2 should use same css files.

In order to render different css/html pages for an android app, you can check whether the app is opened in Tablet or phone. Based on that render the html…

Responsive deign for single app in mobiles, tabs, desktops

If you like to have your app run in different devices viz. desktop, mobile, tablets without rewriting the app there are various ways to do so. There is nothing like wrong or right, each app has it's own specification and requirement to adopt.

Following are some of the ways, though in mobile platforms like android/iOS different methods can also be adopted. 
Twitter bootstrap is a nice framework for doing so

Second option, If you don't want framework, can try with media queries.attaching a sample index,html page, where 3 diff css files, which are called based on the device-pixel-ratio / max-device-width of the device....

<!DOCTYPE html>
<meta http-equiv=\"Content-type\" content=\"text/html\" charset=\"utf-8\">
<meta name=\"viewport\" content=\"width=device-width, target-densitydpi=device-dpi,
initial-scale=1.0, minimum-scale=1.0, maximum-s…

How to install a apk file in android emulator

Download the android client Save it to a local directory. Install the Android SDK : Open Android/sdk directory
.Run the SDK Manager.exe ·From Extras dir at the bottom of the SDK Manager, Download Intel x86 accelerator (HAXM) ·The IntelHaxm.exe file will come inside such a location ·Run the .exe file to install it.

Install Android API
From the upper Panel, click on Tool à Manage AVDs..

Create a AVD (android virtual device), by clicking on New Button, on the right

Once AVD is created, it should come in the list of AVD Virtual Devices

    Start the AVD, from the right panel 1      1.Open the platform-tools dir within Android dir, from the command prompt ·Run the command:                 adb devices ·It should list the started emulator.

RubyConf India 2013 BioRuby... Ruby in the Living World by Doel Sengupta...