Showing posts with label Mobile. Show all posts
Showing posts with label Mobile. Show all posts

Sunday, December 15, 2013

Xamarin Mobile Development: Consuming Java Libraries from C# in Xamarin.Android - Part 2

On a previous blog post on Xamarin mobile app development and Android, we talked about how third-party libraries help to significantly cut down on the mobile development time by allowing app developers to not worry about building certain things, like a custom UI control or a client service. We also learned about binding and converting as well as what sort of things we should consider before getting started, like having a proper Java decompiler ready.


With all of these things set up and ready to go we can dive deep in some work!


 


We start by creating a new Android Java Bindings project


 


After Xamarin creates and loads the project, your Solution Explorer will have this content:


 


I'm going to explain what each folder is for:

* Additions: allows you to add C# arbitrarily to the generated classes before they are compiled. This can be helpful for providing convenience and extra functionality like new methods to have pure C# classes.
* Jars: this is the jar files in which the bindings should be generated.
* Transforms: usually, you will need to access to the transform files after the bindings project reads out all the information from the jar; so you've got to use these files to modify the library before it becomes an assembly. The reasons to interact with these files are:

               - To fix issues with the binding (very common)


               - To customize the API design by changing names or types, by removing unused pieces, etc.


Now, start by adding the Jar file into Jars folders. In this case we want to create link of this native code to C#, so in Properties Window you need to make sure to change Build Action to EmbeddedJar. If the Jar is only a dependency of another one and you don´t necessarily need to link the code, you'll set EmbeddedReferenceJar (although this is not case).


After doing that, if you build the project (F8) you'll receive 12 errors. But don't worry, this is a typical process when you're binding a native library.


 


As I previously pointed out, you'll touch the Transform files to fix binding issues.


Unfortunately, in the Xamarin documentation there is not too much information about how to fix these kind of errors.


I strongly recommend that you use a reflection/decompiler program like JD-GUI to inspect which objects are causing trouble, then load the jar assembly.


The first thing you will see is the namespaces composed. Let's start by detecting and fixing those errors.

1.  The type or namespace 'IUserAuthentication' does not exist in the namespace (Org.Jivesoftware.Smack)

Let's use reflection and navigate until that we get to that namespace.


 


Did you realize that there is no IUserAuthentication interface? That’s because C# linking uses conventions for the interfaces by adding the letter “I” at the beginning. So we need to specify in Metadata.xml file which is the correct name of the interface.

public

Note that you have to specify the original name of the assembly. Sometimes you can deduce it but in another time wouldn’t work that way. 

2. Inconsistent accessibility: base class 'Org.Jivesoftware.Smack.Util.Collections.AbstractHashedMap.EntrySet' is less accessible than class 'Org.Jivesoftware.Smack.Util.Collections.AbstractReferenceMap.ReferenceEntrySet'

When we talk about accessibility, we refer to modifiers. Change these classes to visibility public

    public-->    public    public    public    public    public    public

3. Now, if we build the solution we're going to receive more errors.


We might continue solving these errors. But as you notice, more errors are appearing than we are fixing. You could end up fixing more than 1000 issues. “Hey Xamarin, are you out of your mind?” maybe if you read very well the purposes of Transforms folders, I add this one: To customize the API design by changing names or types, by removing unused pieces, etc.


So I recommend just using those API’s or functions you do need in your project. So you can omit removing namespaces in the binding library and of course they will be there but you cannot access them.


Reviewing the documentation of the library in the project, we really need the namespace org.jivesoftware.smack to create a socket communication for the chat. Then, we can remove the namespace that we do not need.

                                                        

4. Now, we build again


We only see only one error inside of the namespace we're interested in.


'Org.Xmlpull.Mxp1.MXParser' does not implement interface member 'Org.XmlPull.V1.IXmlPullParser.EventType'. 'Org.Xmlpull.Mxp1.MXParser.EventType' cannot implement 'Org.XmlPull.V1.IXmlPullParser.EventType' because it does not have the matching return type of 'Org.XmlPull.V1.XmlPullParserNode'.

        Org.XmlPull.V1.XmlPullParserNode     

5. At the end, we will get more errors but just a few of them. The result is this.


Now, build the project and you’re ready to consume the data on an Android Project.


Create your target project to consume the assembly and tap contextual menu on Referencesfolder. Click Edit References and check it.


 


Now, try to access one class of the assembly in the activity.


 


You’ll see it is available to utilize the logic into your target project.


I know it can get tedious to see so many errors the first time. But at the end it is more reliable by utilizing third party libraries which use standards and have been tested by many users or when there's no .NET assembly to consume directly in your project.


Happy Decompiling :)


Oscar Fimbres is a Computer Science student. He has been involved in ASP.NET MVC and Windows RT projects. He currently works as Xamarin Mobile Developer at iTexico. Also he is a Microsoft Student Partner since 2011 spreading the word about Microsoft Technologies.


Contact Us


View the original article here

Demo Mobile App: An Inside Look at iOS 7's New Features

As part of the iOS 7 webinar which was held on October 9th 2013, I decided to create a quick demo showing some of the most interesting features in iOS 7. However due to time constraints, I only picked the top three features and wrapped them up in a demo app.


So let's dig deeper into UIKit Dynamics, SpriteKit and Text Kit.


 


This demo mobile app, called "Featurama", was created using the standard Xcode template for a single view project. All Mobile apps in Xcode now use Storyboards rather than individual xib files (Interface Builder files). There are pros and cons to this approach but in general I think it's just a matter of getting used to.


But first, you can find the project on GitHub. Just click here.


The project is divided into 4 controllers:


- MainViewController: This contains the menu to go to different sections?


- DynamicsController: This shows the UIKit Dynamics Section?


- SpriteKitController: This shows the SpriteKit section (it also contains a scene class and 2 particle system files)


- TextKitController: This shows the Text Kit section


Let's take a look at each of these:


UIKit Dynamics


This section consists of a square which is dropped from some part of the screen and starts falling down towards the bottom of the screen since it's affected by gravity.


In the middle of the screen, there is a gray bar. When the square touches the upper surface of this bar, it collides and the physics engine kicks in.


The way this behavior is achieved is by adding behaviors to the all of those objects. For instance, this is the code for the square:


We first create a UIDynamicsAnimator [1], which basically is the engine that handles all the things that have to do with the physics engine. A UIGravityBehavior is then created which is added to the animator.  Now, we can tell the scene that we have some gravity.


Next, we add a UICollisionBehavior to the mBox object [2], which is an instance of UIView. Again, this behavior is added to the animator. Since all UI elements are essentially UIView's, you can apply the same behavior to a button or label or any other UI element.


Finally, we add a UIDynamicItemBehavior [3] to the animator. This tells the animator how a certain object should behave. In this case we tell the animator that the mBox object should be very elastic and have a low density.


It may look like a lot of coding but the good thing is that it's really not that complicated. It's just a matter of adding behaviors to an object and then telling the animator about this behavior.


Now you may ask: how do we handle collisions? That is easy. You set yourself as the collisionDelegate of a behavior and implement the following method:


As an addition, when you tap the box, a force gets applied and the code for that is:

[mDynamicItemBehaviour addAngularVelocity:M_PI forItem:mBox];[mDynamicItemBehaviour addLinearVelocity:CGPointMake(0, 1000.0) forItem:mBox];

Granted, this demo is probably not going win any awards for great usage of UIKit Dynamics. But it serves as an example of what you can do with it. I'm sure you can come up with some interesting concepts to use this feature and make your UI more dynamic and natural.


 


SpriteKit


The concept of SpriteKit as a framework is not new. We already have a framework called Cocos2D, which is also a 2D game engine and has very similar features as SpriteKit.


However, by using SpriteKit you are certain that your iOS7 mobile app runs well across on all iOS devices. It also has some features that are difficult to do with Cocos2D, for example playing back video in your game.


To start with SpriteKit, you will need to understand the difference between SKScene's and SKNode's.


A SKScene is, as the name implies, a scene. In gaming terms it can be your intro scene, options scene, game over scene, etc.


Inside this scene, you load SKNode's or rather subclasses of SKNode's, which are drawn into the scene. For example, it can be a button, text, or a particle system.


Scenes can have transitions and animations during the switch between one scene to another. Loading a scene is simple: create it and present it.

mSpriteScene = [[SpriteKitScene alloc] initWithSize:mSpriteView.frame.size];[mSpriteView presentScene:mSpriteScene];

