Wednesday, September 2, 2015

Learn How to Develop Android Application

Introduction:

Welcome to Android application development!

Here i am going to teach to you how to build your first Android app in Android Studio.

Development Environment:

Before you start this class, be sure you have your development environment set up. You need to:
  1. Download Android Studio.
  2. Download the latest SDK tools and platforms using the SDK Manager.

Create New Project:

An Android project contains all the files that comprise the source code for your Android app.
This lesson shows how to create a new project using Android Studio.

Steps:

  1. In Android Studio, create a new project:
    • If you don't have a project opened, in the Welcome screen, click New Project.
    • If you have a project opened, from the File menu, select New Project.


  2. Under Configure your new project, follow below steps.
    • Application Name is the app name that appears to users. For this project, use "My First App."
    • Company domain provides a qualifier that will be appended to the package name; Android Studio will remember this qualifier for each new project you create.
    • Package name is the fully qualified name for the project. Your package name must be unique across all packages installed on the Android system. You can Edit this value independently from the application name or the company domain.
    • Project location is the directory on your system that holds the project files.
3. Under Select the form factors your app will run on, check the box for Phone and Tablet.
4. For Minimum SDK, select API 8: Android 2.2 (Froyo).
   The Minimum Required SDK is the earliest version of Android that your app supports, indicated using the API level. To support as many devices as possible, you should set this to the lowest version available that allows your app to provide its core feature set.
5. Leave all of the other options (TV, Wear, Android Auto and Glass) unchecked and click Next.
6. Under Add an activity to mobile, select Blank Activity and click Next.
7. Under Customize the Activity,  change the Activity Name to MyActivity. The Layout Name changes to activity_my, and the Title to MyActivity. The Menu Resource Name ismenu_my.
8. Click the Finish button to create the project.
Your Android project is now a basic "Hello World" app that contains some default files. Take a moment to review the most important of these:
app/src/main/res/layout/activity_my.xml
This is the XML layout file for the activity you added when you created the project with Android Studio. In this XML contains one Relative Layout and one Text View. This Text View contains the text called "Hello Sandy!!!".

app/src/main/java/com.mycompany.myfirstapp/MyActivity.java
This is the java file for the activity you added when you created the project with Android Studio. When you build and run the app, the Activityclass starts the activity and loads the layout file that says "Hello Sandy!!!".
app/src/main/AndroidManifest.xml
The manifest file describes the fundamental characteristics of the app.components.
app/build.gradle
          Android Studio uses Gradle to compile and build your app. 
drawable/
          Here you can store images that should be in "png " formate. Various densities  such as medium-density (mdpi) and high-density (hdpi) screens.
layout/
       Directory for files that define your app's user interface like activity_my.xml, discussed above, which describes a basic layout for the MyActivity class.
menu/
       Directory for files that define your app's menu items.
values/
      Directory for other XML files that contain a collection of resources, such as string and color definitions. The strings.xml file defines the "Hello world!" string that displays when you run the default app.

Running Your App On Real Device:

           If you have a device running Android, here's how to install and run your app.
  1. Plug in your device to your development machine with a USB cable.
  2. Enable USB debugging on your device.
  • On Android 4.0 and newer, it's in Settings > Developer options.
Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.


Run the app from Android Studio:

  1. Select one of your project's files and click Run  from the toolbar.
  2. In the Choose Device window that appears, select the Choose a running device radio button, select your device, and click OK .
Android Studio installs the app on your connected device and starts it.
Here the below figure shows of our result:


I hope this article was helpful for beginners trying to create a simple Project using Android Studio .

I will come with new interesting topics in android in further articles.



Sandeep K

Android developer
Nanite Solutions
sandeep@nanitesol.com
+91 - 7411868235


                                                                                                        
                                                                                          Thanks,

                                                                                          Guided by: Praveen Kumar,Co-founder and President,                                                                                               Nanite Solutions, praveen.kumar@nanitesol.com



