Saturday, August 8, 2015

Introduction to Hybrid App Development

History


With the Origin of mobile operating systems like iOS, Andriod, Windows and Others in the market. There are variety of devices in with different form factors and different hardware specifications. With the evolution of the Mobile Operating System, Mobile Devices hardware has evolved a lot. We will not deep into hardware development but yes we will talk more about the Software part.

So, What are the ways we can develop a Mobile Application?
  1. Using xCode with Swift, Objective - C and using their UI Libraries we can build Apps for iOS. you can go to Apple Developer Site to know more about it.
  2. Android Application development using Java. Getting Started with Android.
  3. Windows phone application development using .Net Framework and C#. Windows phone App Development getting started.
As Listed above if you need to build an App for multiple devices you would think I would need to learn all these technologies and believe me I have not listed all the Technologies which are used, I have just mentioned the programming languages.

So now you can understand what could be the problem with this. Anyway, I will mention it explicitly, Now I want to develop an App for all 3 Operating Systems. I have to develop it in 3 different plateforms to support 3 different mobile operating systems. Which I think would be huge effort for Developers and Enterprise Softwares. This problem leads to the evolution of Hybrid Mobile Application development with mainly involve development with PhoneGap (Currently known as Cordova).

Tuesday, August 5, 2014

Swift – All you need to know – Part 1

As we are studying the Swift programming language for past couple of months. While studying the language I cam across many features of the programming. So I thought to compile all those features with some brief introduction so that if some one just want to have a sneak peak at the features he/she can just go though this blog.

So this is the part -1 of the series I am thinking to write. Hope to complete it soon and cover the features in its entirety.



Objective C has been the core programming language for Apple software Development. It has been there for 20 years and serving us well. As per Apple they have worked for 4 years to design Swift Programming Language.

So what is it that they wanted to achieve with Swift? As per Apple during the Swift Programming language intro in WWDC 2014 they want “Objective C without the baggage of C”.

Swift is Fast, Safe, Modern and Interactive programming language. Here are the few key points of Swift programming language:

       Adapts safe programming patterns by using the Type Inference and Generics.

       It adopts the readability of Objective-C’s named parameters and the power of Objective-C’s dynamic Object Model.

       Provides seamless access to the existing Cocoa Framework and Objective-c code.

        Develop apps for iOS and Mac OS both.

You might have heard about the playgrounds the new feature in XCode 6 where you can use Swift language and see the output of the programming as you finish typing the code. We can discuss Playground and its features in other blog. Today we will talk about what all features Swift Programming language has come up with and will have brief introduction about each feature for you to kick start the language.


Wednesday, June 25, 2014

Optionals in Swift Programming Language

As we learned in my other blog about Initializers in Swift Programming Language that every variable in Swift should be initiazed before trying to access the value.

So what if you do not want to initialize a variable. That is where Optionals in Swift comes into play.

Before start discussing about Optionals you should know about nil. nil in Swift means nothing, no value at all.

Lets see what optionals provides us:

  • Optionals can store value nil which means no value.
  • Any non optional can not store nil.
  • you can check for options have nil or value by just writing if value no need to add extra code for == nil. because optionals can be used in boolean context.
Reading a value from the Optional is called unwrapping the Optional.


How to unwrap optionals?
  • using the force unwrap operator !.  but if you use this operator without checking for nil you may end up with an error at runtime.
  • using the if let statement you can check for the value and unwrap it once. This is called optional binding.

Optional Binding


Saturday, June 21, 2014

Initializers in Swift Programming Language

As the name says Initialization. Initializers are declared to set the initial values of the type when any object of type gets initialized. Initializers are declared using the the syntax

init() {…}

you can also pass parameters to the initializers. So As the Swift programming enforces one simple rule

“Every value must be initialized before it is used”

Only exception to the above rule is optionals where we default their vale to nil. 

So what the above rule means? Does it mean that I cannot write something like

var someString : String

No, It means before you access any value it must be initialized in every possible branch of the execution of the code. If you don’t do it you will get a compile time error. Initializers have the responsibility to fully initialize an instance.

Initializers in Structure

So if you have a structure like this

struct Person
{
    var firstName : String
    var LastName: String
    init(first: String, last: String)
    {
        firstName = first
        lastName = last
    }
}
  • Say you forgot to initialize the firstName in the initiazer, than compiler will generate a compile time error.
  • Also if you try to call any method before initializing all the variables in the struct, you will get a compile time error.
  • you can write initializers for Structures and Classes both.


Memberwise Initializer

What if you do not specify any Initializer to the struct or class? 

Swift Compiler provide you with a Memberwise initializer. So for the above structure if you do not have the initializer declared you can still initialize the values by saying

Tuesday, June 17, 2014

Swift Playgrounds Introduction

So finally I had some time to explore the swift playgrounds. One thing I would like to say about playgrounds is that It's awesome and cool...

So here is the icon that they have given to the playground document type.

Clearly icon goes with the name. But believe me it does goes with the icon, its a child play to use the playground. You just open up the playground and you are ready to code.