Inside the scene is where the magic happens. Here, you create subclasses of SKNode's depending on what you want to show. For instance in the following code example, a particle node is created and attached to a path node, which represents a circle. 


you can see that we also apply a physicsBody to the node. This is because we want the ball to be affected by gravity and all kind of physical behaviors.


 


Note that the first 4 lines are all about particles. We load a file created by the built in particle editor into our app and set some properties.


 


Text Kit


Before we go into the code let's talk about how Text Kit handles the text.


All text in a document is stored in an NSTextStorage, which can then have one or many NSLayoutManagers. Then you create a UITextView which by itself has an NSTextContainer.


Sounds complicated? It's really not. Just keep the following in mind: UITextView NSTextContainer NSLayoutManager NSTextStorage


An NSTextStorage can have many NSLayoutManagers


Let's look at some of this mobile app code:


From now on it's just a matter of creating a text container and attaching it to the text view. For example, you could do something like this:


Once you have everything set up, you can start having fun. In the following code example, text styles are applied to certain words.


You can get pretty radical with this by doing all kinds of text transformations. However for this demo we just changed the fonts :)


and add some properties to it. Then, you make a UIFont which is added to an attributes dictionary. This dictionary is added to the text storage as you can see in the loops at the end of the code.


The result is this:


 


Notice, we used "preferredFontDescriptorWithTextStyle". This is to make sure we support the Dynamic type feature and apply the text size to whatever the user has chosen.


There is much more to the code than what I just talked about. So, I encourage you to download the project and take a look for yourself. Play with it, modify it, but above all, let it inspire you so that can see what features you can add to your app to make it even more impressive.


Now if you’ll excuse me, I'll go back to having some fun coding more mobile apps for iOS 7... Cheers!


About the Webinar


iTexico hosted a live webinar on October 9th 2013 "Top iOS7 Enhancements keeping your Mobile App Relevant & Usable" where I along with Abhijeet Pradhan (Chief Technology Officer) and David Sandoval (UI/UX Project Manager) talked about why iOS 7 is so important for mobile app developers, mobile designers and the enterprise. Of course, the SDK changes used  in Featurama were part of the demo! If you want to learn more about what was discussed during the iOS 7 webinar, check out the full presentation by clicking on the link below:


Jesus De Meyer has a Bachelors degree in Multimedia and Communication Technology from the PIH University in Kortrijk, Belgium.  He has 15 years of experience developing software applications for Mac and more than 5 years in iOS mobile app development. He currently works at iTexico as an iOS Mobile App Developer and in his spare time he works on his own mobile apps. 


Contact Us


View the original article here

How to Create a Database Mobile App with SQLite and Xamarin Studio

When we work on mobile app development, it is just a matter of time when we face the need for data storage; information that can be the backbone for the mobile app to just a single data such as the score for a game.


Nowdays every mobile app with minimum data storage needs to use a database. Since the mobile devices do not offer the same memory and processing capacity as a computer, we need to use specially designed systems for those environments.


So I will guide you in this basic tutorial on how to create a database for your mobile app working with the cross-platform Xamarin studio, which is a great tool for this example. 


What is SQLite?


SQLite is a database engine, compatible with ACID. Unlike client-server systems, SQLite is linked to the mobile app by becoming part of it. Every operation is performed within the mobile app through calls and methods provided by the SQLite library which is written in C and has a relatively smaller size.


Create a new Android mobile application solution in Xamarin Studio


If you don't have Xamarin Studio, don't worry. You can download it here: Xamarin Studio


Database class


1. Right click project BD_Demo --> Add --> New File… --> Android Class (Database)


Database class is for handling SQLiteDatabase object. We are now going to create objects and methods for handling CRUD (Create, Read, Update and Delete) operations in a database table. Here is the code: 

//Required assemblies
using Android.Database.Sqlite;
using System.IO;

namespace BD_Demo
{
    class Database
    {
        //SQLiteDatabase object for database handling
        private SQLiteDatabase sqldb;
        //String for Query handling
        private string sqldb_query;
        //String for Message handling
        private string sqldb_message;
        //Bool to check for database availability
        private bool sqldb_available;
        //Zero argument constructor, initializes a new instance of Database class
        public Database()
        {
            sqldb_message = "";
            sqldb_available = false;
        }
        //One argument constructor, initializes a new instance of Database class with database name parameter
        public Database(string sqldb_name)
        {
            try
            {
                sqldb_message = "";
                sqldb_available = false;
                CreateDatabase(sqldb_name);
            }
            catch (SQLiteException ex) 
            {
                sqldb_message = ex.Message;
            }
        }
        //Gets or sets value depending on database availability
        public bool DatabaseAvailable
        {
            get{ return sqldb_available; }
            set{ sqldb_available = value; }
        }
        //Gets or sets the value for message handling
        public string Message
        {
            get{ return sqldb_message; }
            set{ sqldb_message = value; }
        }
        //Creates a new database which name is given by the parameter
        public void CreateDatabase(string sqldb_name)
        {
            try
            {
                sqldb_message = "";
                string sqldb_location = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                string sqldb_path = Path.Combine(sqldb_location, sqldb_name);
                bool sqldb_exists = File.Exists(sqldb_path);
                if(!sqldb_exists)
                {
                    sqldb = SQLiteDatabase.OpenOrCreateDatabase(sqldb_path,null);
                    sqldb_query = "CREATE TABLE IF NOT EXISTS MyTable (_id INTEGER PRIMARY KEY AUTOINCREMENT, Name VARCHAR, LastName VARCHAR, Age INT);";
                    sqldb.ExecSQL(sqldb_query);
                    sqldb_message = "Database: " + sqldb_name + " created";
                }
                else
                {
                    sqldb = SQLiteDatabase.OpenDatabase(sqldb_path, null, DatabaseOpenFlags.OpenReadwrite);
                    sqldb_message = "Database: " + sqldb_name + " opened";
                }
                sqldb_available=true;
            }
            catch(SQLiteException ex) 
            {
                sqldb_message = ex.Message;
            }
        }
        //Adds a new record with the given parameters
        public void AddRecord(string sName, string sLastName, int iAge)
        {
            try
            {
                sqldb_query = "INSERT INTO MyTable (Name, LastName, Age) VALUES ('" + sName + "','" + sLastName + "'," + iAge + ");";
                sqldb.ExecSQL(sqldb_query);
                sqldb_message = "Record saved";
            }
            catch(SQLiteException ex) 
            {
                sqldb_message = ex.Message;
            }
        }
        //Updates an existing record with the given parameters depending on id parameter
        public void UpdateRecord(int iId, string sName, string sLastName, int iAge)
        {
            try
            {
                sqldb_query="UPDATE MyTable SET Name ='" + sName + "', LastName ='" + sLastName + "', Age ='" + iAge + "' WHERE _id ='" + iId + "';";
                sqldb.ExecSQL(sqldb_query);
                sqldb_message = "Record " + iId + " updated";
            }
            catch(SQLiteException ex)
            {
                sqldb_message = ex.Message;
            }
        }
        //Deletes the record associated to id parameter
        public void DeleteRecord(int iId)
        {
            try
            {
                sqldb_query = "DELETE FROM MyTable WHERE _id ='" + iId + "';";
                sqldb.ExecSQL(sqldb_query);
                sqldb_message = "Record " + iId + " deleted";
            }
            catch(SQLiteException ex) 
            {
                sqldb_message = ex.Message;
            }
        }
        //Searches a record and returns an Android.Database.ICursor cursor
        //Shows all the records from the table
        public Android.Database.ICursor GetRecordCursor()
        {
            Android.Database.ICursor sqldb_cursor = null;
            try
            {
                sqldb_query = "SELECT*FROM MyTable;";
                sqldb_cursor = sqldb.RawQuery(sqldb_query, null);
                if(!(sqldb_cursor != null))
                {
                    sqldb_message = "Record not found";
                }
            }
            catch(SQLiteException ex) 
            {
                sqldb_message = ex.Message;
            }
            return sqldb_cursor;
        }
        //Searches a record and returns an Android.Database.ICursor cursor
        //Shows records according to search criteria
        public Android.Database.ICursor GetRecordCursor(string sColumn, string sValue)
        {
            Android.Database.ICursor sqldb_cursor = null;
            try
            {
                sqldb_query = "SELECT*FROM MyTable WHERE " + sColumn + " LIKE '" + sValue + "%';";
                sqldb_cursor = sqldb.RawQuery(sqldb_query, null);
                if(!(sqldb_cursor != null))
                {
                    sqldb_message = "Record not found";
                }
            }
            catch(SQLiteException ex) 
            {
                sqldb_message = ex.Message;
            }
            return sqldb_cursor;
        }
    }
}


