Kasen's Blog

Dec 14, 2012

Parse is platform designed to offer a highly configurable backends that can be integrated with mobile apps and JS apps as well. This type of service is known as Backend as a Service, or BaaS for short. These services provide you with a package of backend storage and other functions that can be leveraged from your app, usually with a handy library on a variety of platforms (Android, iOS, Win, JS) to make integration nice and easy.

Parse stands out for being one of the the easiest and fastest backend services to work with, as well as having the best documentation. The documentation is easy to understand, as well as being comprehensive. Generally, it will take you less time to start uploading objects to Parse than any other service. Parse offers most of the features that you’d expect from a backend service provider, including the following:

Custom Objects: This is the ability to create custom objects from the app itself without the need to define a schema first, each object type is defined as a Class. The app will be able to access these objects and query them similar to a DB. The Parse SDK provides an easy way to take this data from object format, and store/retrieve it from the central database.

Users: Parse provides the logic to create and authenticate users right out of the box. These users can even be integrated with Facebook/Twitter so that the user doesn't need to create a new account. These users can be used later on to authorize read/write operations on any object class using Access Control Lists (ACLs).

Push Notifications: This is the ability to send a push notification to all your users, or to a selective subset of your users. In Parse, sending notifications is done from the Web Console, the REST API, the Cloud Code or even triggered by the existing client SDKs.

Social Integration (Facebook / Twitter): Additionally to having your own users storage, you can also enable the user to login through Twitter or Facebook. The SDK will take care of the OAuth process and even cache the credentials while still using the same ACLs for authorization and security.

Files: In addition to storing plain old data, sometimes you need to store files -- such as images, large documents, and the like. Parse will provide file storage that you can use to associate a file with a custom object.

Geolocation: In mobile apps, it’s often useful to be able to perform queries of objects near a certain location. Parse provide the ability to tag your objects with a specific location so the user can make queries on objects based on location.

A nice thing about Parse is that it has sample projects that you can download, as well as custom UIViews that you can add to your project, such as Facebook and Twitter login views. Additionally, there is a large collection of 3rd party libraries offered for use with the service. For example, integration with Twilio to send SMS messages from a mobile app.

The free plans that Parse offers are very good and offers enough capabilities for a small app. However, it's worth to mention that the price does seems to ramp up more quickly than other services if you exceed your free allocation.

Is Parse the right choice for my project?

Advantages

Good features, pricing, and excellent documentation when compared with similar BaaS companies.

Custom UIViews that you can add to your project, such as Facebook and Twitter login views.

Several sample projects that you can downloaded for reference and as a quick start. (FB authentication, file storage, push notifications, object-level security, geolocation).

A large collection of 3rd party libraries offered for use with the service. For example, Twilio, Mailgun, SendGrid integration.

New attributes can be added to a particular object class at any point.

Ability to export all data stored in Parse to a zip file as JSON files (For stored files, an URL is provided on the attribute).

Importing Data: In addition to the REST api, data can be imported to the backend through CSV files.

Abstracts most of the complexity of Push notifications.

Scalability is handled for you.

Disadvantages

Not suitable for projects that require to handle complex logic on the server side. For example, each operation might affect many different classes.

Data Type Lock-in. Once the first object has been created, its field are locked into the particular type that was saved. For example, if a User object is saved with field name of type String, that field will be restricted to the String type only. One special case is that any field can be set to null, no matter what type it is.

While the free plans are very good, the price could ramp up more quickly than other services if you exceed the free allocation.

Aug 24, 2012

Depending on the context of the project, needs of the client and time constraints we might consider using the PhoneGap framework to do the implementation of the app instead of going native. But, it’s the right technology for the task at hand? Here are some points that might help in the decision making process:Phonegap good points:

Small learning curve for web developers since it uses known technologies such as HTML5/CSS/JS. The PhoneGap API offers a event model that is familiar to client side developers. It’s easier to find web developers than native iOS developers.

Reusability: If the app is structured in modules, this could be potentially reused for a web app that shares common functionality.

Options: There are a plethora of different frameworks and libraries in the web that can be used to fulfill different needs in each app. For example: jQuery Mobile, Sencha Touch, JQ Touch, iScroll, SpineJS, just to mention a few.

WebKit: since both iOS and Android platforms rely on Webkit for their browsers, PhoneGap apps can use some of the latest HTML5 and CSS3 awesomeness.

Support for web version of Google Analytics.

Considerations:

Conditional code for each platform.

iOS issues:

Scrolling for iOS might have glitches handling large views.

Position:fixed style does not work in <iOS4. Although, it can be achieved using hacks or iScroll library, the are still some issues: http://remysharp.com/2012/05/24/issues-with-position-fixed-scrolling-on-ios

For large apps using a JS MVC framework is encouraged. SpineJS is a good option that includes also a flexible template engine.

CSS Media Queries can be used to handle the resolutions and orientation across devices. For example, this technique can be used to load higher resolution images for bigger screens.

Summarizing, PhoneGap is a good option for projects where:

Need to deploy in several platforms.

Performance is not critical.

Simple apps with reduced budget or human resources for the project.

The hierarchy of views is not more than 5 levels deep.

Does not need to handle large images or too many of them in a single view.

Here is a infographic that might help further in the decision making process:http://www.appliness.com/infographic-decision-path-to-phonegap/

Feb 26, 2012

The VideoView class included in the Android SDK provides a very convenient wrapper of the Surface View class. It takes care of computing its measurement from the source video so that it can be used in any layout manager.

By default Android will scale the video to fit the VideoView but keeping the video aspect ratio. That means that depending on the device's screen size there might be some black spaces left around the video the video since the it's not filling the screen.

Depending on what you are looking for, you might actually want to completely fill the parent container area even if that means to stretch the video to fill the gaps (in other words, altering the aspect ratio of the video).

Well, turns out that even though the VideoView doesn't provide an explicit way to specify the filling mode, you can achieve the same result by wrapping the video view in a Relative Layout and setting the VideoView alignments to match the parent's boundaries:

Feb 21, 2011

This is my small contribution to the HTML5 community. It's an experiment that uses the HTML5 canvas element and the associated drawing methods to generate a DNA structure on the fly.

You can select from 7 fixed color schemes or let the application generate a random sequence following the basic pairing rules for a DNA sequence (A - T & C - G). Additionally, change the number of pairs and the vertical spacing between each pair at any time.

Internally, JS objects work together to calculate, cache the position of the nucleotides and finally draw them to the canvas. The nucleotides were first created using the createRadialGradient method, however the it would take around 1 -3 seconds to generate the animation, so images were used instead to represent them. Also, to avoid a flickering animation the elements are drawn offscreen and then copied into your onscreen. At the core of the application only plain javascript is used, the jQuery library was used only to provide the sliders functionality and basic selectors.

It would be very interesting to allow anyone to create their own color schemes and save them.. might be nice features for a version 2.

Mar 25, 2009

This is a short film from Bruce Branit, it's about a man that uses holographic tools to build a world for the woman he loves. It reminds us that we should never take for granted even the simplest of things. The sound of a running river, the sight of a flower, the dance of a leave when it falls off a tree... all the things that we experience every day but rarely notice, and even more rarely appreciate.

Hope we can develop this kind of technology in a near future, it would take the phrase "The imagination is the limit" to a whole new level... =D

Mar 24, 2009

I recently had to install this PHP framework into Awardspace for testing purposes. Although Drupal is designed to ease the installation process to the users, you have to make some modifications

You can download Drupal in this site if you haven't already =P ( Drupal 6.9 )Once you have downloaded Drupal and created an account in Awardspace we need to upload the files to our Awardspace account. The easiest way to do this is using and FTP client (I would recomend FireFTP).

If you try to install the site accessing the 'install.php' page using your browser, it will probably throw an "500 Internal Server Error" but don't worry, we will review that issue right away.You need to connect to your file manager from the Hosting Control Panel (or using your FTP client) and rename the file .htaccess file to another name (I renamed it to .htaccess.old) or delete it, but the first option is the recommended.

Now, if you run again the install.php script, the page will let us access the install page. The first page is the Choose language screen where you can choose whether to install Drupal in English or another language. But before you can install your new Drupal site, you need to go to PHP settings on the Web Manager of the Awardspace Control Panel, and then change the version from PHP 4.x.x (mine was 4.4.1) to PHP 5.x.x (5.2.5). If you don't have permissions nor don't want to go to that version, then this error might appear:

register_globals is enabled. Drupal requires this configuration directive to be disabled. Your site may not be secure when register_globals is enabled. The PHP manual has instructions for how to change configuration settings. (Currently using PHP register globals Enabled ('1'))

After you have changed this setting you are ready to go. Now you should be able to run the install script (install.php) normally and follow the steps like you normally would.