What is SQWEEZY?







What is Sqweezy?

Sqweezy is a 24x7 mobile application platform for food merchants to create and publish deals or offers; Consumer can search for deals or offers by cuisine, distance and price all within a specific geography, grab them and redeem using a consumer version of the mobile application.

How it works?

Install the Sqweezy merchant application on your phone (android or iOS) and explore the features that helps you publish deals with complete control to switch deals ON/OFF any time at your convenience. Consumers can download the application on their phones (android or iOS) and search for deals within your immediate neighbourhood. Use the distance slider to look for deals specifically within a 1km-5 km radius

How do I gain access to Sqweezy?

Sqweezy is currently in beta test and is being offered on invitation only; Consumers, write to us on contactus@sqweezy.com and one of our friendly staff will call to share the access. Merchants (or restaurant owners), register your interest on this site with your name, address and contact details. One of our friendly staff will call to provide you an exclusive access.

As a restaurant owner, how does Sqweezy benefit?

Sqweezy is a platform that provides restaurant managers or owners complete end to end control of pushing deals (define, create, publish, activate and deactivate) anytime of the day. These deals could be used to increase consumer footfall in your neighbourhood or to sell quickly specific food with short shelf life (e.g. samosas).

Why can’t I find Sqweezy on Google Play or iTunes store?

Sqweezy will be made available on both Google Pay and iTunes store after beta test is completed.

We are franchisees with multiple outlets, we need to get all our outlets on board, how do we do?

Franchisees with multiple outlets are supported both at an outlet level or across all outlets; Register your interest and one of our friendly staff will call to discuss your specific requirements.

I have technical issues whom do I contact?

Write to us at support@sqweezy.com for any issues (technical or non-technical);



This article is submitted by:
Praveen Kumar
http://www.sqweezy.com
 Sqweezy










Tuesday, September 1, 2015

Parenting in India and Abroad


Preface

Shashank's 5 year old son Adi threw his dad's iPhone across the hall in a rage. Shashank told him "Adi, you cannot do that!" for which Aditya took another android phone that was on the table and flung it at him again. He was in rage! And Shashank had no idea how to handle it. He mentions, this is not just once but a common problem he faces on a daily basis.
Where exactly is Shashank going wrong in his parenting?

Parenting in General


Most often, working couples decide to have a baby and never realize that they need to account their time spent with the kids at various ages for their education, development, hobbies, personality, behavior and more.

Parenting is not to be taken for granted.  Kids, while growing up, need a lot of attention, loving and caring, guidance, answers to their questions - all of which requires time from the busy schedules of working and "socio-politan" parents.

Every action by parents, words used, fights, arguments, habits, behavioural traits, food habits all get picked up by kids which makes parenting a direct and a very high influencer in the growth and development of children. It is very important for parents to keep their heated discussions or sensitive talks when the kids are either alseep or away. Studies have shown that, the bonding and understanding between the couple (parents) makes a huge difference in the kids behaviour and social growth.


Parenting across the world

There are various forms and types of parenting that is observed across cultures and geographies.
Attachment Parenting, Authoritative Parenting, Un-involved Parenting,  Permissive Parenting, Tiger Parenting, Over Protective Parenting, Competitive Parenting and more.



There is a huge difference in parenting / upbringing of kids between the East and the West. Parenting habits also varies a lot across various countries whether east of west. Asian countries like China, Vietnam, potty train their babies by 9-10 months. South American kids for eg in: Argentina are made to stay up very late with the parents which can be seen in restaurants at 11 pm in the night whereas Americans would have their kids in bed by 7:30 pm. Most Western countries strictly follow the rule of  "do not beat your kids" wherein,in countries like India, China and more, mischievous activities by kids are followed by a spanking or slapping from mom / dad. Many eastern countries still have joint families or closely-knit kith and kin who influence upbringing of children like Grandparents, Uncles and Aunts while many western countries are very nuclear in nature with hardly any influence from anyone other than parents. Neglectful or Disengaged Parenting seen in some of the western countries often makes the kids depressed, emotionally withdrawn and induce fear and anxiety.