Records Layout


2. Expand Resources Folder on Solution Pad


    a) Right click Layout Folder --> Add --> New File… --> Android Layout (record_view)


We need a layout for each item we are going to add to our database table. We do not need to define a layout for every item and this same layout can be re-used as many times as the items we have.



    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
            android:text="ID"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/Id_row"
        android:layout_weight="1"
        android:gravity="center"
        android:textSize="15dp"
        android:textColor="#ffffffff"
        android:textStyle="bold" />
            android:text="Name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/Name_row"
        android:layout_weight="1"
        android:textSize="15dp"
        android:textColor="#ffffffff"
        android:textStyle="bold" />
            android:text="LastName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/LastName_row"
        android:layout_weight="1"
        android:textSize="15dp"
        android:textStyle="bold"
        android:textColor="#ffffffff" />
            android:text="Age"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/Age_row"
        android:layout_weight="1"
        android:textSize="15dp"
        android:textStyle="bold"
        android:textColor="#ffffffff"
        android:gravity="center" />


Main Layout


3. Expand Resources folder on Solution Pad --> Expand Layout folder


    a) Double Click Main layout (Main.axml)


Xamarin automatically makes Form Widgets's IDs available by referencing Resorce.Id class.


 


Note: I highly recommended putting images into Drawable folder.


-Expand Resources Folder


  ~Right Click Drawable folder --> Add --> Add Files…


    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
            android:orientation="horizontal"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#ff004150">
                    android:text="Name"
            android:gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:textSize="20dp"
            android:textStyle="bold"
            android:textColor="#ffffffff" />
                    android:text="Last Name"
            android:gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:textSize="20dp"
            android:textColor="#ffffffff"
            android:textStyle="bold" />
                    android:text="Age"
            android:gravity="center"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:textSize="20dp"
            android:textStyle="bold"
            android:textColor="#ffffffff" />
    
            android:orientation="horizontal"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#ff004185">
                    android:inputType="textPersonName"
            android:id="@+id/txtName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
                    android:id="@+id/txtLastName"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
                    android:inputType="number"
            android:id="@+id/txtAge"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1" />
    
            android:orientation="horizontal"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="10dp"
        android:background="#ff004185"
        android:gravity="center">
                    android:layout_width="50dp"
            android:paddingLeft="10dp"
            android:layout_height="50dp"
            android:background="@drawable/add"
            android:id="@+id/imgAdd"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="10dp" />
                    android:layout_width="50dp"
            android:paddingLeft="10dp"
            android:layout_height="50dp"
            android:background="@drawable/save"
            android:id="@+id/imgEdit"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp" />
                    android:layout_width="50dp"
            android:paddingLeft="10dp"
            android:layout_height="50dp"
            android:background="@drawable/delete"
            android:id="@+id/imgDelete"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp" />
                    android:layout_width="50dp"
            android:paddingLeft="10dp"
            android:layout_height="50dp"
            android:background="@drawable/search"
            android:id="@+id/imgSearch"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp" />
    
            android:text="Message"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/shMsg"
        android:background="#ff004185"
        android:textColor="#ffffffff"
        android:textStyle="bold"
        android:textSize="15dp"
        android:gravity="center" />
            android:orientation="horizontal"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:paddingLeft="10dp"
        android:background="#ff004150"
        android:gravity="center">
                    android:text="ID"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@android:color/white"
            android:textSize="20dp"
            android:layout_weight="1"
            android:gravity="center"
            android:id="@+id/id" />
                    android:text="Name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@android:color/white"
            android:gravity="center"
            android:textSize="20dp"
            android:layout_weight="1"
            android:id="@+id/name" />
                    android:text="Last Name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@android:color/white"
            android:layout_weight="1"
            android:gravity="center"
            android:textSize="20dp"
            android:id="@+id/last" />
                    android:text="Age"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="@android:color/white"
            android:layout_weight="1"
            android:textSize="20dp"
            android:gravity="center"
            android:id="@+id/age" />
    
            android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:paddingLeft="10dp"
        android:id="@+id/listItems" />

Main Activity class


4. Double Click Main Activity (MainActivity.cs)


We have to get object instances from main layout and provide them with an event. Main events will be Add, Edit, Delete and Search for the image buttons we have defined. We have to populate our ListView object with the data stored in the database or create a new one in case it does not exist.

namespace BD_Demo
{
    //Main activity for app launching
    [Activity (Label = "BD_Demo", MainLauncher = true)]
    public class MainActivity : Activity
    {
        //Database class new object
        Database sqldb;
        //Name, LastName and Age EditText objects for data input
        EditText txtName, txtAge, txtLastName;
        //Message TextView object for displaying data
        TextView shMsg;
        //Add, Edit, Delete and Search ImageButton objects for events handling
        ImageButton imgAdd, imgEdit, imgDelete, imgSearch;
        //ListView object for displaying data from database
        ListView listItems;
        //Launches the Create event for app
        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);
            //Set our Main layout as default view
            SetContentView (Resource.Layout.Main);
            //Initializes new Database class object
            sqldb = new Database("person_db");
            //Gets ImageButton object instances
            imgAdd = FindViewById (Resource.Id.imgAdd);
            imgDelete = FindViewById (Resource.Id.imgDelete);
            imgEdit = FindViewById (Resource.Id.imgEdit);
            imgSearch = FindViewById (Resource.Id.imgSearch);
            //Gets EditText object instances
            txtAge = FindViewById (Resource.Id.txtAge);
            txtLastName = FindViewById (Resource.Id.txtLastName);
            txtName = FindViewById (Resource.Id.txtName);
            //Gets TextView object instances
            shMsg = FindViewById (Resource.Id.shMsg);
            //Gets ListView object instance
            listItems = FindViewById (Resource.Id.listItems);
            //Sets Database class message property to shMsg TextView instance
            shMsg.Text = sqldb.Message;
            //Creates ImageButton click event for imgAdd, imgEdit, imgDelete and imgSearch
            imgAdd.Click += delegate {
                //Calls function AddRecord for adding a new record
                sqldb.AddRecord (txtName.Text, txtLastName.Text, int.Parse (txtAge.Text));
                shMsg.Text = sqldb.Message;
                txtName.Text = txtAge.Text = txtLastName.Text = "";
                GetCursorView();
            };

            imgEdit.Click += delegate {
                int iId = int.Parse(shMsg.Text);
                //Calls UpdateRecord function for updating an existing record
                sqldb.UpdateRecord (iId, txtName.Text, txtLastName.Text, int.Parse (txtAge.Text));
                shMsg.Text = sqldb.Message;
                txtName.Text = txtAge.Text = txtLastName.Text = "";
                GetCursorView();
            };


            imgDelete.Click += delegate {
                int iId = int.Parse(shMsg.Text);
                //Calls DeleteRecord function for deleting the record associated to id parameter
                sqldb.DeleteRecord (iId);
                shMsg.Text = sqldb.Message;
                txtName.Text = txtAge.Text = txtLastName.Text = "";
                GetCursorView();
            };


