EzDevInfo.com

mobile interview questions

Top mobile frequently asked interview questions

HTML5

According to:

http://developer.android.com/sdk/android-2.0-highlights.html

Android 2.0 should support the HTML5 video element. I haven't been able to get this to work using a Motorola Droid, and haven't been able to successfully view a video on any of the HTML5 video example pages out there. Since there currently isn't support for QuickTime or Flash, this is the only other thing I can think of for embedding mp4 video in a web page. Has anyone had any luck with this?


Source: (StackOverflow)

How to Get GPS location from the web browser

I am developing a mobile based web-site, there I have integrated google maps, I need to fill the 'From' field of google maps dynamically.

Is it possible to get the 'GPS' location from web-browser and fill it up in the 'From' field of a google map dynamically.


Source: (StackOverflow)

Advertisements

CSS "position: fixed;" into iPad/iPhone?

I have been strugling with fixed positioning in iPad for a while. I know iScroll and it does not always seem to work (even their demo). I also know that Sencha has a fix for that, but couldn't ctrl+f the source code for that fix.

I am hoping that someone may have the solution. The problem is that fixed positioned elements do not get updated when the user pans down/up on an iOS powered mobile Safari.


Source: (StackOverflow)

Develop Android app using C#

I am pretty new to phone app development. Not even wrote single line of code for phone app.

I wanted to know is it possible to write an android app using C#? Is there an API or something? Is it free for personal and commercial development?

What do I need to install to have android project template in my Visual Studio 2010?


Source: (StackOverflow)

2D Cross-Platform Game Development Engines [closed]

I've worked for some time with Corona SDK and love how fast and easy I can create powerful apps using Lua. But it can only compile for iOS and Android, which feels like too little now.

My main interest is for it to be able to compile to Desktop AND Mobile. At least for the following:

  • Windows + Mac for desktop, as standalone applications.
  • iOS + Android for mobile.

I'd prefer it to lean more towards Lua type scripting instead of ActionScript, but please feel free to post anything that you have worked with and love.

I've found the following engines so far:

  • Marmalade Quick - After further looking into it, Marmalade Quick can only build for Mobile!
  • IwGame - Works on top of marmalade and says it can deploy to desktop and mobile with Lua. Any info is greatly appreciated on this
  • sio2 - Says "SIO2 is an OpenGLES based cross-platform 2D and 3D game engine for iOS, Android, MacOS and Windows" and "The engine also allows you to port your game on the Mac Store and on Windows.", but their forum and web title is "Game Engine for Mobile Devices". Can't find any info on if it can deploy to desktop platforms, any info is greatly appreciated again.
  • Loom Engine - Loom is similar to Haxe + OpenFL (attempts to attract Flash developers) in that it uses AS3-like of ECMAScript, but it doesn't build native code from it. However it uses Cocos2D for rendering so it should in theory be as fast as Cocos2D. -- Thanks to Bojan.
  • SDL - I've read in multiple places that SDL can deploy to nearly any platform or device and has a Lua binding. But i can't find how this works as it's not an engine. Any one who can explain how it works and if it's possible is once again, very much appreciated.
  • SFML - "Windows, Linux, Mac OS X and soon Android & iOS. " doesn't use Lua but can use other languages like Java and Python etc. Anyone have any information on this?
  • Torgue2D - "Torque 2D was developed with OS X, Windows, and iOS devices in mind and works equally well on all the platforms." uses TorgueScript and no Android =(
  • Sencha - Seems to compile to all platforms, uses Javascript too which I know. But even with V8 JS would this work well performance wise compared to other options?
  • GameMaker - own scripting language GML and I actually remember this one as a tool for non-programmers. Has it actually grown into a real engine, I mean for serious development?
  • Construct2 - Same question as gamemaker
  • Corona - Lua but mobile only (Android and iOS only as well)
  • Cocos2D - Seems like it has lots of options but not sure with the same language? Seems like you'd have to re-write your entire code. Any info if cocos2D can deploy to desktop + mobile with almost the same code would be greatly appreciated.
  • Angel2D - Says it can deploy to everything except Android and uses Lua, anyone ever used this one before?
  • libgdx --- I've only seen good things about this. Here is a benchmark test for libgdx and is where I saw it reaching 40k sprites at 60fps. http://www.sparkrift.com/2012/1/love2d-vs-allegro-vs-clanlib-vs-libgdx-vs-cocos2d-x-vs-monogame-vs-xna-vs-sfml . It seems libgdx barely goes over 30k actually. But still seems amazing. This is on the same level as Qt for me, almost perfect, except I'm not really worried about performance on it. libgdx can build for everything pretty much.
  • XNA + MonoGame --- MonoGame's performance seems only slightly lower than libgdx, can build to most platforms. However I don't know much about XNA and I heard it won't be receiving future updates, but is quite stable? More information is welcome.
  • Citrus --- Don't have much information on Citrus either. AS3 game engine that can build for iOS, Android, Windows, Mac and more.
  • Haxe + OpenFL --- OpenFL (Haxe) builds to native on many platforms, not just to Flash. Windows, Mac, Linux and Android all get optional native deployment or OpenFL runtime called Neko which is in theory faster than Flash, and SDL 2.0 will enable iOS deployment soon(ish). -- Thanks to Bojan.
  • Qt-Project --- Just linking Qt project here, can build for everything and has a pretty big community with lots of third party libraries to help you even further.
  • Moai ---The only Lua engine that I know that can build for Desktop and Mobile. Only downside is the community isn't that big and documentation isn't the best. But if you can get passed those this is a great solution and the one I'm currently using.
  • Adobe --- Can't forget to add adobe here since it can build to everything that supports flash.
  • Unity3D --- Recently announced 2D integration looks very promising, should be released Q3-Q4 of 2013.
  • Cocos2d-x --- An open source engine. Supports JS, Lua, C++ and multiple platforms.
  • Html5 --- There seem to be a lot of emphasise on html5 mobile apps, here are just a few tools I found that can help port your html5 project to a platform:

    1. Chromium embedded

    2. Sencha

    3. Phonegap

    4. Appcelerator/Titanium

    5. Icenium

So, I'd be happy if you could comment from your experiences with any engines and suggest which one you would recommend. Thank you for your help!

EDIT: Since this topic is getting popular I'll be adding other options I've found over time. I suggest you choose what is most familiar to you and best for your project needs.


Source: (StackOverflow)

Standard way to detect mobile browsers in a web application based on the http request

We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based). Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the content to be returned accordingly. Is there a standard way to make this determination (quickly) based on the http request, and ideally glean more information about the given browser and device making the request (screen size, html capabilities, etc?).