Parenting in India

Parenting in India is directly influenced by the cultural and societal history and heritage and the changing times at any given point of time. Indian style of parenting is a lot based on the principles of Attachment theory which forms a strong emotional bond for the child with the parents giving a better socio-emotional development. This also has the negative of over-controlling of the kids by parents and minimizes the freedom to explore and nurture and grow.

A lot of factors influence parenting and upbringing of kids especially in India:
  • Economical Status of parents
  • Educational qualification of parents
  • Location and culture
  • Grandparents and Family members

 

  Common Mistakes by Parents and Especially NRI parents (abroad)


  • Non qualified advices - Frustrated parents of mischievous children end up talking and discussing their child's behavior or health with friends and folks who may be less qualified and less aware of the socio-cultural background abroad. The confident free advice will come easy. This can have a negative impact on the behavior and growth if applied without enough research or advice from experts 
     
  • Negative talk - Many Indian families have the habit of discussing topics which can be negative in nature right in front of the kids. They do not understand the fact that every single word uttered is getting registered. Since parents are the early role-models for their kids, this can have a high impact on their thought process. Commenting on other cultures, race, religion, background etc should be completely avoided. Countries like America has a rich population of families from different countries, it would become difficult for children to accept their friends with an open mind if parents do negative talks about others
  • Over attachment and over caring - while loving and caring is the most essential ingredient of parenting, over caring and affection beyond limits can lead to rebellious nature and go out of control. Assertive Parenting is very important and the parents need to have a strong heart when handling kids without giving in to their crying or funny actions 
  • Baby talk - cooing, babbling by parents to their kids, is not advised as babies start deciphering and learning language skills much before they start talking. It is a good idea to start talking normal language as it starts building vocabulary and also makes the child intelligent 

 


  • Setting unreasonable expectations without reason - Culturally, Indians are brought up with "don't do it, and don't ask why!", "sit quietly for 30 minutes without making noise" etc. Kids need to know why, when you tell them something. With a strict regime to follow and no proper explanations, kids will be very confused about many things and start following blindly without questioning. This will stint growth and development of the child and have a social impact when dealing with children from other cultures
  • Warnings and harsh talk with kids - Indian parents give a lot of warnings to their kids or even follow Tiger Parenting methods. In Countries like America where Government is very strict about child upbringing and have a set of rules to be followed, Indian parents get confused about how to handle kids that are very mischievous. Slowly, the kids start ignoring the warnings by parents and become rebellious
  • Copying other parent styles - With not enough awareness on parenting styles, many Indian parents abroad, simply copy some techniques or actions by other parents and try to apply the same on their kids. Not knowing the reason behind the technique applied for eg: Authoritarian Parenting, they use it blindly which may adversely effect the kids behaviour

  • Less outdoors - With advancement of technology these days, most kids either have iPads, TV in their rooms, XBox or some other gizmos to spend enough time. They spend a lot of time within the constraints of four walls and do not get time or interest to go out and play. Playing outdoors is very essential for being active, getting enough sunlight, intermingling with others, communicating with other kids and more

Summary:

It does not matter which country or geography or culture we are in, it is very important to spend time with kids, love and care for them, be assertive when required and educate them to learn the way of life. Following someone else's advice blindly may result in doing it wrongly and affecting your kids development and growth. With the current lifestyles and culture becoming extremely hectic and busy, it becomes very difficult to spend quality time with kids if it is not planned properly. 

Saturday, July 25, 2015

Yoga for beginners for a healthy living


Introduction