            imgSearch.Click += delegate {
                //Calls GetCursorView function for searching all records or single record according to search criteria
                string sqldb_column = "";
                if (txtName.Text.Trim () != "") 
                {
                    sqldb_column = "Name";
                    GetCursorView (sqldb_column, txtName.Text.Trim ());
                } else
                    if (txtLastName.Text.Trim () != "") 
                {
                    sqldb_column = "LastName";
                    GetCursorView (sqldb_column, txtLastName.Text.Trim ());
                } else
                    if (txtAge.Text.Trim () != "") 
                {
                    sqldb_column = "Age";
                    GetCursorView (sqldb_column, txtAge.Text.Trim ());
                } else 
                {
                    GetCursorView ();
                    sqldb_column = "All";
                }
                shMsg.Text = "Search " + sqldb_column + ".";
            };
            //Add ItemClick event handler to ListView instance
            listItems.ItemClick += new EventHandler (item_Clicked);
        }
        //Launched when a ListView item is clicked
        void item_Clicked (object sender, AdapterView.ItemClickEventArgs e)
        {
            //Gets TextView object instance from record_view layout
            TextView shId = e.View.FindViewById (Resource.Id.Id_row);
            TextView shName = e.View.FindViewById (Resource.Id.Name_row);
            TextView shLastName = e.View.FindViewById (Resource.Id.LastName_row);
            TextView shAge = e.View.FindViewById (Resource.Id.Age_row);
            //Reads values and sets to EditText object instances
            txtName.Text = shName.Text;
            txtLastName.Text = shLastName.Text;
            txtAge.Text = shAge.Text;
            //Displays messages for CRUD operations
            shMsg.Text = shId.Text;
        }
        //Gets the cursor view to show all records
        void GetCursorView()
        {
            Android.Database.ICursor sqldb_cursor = sqldb.GetRecordCursor ();
            if (sqldb_cursor != null) 
            {
                sqldb_cursor.MoveToFirst ();
                string[] from = new string[] {"_id","Name","LastName","Age" };
                int[] to = new int[] {
                    Resource.Id.Id_row,
                    Resource.Id.Name_row,
                    Resource.Id.LastName_row,
                    Resource.Id.Age_row
                };
                //Creates a SimplecursorAdapter for ListView object
                SimpleCursorAdapter sqldb_adapter = new SimpleCursorAdapter (this, Resource.Layout.record_view, sqldb_cursor, from, to);
                listItems.Adapter = sqldb_adapter;
            } 
            else 
            {
                shMsg.Text = sqldb.Message;
            }
        }
        //Gets the cursor view to show records according to search criteria
        void GetCursorView (string sqldb_column, string sqldb_value)
        {
            Android.Database.ICursor sqldb_cursor = sqldb.GetRecordCursor (sqldb_column, sqldb_value);


            if (sqldb_cursor != null) 
            {
                sqldb_cursor.MoveToFirst ();
                string[] from = new string[] {"_id","Name","LastName","Age" };
                int[] to = new int[] 
                {
                    Resource.Id.Id_row,
                    Resource.Id.Name_row,
                    Resource.Id.LastName_row,
                    Resource.Id.Age_row
                };
                SimpleCursorAdapter sqldb_adapter = new SimpleCursorAdapter (this, Resource.Layout.record_view, sqldb_cursor, from, to);
                listItems.Adapter = sqldb_adapter;
            } 
            else 
            {
                shMsg.Text = sqldb.Message;
            }
        }
    }
}


5. Build solution and run


 


Ok, so that's it for today! I hope that this tutorial has been useful. Feel free to make any questions, complaints, suggestions or comments.


Happy coding!


Francisco Nieves is a current Computer Systems Engineering student with more than 2 years of experience in .NET development. He currently works at iTexico as a Xamarin Mobile Developer for mobile app development projects.


Contact Us


View the original article here

iTexico Top 5 Mobile Development Stories. November 2013 Edition

The end of 2013 is near and looking back we’ve had some great announcements and releases during the whole year. From Apple we saw the announcements of the new mobile operating system iOS 7 and its new user interface, the much expected iPhone 5S, the super light iPad Air, among other things. In the other hand, Google kept Android app developers very busy as well with things like the Nexus series for tablets and phones, the announcement of Android 4.4 Kit Kat and Samsung releasing the newest versions of its smartphones.



Wearable Tech was very trendy too with all those smartwatches making the news such as the Pebble, Samsung Galaxy Gear, even an ongoing rumor about the "iWatch" and, of course, the controversial Google Glass that has captured the attention of many users and early adopters having fun with it.


So as you seen, lots of things going on. But what is left for the last quarter of 2013? Well here are the latest stories in the industry, let's start.


There were a lot of rumors and videos about the flexible OLED attempting to make a trend in the future of smartphones. Now LG announces the first “real” curved smartphone, which includes all the promised features of a curved smartphone such as unlocking the device and taking a quick look to see messages.


The new LG G Flex smartphone’s main feature is not only the curved screen but also that it is the first “self-healing smartphone” That’s right, it heals from scratches, kind of.


In the link you can see a YouTube video where device is put through a test, from a scratch with the keys to a cut with a knife! The results are amazing and makes you wonder how many things can be built with that kind of material.


Peter Traeg, of Smashing Magazine, brings us a series of tutorials to build mobile applications in four different ways: Native iOS, Native Android, PhoneGap and Appcelerator Titanium. In this first part he discusses the Native iOS development.


As an excellent opportunity to broaden your scope as a mobile developer, as the author says, it’s not about converting into a particularly technology but to provide some insight into how applications are created in different technologies.


In this segment you can see the basics of iOS development and how a project is created in XCode, Storyboards, objective C test and more.


Now you can have the blueprints for a do-it-yourself phone where all software and hardware details are provided through GitHub.


The cellphone is a basic GMS service where you can make calls, send text messages, store names and it can be made by you in many variants. An interesting hobby for those who are into the technology and can help younger generations to understand the functionality of the common day objects.  Just like solving math problems and computer language coding, it helps young eager minds solve complex problems.


You can find the complete project, owned by David A. Mellis, order parts, software and instructions on his webpage to create a cellphone that is completely made by you.


2014 is just around the corner and we had a lot of news buzzing this year.  In the beginning of this year we talked about curved phones, Apple releasing TouchID, the growing adoption of smart TVs, the release of Xbox one and so on. As you can see the trends were very different at the beginning of 2013. So what can we expect from the upcoming year??


Jayson DeMers from Forbes.com explains the most possible trends for next year. Smart TV as a basic device for the families and upgraded interaction with smartphones are just a few. Smart watches and other smart gears will get smarter indeed. A forecast about google glasses is waiting on standby with the release of the version 2.0 and more.


Let’s not forget that Amazon is attempting to make delivery by using drones and the growing community of 3D printing. More and more start up projects are arising and, I don’t know about you, but I’m excited to see what is coming in the near future.


With the surprise announcement of the new Android OS’s name and its promised new features, the Android community is impatient to get the new update on their phones. The new features has been appearing slowly on the web and until the official release date is announced we can do nothing but wait eagerly.


Google Nexus 5 will come with Android 4.4, while Samsung Galaxy S4 and HTC One will be available for upgrades. More devices will be announced. Meanwhile see a preview of the top features for Android Kit Kat by IBNLive.

Alfonso Banuelos is a Marketing Associate at iTexico. He holds a Bachelor in Marketing and a Diploma in Marketing and Sales Strategies by the University of Guadalajara. Additionally, he is one of the main voices driving iTexico's Social Media updates and communications.

Contact Us

View the original article here

HR Perspective: Technical Interviews for Mobile App & Web Developers

When someone is looking for a job, there are some objectives that he or she is looking for besides a good salary. In IT, the job demands a lot of time to solve problems on a normal basis. That can sometimes be very stressful. How do the developers survive the excess work load and still stick around? Well, that's why we have an organizational culture. So, what is an organizational culture?  How you can implement it in your interviews as a recruiter?


 


Organizational Culture


Organizational culture is a set of perceptions, feelings, attitudes, habits, beliefs and ways to interact between coworkers (Gross, 2008). In human resources, we're always looking for ways to improve the workplace to have a better work environment. For example, our organizational culture promotes these six values: exceed expectations, professionalism, teamwork, integrity, fun, and learn & adapt.


HR looks for developers who are compatible with our organizational culture. Therefore, we all need to reflect this process in our interviews.  For this objective, the tech advisors, marketing and human resources worked on a new process for the “Technical Interviews”, which includes the following:

Manual of technical skillsInform all software developers about the Company's benefitsInform about new customersPhases of the Technical InterviewBest Practices for Technical Interviewers

This new process reflects our organizational culture and the manual of technical skills contain the best programming practices that all developers must have. The new phases of the technical interview reflect our values: exceeds expectations, professionalism, teamwork, integrity, fun and learn & adapt.


This process helps us to find the best developer that the company needs.  We have many types of candidates who apply.  They could be arrogant, reserved, outgoing, friendly or shy. However, most of the candidates become very nervous about the technical interviews.  Sometimes, they don't show their full potential because they are just too nervous. They could think why they are  not good enough for this position?. It's not about all the years of experience that a developer has, but it  is about what they have done during those years. We could have candidates with many years of experience and they haven't done anything relevant, or we could have candidates with a few years of experience and maybe they have the experience developing many amazing things.


We mainly look for good developers who are passionate about computers and app or mobile development, and who are looking to learn new mobile and web technologies. They should make the development focused on giving the end users more friendly, dynamic and intuitive experience. iTexico’s developers like to work with faster, easier, and cleaner code. They are owners of their projects and they interact amicably with their customers.


Now, I'm going to give some tips to the interviewers about the process that we use at iTexico. I have asked several candidates about their experience with iTexico and other companies. Here is a list of things that they are looking for in an interview:

The interviewer has to evaluate more of the engineering skills than the theoretical part.SincerityThe interviewer has to be polite.The interviewer has tested my logical thinking.The interviewer makes me feel comfortable.The interviewer responds to my answers nicely.The interviewer has fun.The interviewer makes me feel important.The interviewer thanks me for the time that I spent on the interview.They communicate the requirements of the position and the work environment.The interview has been entertaining.

Do you have all these points mentioned above during the interviews? I encourage to do so and enjoy the interview process. It's always fun to talk to other developers and learn new things about other people. You are part of a great company, and you are helping to make that company bigger and a fun place to work! Remember, it's all about the people.


Karina Alejandra Villaseñor is an Industrial Relations specialist with more than 2 years of experience as a recruiter. She currently works as IT Recruiter at iTexico. You can contact her through LinkedIn.


Contact Us


View the original article here

Web and Mobile UI Design: Top Photoshop Tricks, Fast and Easy!

When comes about designing a web application or mobile application user interface, it can get very messy once you start to work with a large number of objects and layers, however there are some tips that can come in very handy and master your skills as a Photoshop ninja. Lets take a look at some of these that have helped me during my web and mobile app design projects.


 


Most of us have problems in selecting a lot of objects together. What we usually do is click one by one on an object (holding shift, control or the command key) and most of the times we are not able to select all the objects and it also takes up a lot of time.


Let’s see how we can easily select more objects in this step by step exercise.


First of all let’s try using and drag over all the items that you need to select.


 


As we can see in image above, after selecting the particular text and images, the layers are also selected in the layer tab (on the right side of screen).


 


Select just the text and avoid the other objects, using the feature in new Photoshop for text, shapes, images etc.


 If you think you selected extra items, just press shift and click on that item to de-select


In Photoshop when you're dragging an element from one file to another and usually when dropping it, the elements on the canvas are not in the same position as they were on the other file. So what you want to do is keep the same position in pixels for maintaining the grid of your design.  This is particularly difficult when you are designing a mobile app or making mockups of a web design.


Let’s see how we can do achieve that in this step by step exercise. 


 


We can select the layers and all folders and then right click on that. There we can find one option called duplicate (folder or layer) depending on if we selected the layer or the folder. When we select the duplicate option, a window appears on our screen with some features.


One option on that window is to duplicate that selected folder or layer in to another open Photoshop document and the second option is to open it in a new document.


 


The important feature of this option is when you duplicate any layer or folder, its goes to another document or new document in the same exact place.  This helps us to make constant designs for web and mobile app.


How to control opacity and fill color of layers in an easy way


To control the opacity in a fast and an easy way you just need press the button from number 1 to 0 and to control the fill color of an object just press shift + number (1 to 0)


How to select your locked layer


An easy shortcut to select a locked layer within your document when the object you're trying to select is a shape object is to do the following: Select the white pointer tool (A) and then click on the locked object that you're trying to select. You will notice than when it's a shape object, the white select tool will activate the shape object as if it was not locked.


Rishwan Muneer Butt is an UX/UI Designer with 4 years of experience working in electronic media, print, web, desktop and mobile applications. He holds a degree in graphic design from Karachi University, Pakistan. He currently works as a UI/UX Designer at iTexico for web and mobile applications.


View the original article here

Xamarin Mobile App Development. Training App Developers in Mexico!

C# (C Sharp) is a programming language that has been around for more than a decade and is already the foundation for so many products and software used by every one of us on a daily basis. Microsoft created this simple, yet elegant language as a part of their .NET initiative a while back and it has grown to become immensely popular within the developer community and has taken desktop app development industry by a storm.

However, we live in an era where mobile computing and user experience is king and where consumers have a massive set of alternatives to chose from when it comes to mobile applications.  In a world where the paradigm of desktop apps no longer apply to reality, how can C# and .NET developers leverage their existing knowledge and experience? Meet Xamarin, a way to build native mobile applications using C# and .NET capabilities.


Since the introduction of the modern smartphone and the mobile application ecosystem, developers have created dazzling applications using a wide variety of programming languages.  They are using native ones like Objective C for iOS or Java for Android, or using cross-platform development tools and platforms to create native mobile applications. If there is one thing that C# has not been a major player in until very recently, it is in mobile app development. Enter Xamarin, a cross-platform technology built by the makers or Mono and aimed to create fully native mobile applications using one of the most popular language of all time: C#.

Xamarin basically allows developers take advantage of powerful language features like Linq, Lambda expressions, Async programming, reflection and dependency injection as well as many other great things like:

- Reuse existing C# code from existing applications.

- Use Visual Studio as IDE with its famous extensions like Resharper.

- Native access to the platform libraries (Android, iOS).

- Code sharing between mobile apps.

- Use Xamarin components to share camera, and social networks code between platforms

- Use native libraries with bindings.

Among other things, Xamarin is a great tool to integrate the business logic of all the mobile clients in one common point as well as extend your Microsoft stack to mobile devices using your current capabilities. It also integrates current native efforts for Xamarin projects and many other possibilities for .NET developers using Xamarin. At iTexico, we are still discovering new things that we can use Xamarin for in our every day projects, I recommend check it out!

iTexico has always been looking to become partners with the most innovative leading companies in the technology industry. As a part of those efforts, Xamarin and iTexico have become close partners and worked on a variety of projects in the mobile development area. A key part of that partnership is finding the best ways to make sure that the level of expertise in the Xamarin platform is the best. This is why both iTexico and Xamarin planned a joint effort to train and engage with the developer community in Mexico, Xamarin founder’s home country and the land where iTexico’s Global Delivery Center is located.

On October 24th 2013, we were visited by the Xamarin team of  Matt Larson, Partner Manager at Xamarin and Anuj Bhatia, a Xamarin trainer. They arrived in Guadalajara where they were set up to meet and engage with the talented developer community in Mexico’s western region.

During their 3-day stay, the team at iTexico and our special guests had the opportunity to hold several events such as business lunch and learn sessions, community drink-Up and of course, Xamarin’s first official certification class in Mexico. More than 30 developers attended to a sold-out class where they had the opportunity to discuss about their experience using Xamarin, learn new topics and reinforce their existing knowledge in the platform. At the end, students were given access to the Xamarin Certified Mobile Developer certification exam. Everyone was very excited!

It was a very rewarding experience and the community really appreciated the opportunity to get trained, share their knowledge and talk about all things mobile during those days when C# became a shining light in the new era of mobile development.

If you’re interested in learning more about Xamarin or about our cross-platform mobile development services make sure to give us a shout!

- Business Lunch & Learn


- Training


- Drink Up



David Sandoval is the Marketing Manager at iTexico, entrepreneur, and UX/UI designer with more than 7 years of experience in web application and mobile app design, usability and product design. He holds a Bachelor in Information Systems and an MBA in Marketing by La Trobe University in Melbourne, Australia.


Contact Us


View the original article here

Intro Android Mobile Development: Open Source Computer Vision Library

The following information, and code example was obtained from the following from http://opencv.org/. If you are not familiar with OpenCV and want to learn more, please visit the link. All steps were made using MAC OS 10.7.4


OpenCV (Open Source Computer Vision Library) is an open source computer vision, and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products.


The library has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision, and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos, track camera movements, track moving objects, extract 3D models of objects, produce 3D point clouds from stereo cameras, stitch images together to produce a high resolution image of an entire scene, find similar images from an image database, remove red eyes from images taken using flash, follow eye movements, recognize scenery and establish markers to overlay it with augmented reality, etc. The library is used extensively in companies, research groups, and by governmental research projects.


Well-established companies like Google, Yahoo, Microsoft, Intel, IBM, Sony, Honda, Toyota use the library. There are many startups such as Applied Minds, VideoSurf, and Zeitera, that make extensive use of OpenCV. OpenCV’s deployed uses span the range from stitching streetview images together, detecting intrusions in surveillance video in Israel, monitoring mine equipment in China, helping robots navigate and pick up objects at Willow Garage, detection of swimming pool drowning accidents in Europe, running interactive art in Spain and New York, checking runways for debris in Turkey, inspecting labels on products in factories around the world on to rapid face detection in Japan.


It has C++, C, Python and Java interfaces and supports Windows, Linux, Android, and Mac OS. OpenCV leans mostly towards real-time vision.  OpenCV is written natively in C++ .  OpenCV runs on both desktop (Windows, Linux, Android, MacOS) ,and mobile (Android, Maemo,  iOS).


To start working with one example about face detection using OpenCV in Android you must already have installed, and configured Android Developer Tools, and the Android NDK.