I would also appreciate any supplemental information that would be of use from someone who has gone down this path of taking an existing large scale enterprise webapp and architect-ing out mobile browser support from the development side.

[edit] I certainly understand the request header and the information about a database of standard user agents is a great help. For those talking about 'other' request header properties, if you could include similar standardized name / resource of values that would be a big help.

[edit] Several users have proposed solutions that involve a call over the wire to some web service that will do the detection. While I'm sure this works, it is not a good solution for an enterprise e-commerce site for two reasons: 1) speed. A call over the wire for every page request to a third party would have huge performance implications. 2) dependency/legal. We'd tie our website response time and key functionality to their service, which is horrible for legal and risk reasons.


Source: (StackOverflow)

JS library (with drag n drop) compatible with iOS and regular browsers

Does anyone know of a JS framework that has drag and drop functionality and is compatible with mobile (iOS) and regular browsers?

I currently have a web-based app and it is a hassle to make its drag'n'drop functionality work on iOS... I wish there was one that would do it for both...


Source: (StackOverflow)

How does Chrome's "Request Desktop Site" option work?

For iOS google chrome, when a user hits the "Request desktop site" button what does the browser do to try to bring up a desktop site? I imagine some sort of header on the request that sites are looking for, or something similar?


Source: (StackOverflow)

Twitter Bootstrap modal on mobile devices

Bootstrap modals don't work correctly on Android and iOS. The issue tracker acknowledges the problem but does not offer a working solution:

Modals in 2.0 are broken on mobile.

Modal window in 2.0 not positioning properly

The screen darkens but the modal itself is not visible in the viewport. It's possible to find it at the top of the page. The problem occurs when you've scrolled down on the page.

Here is a relevant portion of bootstrap-responsive.css:

.modal {
position:fixed;
top:50%;
left:50%;
z-index:1050;
max-height:500px;
overflow:auto;
width:560px;
background-color:#fff;
border:1px solid #999;
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);
-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);
box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);
-webkit-background-clip:padding-box;
-moz-background-clip:padding-box;
background-clip:padding-box;
margin:-250px 0 0 -280px;
}

Is there a fix I can apply?


Source: (StackOverflow)

What database does PhoneGap use and what is the size limit?

I wrote an HTML5 database that abstracts localStorage, indexedDB, and WebSQL. Using straight HTML5 my database options look like this:

  • IE10 - indexedDB - 1GB max
  • FireFox - indexedDB - unlimited
  • Safari - WebSQL - 50MB max
  • Chrome - IndexedDB (or Web SQL) - unlimited (with the HTML5 Quota API ref1, ref2)
  • Opera - WebSQL (until they switch to webkit?) - unlimited

