Author Archives: androiddummies

The Top 10 Javascript MVC Frameworks Reviewed

http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/

HTML 5 Debugger

javascript Patterns

Function Patterns

API Patterns

  • Callback patterns – when you pass function A to function B as a parameter, function A is a callback function
  • Configuration objects – keep control of function arguments and makes it easily configurable
  • Returning functions – one function returns another function or create another function on-demand
  • Currying – used to create new functions dynamically by partially applying a set of arguments

Initialization patterns

Performance patterns

  • Memoization – use function properties to avoid repeated computation
  • Self-defining functions – self-overwrite with new bodies to do less work from the second invocation and after

jQuery Patterns

  • requery – avoid requery by using jQuery chaining
  • append – use string concatenate and set innerHTML
  • data – pattern and antipattern of using data
  • context and find – use find over context
  • detach – take element off the DOM while manipulating them
  • event delegation – event delegation pattern and antipattern
  • selector cache – using selector cache to avoid requery
  • window scroll event – avoid attaching handlers to the window scroll event

Selector

Literals and Constructors Patterns

  • Object literal – use the simpler and reliable object literal instead of new Object();
  • Enforcing new – when you forget `new`, `this` inside the constructor will point to the global object
  • Array literal – use array literal notation to avoid potential errors when creating dynamic arrays at runtime
  • Working with JSON – use library from JSON.org, YUI, jQuery instead of eval for parsing
  • Primitive wrappers – try to use the primitive without wrapper
  • Regular expression literal – try to use the shorter literal notation

Design Patterns

Creational

  • Builder – constructs complex objects by separating construction and representation
  • Factory method – creates objects without specifying the exact class to create
  • Singleton – restricts object creation for a class to only one instance

Structural

  • Decorator – dynamically adds/overrides behaviour in an existing method of an object
  • Facade – provides a simplified interface to a large body of code
  • Proxy – provides a placeholder for another object to control access, reduce cost, and reduce complexity

Behavioral

  • Chain of responsibility – delegates commands to a chain of processing objects
  • Command – creates objects which encapsulate actions and parameters
  • Iterator – implements a specialized language
  • Mediator – allows loose coupling between classes by being the only class that has detailed knowledge of their methods
  • Observer – is a publish/subscribe pattern which allows a number of observer objects to see an event
  • Strategy – allows one of a family of algorithms to be selected on-the-fly at runtime

General Patterns

Top10 JavaScript MVC Frameworks Reviewed

http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/

Read All Your Favorite Blogs in One Place

The WordPress.com Blog

If you feel like it’s a chore to keep up with all your favorite blogs, you can now read posts from all the blogs you follow (even the ones that aren’t on WordPress.com!) in one convenient place on the WordPress.com home page:

Your reader displays all the posts across all the blogs you follow in the order they were published, with the most recent content appearing at the top. You’ll see an excerpt of the introduction to each post, the first image in the post, and thumbnails of any other images that the post contains.

You can even like and reblog WordPress.com content directly from the reader (we’re working on bringing reblogs back to the toolbar!) using the icons in the top right corner of each post:

Whether you’re at the computer or using the WordPress app on an Android or iOS mobile device, having all the posts from the…

View original post 313 more words

HTML 5 & CSS3 Support

http://fmbip.com/litmus/

PhoneGap plugins

PhoneGap plugins are available here: https://github.com/phonegap/phonegap-plugins

How to install PhoneGap and Start Guide?

Here you go ( http://phonegap.com/start ). Here its detailed enough how to install and start guide of phonegap for all platforms. I choose Android platform. Here I’m going to talk about the issues i faced when setup a new project. I followed exactly the steps said by them but when I run the application it shows below errors:

Unknown chromium error: -6
DroidGap: GapViewClient.onReceivedError: Error code=-1 Description=A network error occurred. URL=file:///android_asset/www/index.html

Goggled, a few people faced the same problem and they given solution to fix this issue, they are:

1) add super.init() before loadurl();
2) add super.setIntegerProperty(“loadUrlTimeoutValue”, sometimevalue); 

will be like this:

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
super.init();
super.setIntegerProperty(“loadUrlTimeoutValue”, 6000);
super.loadUrl(“file:///android_asset/www/index.html”);
}

Now my code has those lines. I hoped after adding those lines my app works. I run my app, unlucky faced the same problem. So something is missing or doing wrong. After 2 hours, found that there is a extra space at beginning  of file name in”  index.html”.  I removed the space now it works 🙂

Whenever you are facing this problem first check the file name conversion is correct and then add above two lines(blue color) in your code.

 

 

About Phonegap

Last month,I decided to learn about mobile development especially Android. When I goggling to gather basic knowledge of Android platform, was come to know about Phonegap. PhoneGap uses standards-based web technologies to bridge web applications and mobile devices. To know more about

http://phonegap.com/about

Mobile Frameworks

AppMobi

http://www.appmobi.com/

Supported Platform: iOS, Android

AppMobi framework wraps PhoneGap Services and gives a visual tool for development, which is a cloud based. AppMobi claims that PhoneGap have some rough edges but doesn’t define what are the rough edges. Most of the times the XDK is unable to launch.

Titanium Appcelerator

http://www.appcelerator.com/

Supported Platform: iOS, Android, RIM Blackberry, Desktop Apps for Linux, mac & Windows. Has its own IDE for development, Titanium Studio or comes as a plugin for Eclipse.

PhoneGap

http://www.phonegap.com/

Based on Html 5, CSS, Javascript

Supported Platform: iOS, Android, RIM Blackberry, HP WebOS, Symbian, Bada OS and Windows Mobile Platform.

Detail Featured List: http://www.phonegap.com/about/features

It’s integrated with Dreamweaver CS5.5 with jQuery. Adobe has acquired Phonegap.

RedFoundry

http://www.redfoundry.com/

Supported Platform: iOS

Online framework to build mobile apps, visual development tool with predefined page and module structure.

Mobile UI Frameworks

jQuery

http://jquerymobile.com/

Supported Platform: iOS, Android, RIM Blackberry, HP WebOS, Symbian, Bada OS and Windows Mobile Platform.

UI framework built on jQuery foundation. Sponsored by Nokia, Adobe and Palm OS. Is a light weight library minified 24kb.

Sencha Touch

http://www.sencha.com/products/touch/

Supported Platform: iOS, Android, RIM Blackberry.

Another UI framework for Mobile. Library up to 120kb (minified)

JTouch

http://jqtouch.com/

Another jQuery plugin for mobile development.

Both Sencha Touch & jQuery Mobile are supported by Phone Gap framework.

Dreamweaver CS5.5 comes integrated with PhoneGap & jQuery Mobile.

Flash CS5.5 allows application development for Android, iOS with AIR

 

Sqlite

http://docs.phonegap.com/en/1.1.0/phonegap_storage_storage.md.html

Lightweight database engine for local storage.