Please visit the following link to download ADT, and NDK. Afterwards, you can continue with the next steps.


OpenCV Documentation


1) Download OpenCV for Android 2.4.6 


2)  Unzip, and import the OpenCV Library, and the OpenCV Sample – face-detection


 


3) Go to the OpenCV Sample –face-detection properties project, and go to the android section, and check if you have the OpenCV Library added.


 


4) Go to C/C++ Build section, and check the ndk-build path


 


5) Go to the Java Build Path section, and then Libraries tab. If you open the Android Dependencies, and you did not find the opencv library – 2.4.6.jar you will need to add the library manually on the add external jars button.


6) Go to the ADT menu, and then select Preferences, Android, NDK to select the path of the NDK location.


7) Open the terminal, and type the following line of code to open the bash profile, and verify you have the following paths in your bash profile.


 


9) Download to your device OpenCV Manager from Google play


8) Run OpenCV Sample – face-detection from the ADT and enjoy.


I have learned how to use the OpenCV Library with Android. It’s a good library to implement other functionalities like detect colors, shapes, to do manipulations of images, etc. What I noticed running the OpenCV Sample – face-detection is that the application is not working a 100%, but the majority of cases the application does detect faces.


The picture above is the OpenCV Sample – face-detection application running. On the right is our CEO, Anurag Kumar!


Francisco Antonio Duran is a computer science engineer. He is currently studying a master degree about Internet Technologies, and an Informatics Security specialization in the Universidad Autónoma de Guadalajara. He works as mobile developer, and mobile instructor in iTexico. 


Contact Us


View the original article here

Xamarin Mobile Development: Consuming Java Libraries from C# in Xamarin.Android - Part 1

Third-party libraries are great! They cut down on the development time significantly by allowing developers to not worry about building certain things, like a custom UI control or client service.


The Java ecosystem includes a diverse and immense collection of components. However, this isn’t a deal breaker, many of these components can be used to reduce the time it takes to develop an Android mobile application.


So I’ll introduce you an overview of some of the ways that developers can use these existing Java components to improve their Android mobile app experience with Xamarin Studio creating binding projects.


One important distinction to be made is that it may be in your best interest to convert a particular library to C# and Xamarin.Android, rather than bind it. There are certain advantages to each approach, as well as particular circumstances when each technique is particularly useful!


Binding:

-Little to no Java knowledge-Quick and straightforward-Less customization

Converting:

-Java knowledge-Tedious-More customization

Sometimes in larger libraries, things can get complicated really quickly, converting it is harder and it’s required to have an extensive knowledge of how does the library work. In these cases, it would be more convenient to focus on binding instead on converting, it can be done in little time, and especially because the process is pretty reproducible once you get it down. 


A binding is just a simply wrapper class (known as a Managed Callable Wrapper), which allows a .NET application to interop with non-.NET technology; in other words, to reproduce libraries in C# in a minimal amount of time without really any Java knowledge. In this case, it allows a Xamarin.Android mobile application to call a Java class or interface from C#. 


This technique is an automated, declarative approach to binding Java libraries. It involves using either Xamarin Studio or a Visual Studio project type that is provided by Xamarin.Android: the Java Bindings Library. You only have to include a .java and .jar code within your app. To successfully create these bindings, a Java Bindings Library may still require some manual modifications.


You need to have in mind which classes or interfaces you’ll need to use in your mobile application. Sometimes the compiler might have trouble binding it and you have to fix like thousand errors (in you plan to convert a whole complex library, of course) So my recommendation is just bind those libraries that you really need.


Maybe the owner of the library does not provide documentation of the java classes, so you can use this helpful tool called JD-GUI, which is a Java Decompiler and you can download it from here: http://bit.ly/1alkUOW


As I said lastly, to successfully binding may still require some manual modifications. For example, there’s a confliction between System.Object and Java.Lang.Object namespaces, the .NET conventions are a quite different from Java conversions (interfaces start with “i”, PascalCased members, etc.) and make public those classes, methods, field access you’re going to need.


Before getting startet imagine that you have to implement a chat using a protocol like XMPP which is only available for Java. Smack is the name of a complex Java library which implements standards of XMPP created by Ignition and is your only reliable resource on internet.


So, you can download it from here: http://bit.ly/1jqsbPt


Ok, so we are ready to start coding and see how can we make the development faster. In the next part we will create an Android Java Binding project from scratch.


Feel free to leave any coments and keep tuned for the next part!


Oscar Fimbres is a Computer Science student. He has been involved in ASP.NET MVC and Windows RT projects. He currently works as Xamarin Mobile Developer at iTexico. Also he is a Microsoft Student Partner since 2011 spreading the word about Microsoft Technologies in his student life. 


Contact Us


View the original article here

Testing Web and Mobile Apps: Rational vs Quality Center Tools

Software testing in both web and mobile app development is an essential process of the software development lifecycle. When companies that fail to implement quality control standards or define the range of test web and mobile applications, it could essentially destroy the brand name, credibility or sabotage the overall project and blowup the budget. (Winthrop Andrew, Parr 1, 2012).


 


Tests are conducted to understand the reliability and the performance of the software under extreme pressure. In the present the competition is fierce to outperform every product out in the market. With such cut throat competition, it is very crucial that one excels in tough circumstances and offers optimum service in the most difficult times. Those with poor performance and lack of competency will not be able to meet the customer demands and offer the desired results in hours of stress. (Riverstone, Parr 1-2, 2013).


Quality Center, Test tool


We will analyze the new advantages of Quality Center 11.5 and compare it with the previous version. HP is the market leader in distributing worldwide market tests and recently launched a version of HP 11 products suite that further reinforces its dominance in the market.


HP Quality Center enables users who are not part of the business process to integrate with business requirements. QC provides a formatted text editor MS Word and also helps us to share the report through the web or MS SharePoint Portals.  Agile methodology also provides integration between the outputs of the tests with user stories and tasks from an administrator’s perspective and provides tools for better maintenance through a better monitored system. QC also lowers the risk of migration by allowing multiple clients to connect to previous versions. (Market Share, All software Markets, Worldwide, 2011 - 2012).


 


Table: HP QC 11 edition

The HP Sprinter Module:   This module can improve manual testing productivity. The sprinter is fully integrated with HP ALM and allows increased benefits for these two solutions. You can make the execution of manual tests that are more effective and efficient.


Project Planning and Tracking module: This module integrates the test execution with the management of the test project.


Sprinter's Mirror Testing feature: This feature allows users to run tests in different browser environments (IE, FF, Safari, etc.), record and replay functionality tests.


So in this version, Accelerated Manual testing with HP Sprinter offers the following advantages:


- Simultaneous access to your web and mobile applications under testing (AUT).
- Running tests directly on the AUT without the inconvenience of switching between the QC screen and AUT.
- Using its toolkit for screen capture and annotation, screen recording and capturing system information.
- Leveraging its automated Data injection feature to upload pre-defined data sets along with your tests during execution and instruction.
- Recording and replaying with the Macros feature.
- Creating one test and running it in different environments.


Reference


Vijayaraghavan Kiruba, 2013, HP Quality Centre 11 – What´s new?


Winthorp Andrew, 2012, Why is important the test


Riverstone, 2013, the test 


Alberto Chavez is a QA engineer with 5+ years of experience. He likes to design test cases and set environments to test software for web and mobile applications for several client projects across many different verticals. He currently works at iTexico as a QA Engineer.


Contact Us


View the original article here

Developer's Perspective: IBM Worklight for Mobile App Development

As a mobile app developer and interested in new platforms and techniques of development, I will share with you this technology, IBM Worklight to create mobile apps:



Worklight is an open, comprehensive and advanced mobile application platform and framework used to develop HTML5, hybrid and native mobile applications.  Worklight also helps run and manage these software mobile applications.  


IBM Worklight framework is made up of these four main components:

IBM Worklight Studio.IBM Worklight Device Runtime Components.IBM Worklight Server.IBM Worklight Console.

Each one of these components allow us to manage some part of the application:

This is a plugin for Eclipse IDE that allows us to develop the code for the app.

All of these components are the SDK. This will make the code we write to work on the user's real devices.


This is the server that provides the information to the application, based on adapters’ paradigm. It gets the data access to the back-end of the app.


This is the monitor and manager of the app in its different versions and environments, adapters and push notification rules.

Provides the API that allows local JSON data storing.


An adapter is a component that is used to retrieve the data from services in the back-end server. The retrieved data by the adapter is always JSON formatted.