I would like to expand the maximum database size using PhoneGap or the Quota API. From PhoneGap's documentation it looks like the current PhoneGap database ecosphere is:

  • WebSQL - Android, Blackberry, iPhone, and webOS
  • localStorage - Windows Phone 7
  • indexedDB - Windows Phone 8 and, i am guessing, everywhere indexedDB is available but WebSQL isn't.

There are also the PhoneGap SqlLite plugins. iOS, Android, Windows Phone 8+


QUESTION 1 - Is my understanding of what database PhoneGap will use accurate?

QUESTION 2 - Is there any solid documentation about how much data a PhoneGap database of a given type will store? *If it is a PhoneGap database and not the browsers database implementation.

QUESTION 3 - Does PhoneGap have plans to adhere to the the Web Storage standards thereby dropping WebSQL in favor of indexedDB? If so, will I still be able to use my existing WebSQL code (via a built in PhoneGap-polyfill) once the switch to indexedDB is made?

QUESTION 4 - In situations where database size is limited and cannot be expanded by either PhoneGap or the Quota API, but access to the file system is available, is it reasonable to assume that "extra" data could be stored on the device's file system or on a SD card?


Source: (StackOverflow)

Understanding touch events

I'm trying to make some of my libraries work with touch devices, but I'm having a hard time trying to figure out how they're supported and how they work.

Basically, there are 5 touch events, but it seems there's consensus among mobile browsers only on the touchstart event (duh). I've created a fiddle as a test case.

I've tested this on my Galaxy Note with Android 4 on board, but you can check the link with a desktop browser too.

The goal is to try to figure out how to handle taps, double taps and long taps. Nothing fancy.

Basically, this is what happens:

The Android stock browser doesn't fire touch events. It just tries to emulate mouse clicks with taps, firing mousedown, mouseup and click events consecutively, but double taps just zoom in and out tha page.

Chrome for Android fires the touchstart event when the finger touches the screen. If it's released soon enough, it fires then mousedown, mouseup, touchend and finally click events.

In case of long tap, after about half a second it fires mousedown and mouseup, and touchend when the finger is lifted, with no click event at the end.

If you move your finger, it fires a touchmove event a couple of times, then it fires a touchcancel event, and nothing happens afterwards, not even a touchend event when lifting the finger.

A double tap triggers the zoom in/out features, but event-wise it fires the combo touchstart-touchevent twice, with no mouse events fired.

Firefox for Android correctly fires the touchstart event, and in case of short tap fires mousedown, mouseup, touchend and click afterwards.

In case of long tap, it fires mousedown, mouseup and finally touchend events. It's the same of Chrome for these things.

But if you move your finger, if fires touchmove continously (as one may expect) but it doesn not fire the touchleave event when the finger leaves the element with the event listener, and doesn't fire the touchcancel event when the finger gets out of the browser viewport.

For double taps, it behaves just like Chrome.

Opera Mobile does the same thing of Chrome and Firefox for a short tap, but in case of long press activates some sort of sharing feature that I really want to disable. If you move your finger, or double tap, it behaves just like Firefox.

Chrome beta does the usual for short taps, but in case of long taps it doesn't fire the mouseup event anymore, just touchstart, then mousedown after half a second, then touchend when the finger is lifted. When the finger is moved, now it behaves like Firefox and Opera Mobile.

In case of double taps, it doesn't fire touch events when zooming out, but only when zooming in.

Chrome beta shows the oddest behaviour, but I can't really complain since it's a beta.

The question is: is there a simple and way to try to detect short taps, long taps and double taps in the most common browsers of touch devices?

Too bad I can't test it on iOS devices with Safari, or IE for Windows Phone 7/Phone 8/RT, but if some of you can, your feedback would be very appreciated.


Source: (StackOverflow)

Convert HTML5 into standalone Android App

I have a dynamic HTML5 document that does not contain any external resources (no images, css and scripts are coded inside of document). This HTML5 application is working fine with internet browser. I was wondering, if it would be possible to convert this HTML5 application into standalone Android application, so it can be executed directly without browser. Please advise.


Source: (StackOverflow)

How to access a mobile's camera from a web app?

In my web app (not native app) for mobiles, I want to take a photo and upload it, but I don't want to use Adobe Flash. Is there any way to do this?


Source: (StackOverflow)

Simplest way to detect a mobile device

What is the simplest way to tell if a user is using a mobile device to browse my site using PHP?

I have come across many classes that you can use but I was hoping for a simple if condition!

Is there a way I can do this?


Source: (StackOverflow)

What are the aspect ratios for all Android phone and tablet devices?

I'm looking for a list of all screen aspect ratios for popular Android based Phones and Tablets.


Source: (StackOverflow)