Take your time out and do these basic yoga poses or asanas even for 10 minutes everyday for great health and fitness and mental peace. Health and fitness is more important than money, because if you do not have good health, what is the use of money? If your health goes bad, you spend all your money on improving your health, which can be prevented ahead of time if you can spend some time everyday. Or if you earn enough money but do not have the health to enjoy, that is even worse! 

Below are a set of poses (asanas) for beginners in Yoga. These are very simple and easy to follow with only 3-4 days of practice you can become a master of these asanas and move to the next level of "Advanced Yoga Asanas"

Remember ---- ASANA = POSE!

What you need

You practically don't need to buy anything to be healthy with Yoga. All you need is some space and some quiet environment to increase concentration and improve the technique. Wear comfortable clothes so that you can stretch or bend without any resistance from your clothing.

List of Yoga Poses (asanas) for beginners

  • Tadasana (Palm Tree Pose)
  • AdhoMukha Svanasana (Downward Dog Pose)
  • Veerabhadrasana (Warrior pose)
  • Vrikshasana (Tree Pose)
  • Setubandh asana (Bridge Pose)
  • Trikonasana (Triangle Pose)
  • Ardhamatsyendrasana (Seated Twist pose)
  • Bhujang asana (Cobra pose)
  • Rajakapot asana (Pigeon Pose)
  • Bakasana (Crow Pose)
  • Balasana (Childs Pose)

Tadasana (Palm Tree Pose)


Benefits: Stretches the arms, the chest, the abdominal muscles, the spine and the leg muscles along with giving a sense of balance. This is an easy asana and can be done by all age groups
1. Take a deep breath and stretch the arms, shoulders and chest upwards
2. Remain in this position for few seconds
3. Bring down the heels, arms, shoulders and chest to normal position while breathing out

AdhoMukha Svanasana (Downward Dog Pose)

Benefits: Lengthens the spine, strengthens the muscles of the chest increasing lung capacity. This is an easy asana and can be done by most age groups

1. Come onto your fours. Lift the hips up, straightening the knees and elbows, form an inverted V-shape with the body
2. Remain in this position for few seconds
3. Exhale. Bend the knees, return to all fours. Relax

Veerabhadrasana (Warrior pose)

Benefits: Tones the legs and back and improves balance of the body. Increases concentration and improves stamina. This is an easy asana and can be done by all age groups
1. Take a deep breath and stretch the arms, and legs
2. Remain in this position for few seconds
3. Exhale and get back to the standing position with arms, shoulders and leg back in position


Wednesday, July 22, 2015

NSUserDefaults - Swift

NSUserDefaults is a class that allows simple storage of different data types.  It is ideal for small bits of information you need to persist between app launches or device restarts.
NSUserDefaults supports the following data types:
  • NSString
  • NSNumber
  • NSDate
  • NSArray
  • NSDictionary
  • NSData
NSUserDefaults should be used to store small amounts of data.  Here is simple use of NSUserDefaults to save the user name so that the next time they open up the app, I don’t have to ask them again. In this case, it would be overkill for me to store this type of data in Core Data or other complex mechanism. I simply check NSUserDefaults for a value and go from there. It is important to remember that NSUserDefaults are just that, helpful for reading/writing user preferences and other similar things.

Saving data:
Before we read or write data from NSUserDefaults, we must first get a reference to the NSUserDefaults class.
            1. let refs = NSUserDefaults.standardUserDefaults()
Once we have the reference saved to a constant, we can write data to it. You will be defining both the value and the key name to store the data.
            1. refs.setValue("Json Smith", forKey: "userName")
//This code saves the value "Json Smith" to a key named "userName".
Reading data:
Reading data is similiar to writing it. Again, let’s get a reference to the NSUserDefaults class and then we can query a key for a value.

1. let refs = NSUserDefaults.standardUserDefaults()
Once we have the reference saved to a constant, we can read data from it.
  1. 1. if let name = refs.stringForKey("userName"){
  2. 2. println("User Name: " + name)
  3. 3. }else{
  4. 4. //Nothing stored in NSUserDefaults yet. Set a value.
  5. 5. prefs.setValue("Json Smith", forKey: "userName")
  6. }