An adapter is composed of:

An XML file describing the back-end server information and the procedures that it performs.A JavaScript (.js) file that contains the implementation of the procedures already declared in the XML file.An XSL file, if the retrieved data from the back-end server is in XML format, the XSL file is used for the XML to JSON conversion.

The adapter can be used to make HTTP requests, execute SQL queries and more.


There are some JavaScript libraries that help with the app development.

JQuery Mobile.Dojo mobile.Sencha.

Also, the Apache Cordova Framework can help when creating mobile applications with Worklight. This framework allows the app to call native device functions from JavaScript, and even lets you create your own Cordova Plugins with Objective-C code.


Ok, let us leave the theory behind for a while…


First, you have to download and install the IDE called Eclipse.  Warning! The Worklight documentation does not demand very specific version of the IDE in every version of the eclipse.  By the time this blog is published, IBM Worklight 6 will be the latest release and it will demand Eclipse Juno v4.2.2 (SR2) or Eclipse Classic v4.2.2. You can download it the latest release here. 


The next step is to download the IBM Worklight Developer Edition Plugin from the Eclipse Marketplace. 


NOTE: You should not forget to install the SDK of each environment in which you want to deploy.


Once everything needed is correctly installed, create a new mobile app project:


Select Hybrid Application and Next:



Now, set the Application Name. If it is needed, add one of the JavaScript libraries listed:


As you can see in the screenshot, the dojo library comes with the IBM Worklight 6 Plugin.  NOTE: We will NOT add any library for this example.



Now, you can see the basic project structure

Adapters: Source code for the adapters.Apps: Source code for the apps.Server: Configuration files, libraries and Java code for the server.Components: Source code for the Shell components.

In the apps?WorklightApp?application-descriptor.xml file is where you can add environments and features to your app.  In this example, we'll add iPhone* and android environments.


*Note: iPhone or iPad, only if you have a Mac.

Select Application “WorklightApp”.Click on Add… Button.Select the environment.Click OK Button.


There are new folders under apps?WorklightApp folder, one by each environment you have added one as a common resource.


In the WorklightApp.html file that’s inside the common folder, add a button after the application UI comment:


Now inside each environment (iPhone & android folders), in the js?WorklightApp.js file, add an event listener for the click event of the button after the Environment initialization comment:

// Environment initialization code goes heredocument.getElementById("helloBtn").addEventListener('click', function(){            alert("from ");}, null);To see the results go to the Project Explorer and select your WorklightApp folder, right-click on it, select Run as option and then Build All and Deploy



Now, in your workspace you can see a new Project (an Android App Project) named WorklightExampleWorklightAppAndroid. This is the result of the deployment for Android, selecting and running it as an Android Application will compile the app and load it into an emulator or a device.



In the case of iPhone, Worklight will also create an Xcode Project for you. To open it, you must go to the iPhone environment folder inside your Worklight Project, right click on it and run it as Xcode Project, and then you can run the app from Xcode IDE.





Adalberto Gonzalez is an experienced Systems Engineer which currently works at iTexico as a Mobile Developer. Adalberto has been specializing in Worklight since early 2013 additional to the regular platforms for development.


Contact Us


View the original article here

Mobile App Development: Working With Media Files on Android (Part 2)

In the previous blog post, we presented two solutions that work with media files on the Android Mobile App platform, especially videos files. In this post, I will present a guide for merging and trimming video files using MP4parser. All source codes can be found on GitHub. 


Preliminaries


The first thing that we must do before we start programing our mobile app is to download the mp4parser libraries from the project page right here. For this example, we will need ISOViewer and ISOParser, which is provided in the URL mentioned above.


Secondly, we will need to create a new project and add the libraries to the project.  At the end, the project libraries must look like this:


Merging video files


The first code example that we will be working with is to merge video files. We must remember that working with media files types is an exhaustive job.  We must implement all our classes in a separate thread so that we can leave the main visual application unfrozen.


Let’s start with our class skeleton. Create a new class for our mobile app projet called MergeVideos extending the superclass AsycTask.  After creating the class, we can add the variables, constructor and required methods as follows:


 


As you can see our class must be initialized with 2 values, the working path folder and the list containing the video names, including the extension (e.g. video1.mp4, video2.mp4, videoN.mp4). The next step is to write the logic in charge of the video merging task. For this, we must follow the next algorithm:

1. For each video file we must create a Movie object containing all the information as video and audio tracks of such video.
2. For each video object, we must:
     a) Get every video track and stack them in a list.
     b) Get every sound track and stack them in a list.
3. Create a new Movie placeholder and add the movie and audio tracks stacked previously.
4. Write the new Movie object to disk, thus creating the new merged video.

So following the previous algorithm, the first task is performed by the following snippet:


 


Where count, is the number of videos to merge and inMovies is the array of Movie objects. The “for” loop will get all the video files references, generating the Movie objects and adding it to the array.


The next step is to read and concatenate the sound and video tracks, which is done by the following code:


 


After concatenating every video and audio track, we are ready to create the new movie placeholder for our mobile Android app using the snippet:


 


At this point, our new movie is created in a logical manner.   Now, we must write this newly created movie into the nonvolatile memory, which can be done as follows:


 


And now our newly created merged video is ready to be reproduced!


Trimming video files


The next example is how to use this library to shorten the length of a given video. Like the previous example, all of the logic code must run on a separate thread, in order to keep the activity unlocked. The class skeleton should look like this:


 


The class is initialized with mediaPath which is the complete path to the video.  The startTime, which is the start time in seconds, and length, which is the number of seconds it takes to trim the video file after the start time. In this case, all the logic is contained in the trimVideo method.   So let us start with the logic algorithm:

1. For each track in the video, get the correct start time from all the tracks, since where are using mp4 files, this is a required process in order to trim the complete video.
2. For each track in the video, crop the track with a start and end sample time and add it to a new Movie object.
3. Write the newly created movie to the disk.

Following this algorithm, the first step can be performed by the following code:


 


In this case, the snippet is using a private function called correctTimeNoTextSyncSample to get the nearest synchronized sample to our desired start time. Afterwards, we are ready to crop each track of the video and the step 2 of our algorithm can be performed as follows:


 


After getting the correct start and end time sample from current track, we are ready to crop it and add it to the final movie object. After cropping each track of the mp4 file and concatenated it, we are ready to save the Movie object to disk.  This step can be performed by:


 


And that’s it. We now have a newly cropped video created from a larger one!


Final thoughts


As mentioned in the previous post, one of the main drawbacks of this library is that it can only work with MP4 files. Luckily for us, all android devices record video files in such format, so this is a good option when working with this kind of media. However, this library does not give support to transcode and/or compress media files, which in many cases, is an important task to do before uploading media files to the cloud.  In this case our best option is to use ffmpeg which is our next topic of discussion. Till next time!


Acknowledgments


*Thanks to the mp4parser project for keeping this excellent library ().


*All codes were based on the demos provided by the library web page.


*More about the mp4 format here. 

Victor Cervantes is an Android developer with 1+ years of experience with the Android mobile platform. He has a Masters Degree in Computer Science specializing in optimization problem solving. He is an Appcelerator Titanium Certified Developer (TCD) and currently works at iTexico as an Android Developer.

Contact Us


View the original article here

Appcelerator in Mexico: Presence & Mobile Developers Expertise

iTexico is an Austin based nearshore technology company that provides businesses with full lifecycle mobile application services including architecture, experience design, mobile and web development, testing and quality assurance. iTexico complements existing teams with a delivery center in Guadalajara Mexico and on-site with specialized extended teams as a service (eTaaS). Our developers create cross-platform mobile apps using native iOS and Android technology, Appcelerator Titanium and Alloy, Xamarin and IBM Worklight. iTexico’s MobiAppCare specialists are experts at maintaining your mobile app up-to-date.


View the original article here

Tutorial - Android Mobile Development: List View and Memory Resources

Android provides us a powerful way to create lists views.  Just like Facebook or the popular Vine mobile app, Android allows us to show the posts/feeds in list view. I’ll give you a few tips that can be really useful when it comes to the memory consumption management subject for android mobile apps.


 


We are going to make some assumptions. First, we already have a layout with a list view in it: 


 


Secondly, we also have a reference to our list view in our list view activity:

ListView myListView = (ListView) findViewById(R.id.myListView);

Ok, let's create a custom layout for each row of our list view. Let's say that we want to create a list view with two text views and one check box in each row.  So in a new xml file (row.xml), I’ll add the three objects like this:


 