We are querying (in this case) the key named “userName” for a value. If the key returns a value, we print it out to the console. Otherwise, if there is no value saved yet, we use .setValue to save the name to NSUserDefaults.
In this case we are saving a string but you can use this with any of the data types described above. If you need to persist when the app was last opened, you can use NSDate in combination with NSUserDefaults.
Gopinath TB, 
CEO, Meteora Gaming
www.meteoragaming.com

Monday, July 20, 2015

How to use TableView using iOS Swift and display some data?

Introduction


A TableView is a very nice implementation in iOS to show a list of data. There are a lot of articles on the web but some are simple and many are quite complex.
Lets try and make this a simple exercise so that you can implement it in your project very easily.


Below are the steps to follow to get a tableview working in your iOS Swift Application

Step 1.

 Open XCode and create a new Project of the type "Single View Application"

Step 2. 

Give a name for your project (for eg: TryTableView) and choose Swift as the language

Step 3.

 After clicking finish you will see some files generated on the left side project navigation bar

Step 4.

 Search for Main.Storyboard and Click on it once (do not double click as it will open in a new window)

Step 5.

 Once the Storyboard is loaded in the center of the screen, look to the right side bottom of the screen where you will see "Object Library"

Step 6.

 In the Object Library find the "Table View" object

Note: Do NOT use Table View Controller but use TableView as seen in the above picture

Step 7.

 Drag the TableView to the ViewController that you see in the center of the storyboard
Now drag an IBOutlet of the TableView to your viewcontroller.swift file
For that you have to switch to Assistant Editor mode and Control+Click on the TableView control and drag it to your .swift file. You can refer the diagram below to see how it looks.

This will produce the line below in your code
     @IBOutlet weak var tv: TableView!

If you are not very clear on how to do that, please refer "Creating an IBOutlet in Swift"






Step 8.

 Now let us make some settings that is required for the tableview. Click on the TableView and on         the right side window, go to "Attributes Inspector" and set the value of "Prototype Cells" to 1. By default this might be zero

Step 11.

In project  navigator go to view controller.swift and write the functions as below.

        1.  // Add 2 new delegates UITableViewDataSource, UITableViewDelegate
           
             class viewController: UIViewController, UITableViewDataSource, UITableViewDelegate
            {
 
     
        2. // Create an array of any items or things those we wanted to show in Table
              let states = ["Karnataka", "Gujarat", "Maharashtra", "Tamilnadu"]

     
        3. //  soon after the view controller  loads the first function that executes is viewDidLoad()
              override  func viewDidLoad()
             {
                super.viewDidLoad()
                // Do any additional setup after loading the view, typically from a nib.
                 tv.delegate = self
                 tv.dataSource = self
              }

   
        4. //Write two important delegate functions like  (numberOfRowsInsections), (cellFor RowIndexPath)

             func tableView(tableView: UITableView, numberOfRowsInSection: Int) -> Int
             {

         // this return is used to return all the items assigned without mentioning the specific number of                items
              return states.count
             }

            func tableView(tableView: UITableView, cellForRowIndexPath indexPath: NSIndexPath) ->              UITableViewCell
            {
             var tblCell = tv.dequeueReusableCellwithIdentifier("cell", forIndexPath: indexPath) as!                        UITableViewcell

              tblcell.textlabel?.text = states[indexPath.row]

              return tblCell
            }
                 }


 Step 13.

  Run the project to get TableView.
  


I hope this article was helpful for beginners trying to create a TableView using iOS Swift  .
I am Revati Billur and I am a beginner myself with one month of total experience working at Nanite Solutions as an iOS developer.

If you have further questions about TableView using iOS Swift. Please feel free to write to me at revati@nanitesol.com

Thanks

Guided by: Praveen Kumar, Nanite Solutions