Now, we can start creating our list adapter which will help us manage the resources in a really optimized way to create our list view.


First of all, let's explain what the main parts of an adapter are. For this example, I will talk about the Base Adapter, which contains the followings methods:


getCount():


Return how many items are in the data set represented by this adapter.


getItem():


Get the data item associated with the specified position in the data set.


getItemId():


Get the row id associated with the specified position in the list.


getView():


Get a View that displays the data at the specified position in the data set


We need to create a new java file which extends from base adapter and will override the previous methods.


 


From our main activity, we will create a list adapter which receives an array in its constructor and that array contains the information we want to see in our list view:


As we can see in the previous image, I created a class which will manage two strings (the stadium and the football team).  In this example, I just added one stadium but you can add as many as you want. After having the array ready, I created the list adapter and set it to list view.


We can start painting the list view and here is where the optimized list view starts.


As soon as we set the adapter to the list view, the getCount method from our list adapter will be called to return the number of elements the list view has. In my example, this is how the getCount method will look:

@Override
public int getCount() {
return stadiumsList.size();
}

By doing this, we can ensure that the list view will have n-rows depending on the array size and the getView method will be called the integer getCount method returns.


Let’s see what getView method is for and how we can adapt it to be optimized. There are two things for Android which are lengthy and time consuming that we must avoid doing this too many times:

     *Inflating layouts
     *Making references to layout objects

The getView method gives us the following objects: 

public View getView(int position, View convertView, ViewGroup parent)

For this example, we will use the position and convertView objects. As the name says, the position value tells us which row is going to be painted in the list view and the convertView object gives us a recycled object that has already been painted and we can reuse or just use a null object if we didn’t already paint a row.


Here is our first hint to optimize our code.  If we get a convertView which has a recycled object, we do not need to inflate any layouts anymore.  This is an action that we must avoid doing several times. To accomplish this action, our code should look like this:


 


How will the previous code help us optimize our application? In a scenario where we can have 100+ list items to show, Android will only load the items that can fit on the screen. Let's say 6 for example, so the getView method will only be called 6 times. Each time with a convertView value as null.


When we start scrolling to see the 7th item, the getView method will be called again with a convertView value as null.  This is because we are still able to see some part of the first element of the list view and we don't have any recycled items.


The optimization starts when the 8th item is going to be painted. By this time the first element won’t be visible anymore, we are going to have a recycled layout.   We have to use this because the layout is out of bounds on the screen. The convertView for this element won't be null, so we can managed to reuse it and save time and resources by avoiding inflating a new layout.


How to make a reference to each object in my row.xml file? This is the second part we have to be careful about how we manage these references.  So let's review the following code:


 


First, I created a ListAdapterHolder class which will contain the objects I have in my row.xml file and by using the previous convertView logic, I will make a reference to my layout objects only if convertView is null.  Otherwise it will mean that I already did it. To reuse the recycle references, I will have to store them in the convertView tag property by doing a setTag call and to have them back by doing a getTag call.


Finally, we have to manage our array to extract the string we need and set the text to our holder objects to get the following result:


 


NOTE: This note can save you hours of desperation when creating this kind of views.  Remember how we added the List View in our xml? Both width and height are configured as fill patent. Never use wrap_content because it will cause multiple calls to getView method when painting your List View. Android will repaint the List View every time getView is called (It will need to repaint it because its content has change and as wrap_content is set, it dynamically adapts its width and height).


Abraham Vargas is a Software Developer with more than 2 years of experience in mobile development. He is an Appcelerator Titanium Certified Developer (TCD) and currently works at iTexico as an Android Developer.


Contact Us


View the original article here

How to: Signing & Publish a Titanium Mobile App from Zero to iTunes

=== Requirements ===


For signing your Mobile App, the first thing that you need, it's to get a provisioning profile for distribution for the Apple store and a certificate of distribution too. In order to get these files, you should have an iOS developer account of Apple.


Go to https://developer.apple.com/.


Click on “Member Center” and Sing in.


Click on "Certificates, Identifiers & Profiles".


Click on "Certificates".


Click on the plus button.


Now, you should be in "Add iOS Certificate" screen. Here you should follow the next 4 steps for generate the certificate:


1. Select Type.


On this screen, select "App Store and Ad Hoc" above to "Production" title and click on "Continue".


2. Request.


On this screen, you will find the instructions for creating a Certificate Signing Request (CSR) which you will need in the next step.


Create a CSR file.


In the Applications folder on your Mac, open the Utilities folder and launch Keychain Access.


Within the Keychain Access drop down menu, select Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority.


In the Certificate Information window, enter the following information:


User Email Address field - enter your email address.


Common Name field - create a name for your private key (e.g., John Doe Dev Key).


CA Email Address - this field should be left empty.


Request is - select the "Saved to disk" option.


Click Continue within Keychain Access to complete the CSR generating process.


 


When you get the file "*.certSigningRequest", click on "Continue".


3. Generate.


On this screen, you can upload your CSR file, then click on "Continue".


4. Approval.


On this screen you will download a file "*.cer" after you have downloaded it, you do double-click on it for add it to the Keychain Access.


Before get the provisioning profile for your mobile application, you should register an AppID.


Click on "Identifiers".


Click on the plus button.


Fill the form with the information of your Mobile App and click on "Continue".


 


Click on "Provisioning Profiles".


Click on the plus button.


Now, you are in Add iOS Provisioning Profile screen. Here, you should follow the next 4 steps for getting the provisioning profile:


1. Select Type.


On this screen, select "App Store" above to "Production" title and click on "Continue".


2. Configuring.


On this screen first, you should select the AppID that you have registered before.  Then, click on “Continue”. Next, you should select the certificate that you have previously generated and click on “Continue” again.


3. Generate.


On this screen, you should write the profile name and click on “Generate”.


4. Download.


On this screen, you can download the provisioning profile generated.


Before to upload your Mobile App, you should prepare your account to be ready for receive it.


Go to iTuenes Connect and Sing in.


Click on “Manage Your Apps”.


Click on “Add New App”.


Fill the forms of the following 3 screens:


In the end, you will need to upload the following files:


Large Mobile App Icon


A large version of your app icon that will be used on the App store, must be at least 72 DPI, in the RGB color space, and 1024 x 1024 pixels (it cannot be scaled up). The file type must be .jpeg, .jpg, .tif, .tiff, or .png format.  It must be a flat artwork without rounded corners.


3.5-Inch Retina Display Screenshots:


Screenshots for 3.5-inch iPhone and iPod touch Retina display must be 960x640, 960x600, 640x960 or 640x920 pixels, at least 72 DPI, in the RGB color space, and in the JPG or PNG format.


4-Inch Retina Display Screenshots


Screenshots for 4-inch iPhone 5 and iPod touch (5th generation) Retina display must be 1136x640, 1136x600, 640x1136 or 640x1096 pixels, at least 72 DPI, in the RGB color space, and in the JPG or PNG format.


iPad Screenshots


iPad Screenshots must be .jpeg, .jpg, .tif, .tiff, or .png file that is 1024x768, 1024x748, 768x1024, 768x1004, 2048x1536, 2048x1496, 1536x2048 or 1536x2008 pixels, at least 72 DPI, and in the RGB color space.


Routing App Coverage File (Optional)


Routing mobile app coverage files are .geojson files which specify the geographic regions supported by your app. The file can only have one MultiPolygon element. MultiPolygon elements consist of at least one Polygon. Polygons contain at least four coordinate points. Polygon start and end coordinate points must be the same.


When you have already downloaded the provisioning profile, double-click on the file to install in xCode.


In Titanium Studio on the view “App Explorer” click on the “Package” icon, it will open a menu. Then, the software developer should click on “Distribute – Apple iTunes Store”. It will show a window configuration and you should select the SDK version, The Certificate and The Provisioning Profile for this project. Click on “Continue”, it will open xCode.


In xCode, you should select iOS Device as target in the box beside to the controls “Play” & “Stop”. Make sure there is not a connected device to the Mac. Then, go to “Product” menu and click on “Archive”. It will open the “Organizer” window and show the “Archives” tab as selected. There should be appear your App, select it and click on “Distribute” then on “Submit to the iOS App Store” and “Next”. You should login . If there are no errors, the app will be uploaded quickly.


Martín Silva is a Computer Science Engineer with more than 12 years of experience as a web developer, 6 years of experience as a software developer and almost 4 years in mobile app development. He currently works at iTexico as a Web application and Mobile App Developer.


View the original article here