You are on page 1of 38

Yesterday Trends of U.S.A.

News Network
Google Trends will let you know what people are searching for all over the world.In its large database, you can see charts, trends, and who ...And the hottest trend of the summer is ... hot dog legs! Huh? You know, the "you wish you were here" photos your girlfriends post on Instagram showing off their ...

Dressy Shoes
www.novushoe s.com Dre ssy Shoe Style s, pum ps, sandals and Fre e Shipping ove r $100

C-Arm Rental
transamericanmedica GE-OEC & Philips Mobile C-Arms For all surgical specialties

Sunday, Decem ber 15, 2013

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


Recommend this on Google

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!

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

We start by creating a new Android Java Bindings project

Robotic Automation Engineering Management

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)

Infolinks In Text Ads

Blog Archive

03/01 - 03/08 (15) 05/10 - 05/17 (10) 05/17 - 05/24 (36) 05/24 - 05/31 (34) 05/31 - 06/07 (53) 06/07 - 06/14 (43) 08/09 - 08/16 (4) 09/27 - 10/04 (1)

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

01/30 - 02/06 (12) 04/10 - 04/17 (1) 05/15 - 05/22 (2) 09/02 - 09/09 (24)

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 dont necessarily need to link the code, you'll set EmbeddedReferenceJar (although this is not case).

09/16 - 09/23 (13) 09/30 - 10/07 (32) 10/14 - 10/21 (17) 02/24 - 03/03 (112) 03/03 - 03/10 (336) 03/10 - 03/17 (334)

After doing that, if you build the project (F8) you'll receive 12 errors. But don't worry, this is a

03/17 - 03/24 (342)

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

typical process when you're binding a native library.

03/24 - 03/31 (42) 09/01 - 09/08 (46) 09/08 - 09/15 (87) 09/15 - 09/22 (73) 09/22 - 09/29 (27) 09/29 - 10/06 (65)

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

10/06 - 10/13 (25) 11/03 - 11/10 (18) 11/10 - 11/17 (4)

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

11/17 - 11/24 (38) 11/24 - 12/01 (66) 12/01 - 12/08 (10) 12/15 - 12/22 (25)

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.

AddThis

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? Thats 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 wouldnt work that way.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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 APIs 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'.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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 youre 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.

Youll 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.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

View the original article here

at 11:30 PM

No comments:

Labels: Consuming, Development, Libraries, Mobile, Xamarin, XamarinAndroid

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


Recommend this on Google

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:

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

- 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.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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 youll 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:

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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.

View the original article here

at 11:25 PM

No comments:

Labels: Features, Inside, Mobile

How to Create a Database Mobile App with SQLite and Xamarin Studio
Recommend this on Google

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.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

//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 nam e 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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

{ sqldb_message = ""; string sqldb_location = System.Environment.GetFolderPath(System.Environment.Speci alFolder.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.Open Readwrite); 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;

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

} } //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 ='" + sLastNa me + "', 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);

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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"

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

~ 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"

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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"

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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" />

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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"

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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();

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

};

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 se arch 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

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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.Layou t.record_view, sqldb_cursor, from, to); listItems.Adapter = sqldb_adapter; } else { shMsg.Text = sqldb.Message; }

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

} //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_v alue);

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.Layou t.record_view, sqldb_cursor, from, to); listItems.Adapter = sqldb_adapter; } else { shMsg.Text = sqldb.Message; } } } }

5. Build solution and run

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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.

View the original article here

at 11:20 PM

No comments:

Labels: Create, database, Mobile, SQLite, Studio, Xamarin

How To: Time Management in Software Development and Project Management


Recommend this on Google

Initially, time management referred to just business or work activities. However, the term has broadened to include personal activities as well. The definition of time management is the process of planning and exercising conscious control over the amount of time spent on specific activities, especially to increase, effectiveness, efficiency, or productivity. -Stephen Covey

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

During my experience in software development, I have come across some issues that can be considered like the red light of software project management. Unrealistic project goalsBadly defined system requirementsPoor reporting of the project's statusPoor communication between customers, software developers and project managers and stakeholders.Inability to handle the project's complexitySloppy development practicesPoor software project managementCommercial pressuresInaccurate time estimationManagement time and activities I would like to focus this post on time management, activities, and what are the best practices to take advantage of our time. Recently, I started thinking about how many things we do every day that have the same results, both at work and in our personal lives. Here, I would like to share my understandings and what my choices are while making the best use of my time.

1. Planning & prioritizing 2. Protect your time and avoid needless distractions 3. Discipline yourself.

According to the old saying, A stitch in time saves nine, time management strategies are often associated with the recommendation to set personal or team goals. A timely effort focused on planning tasks will prevent more work later.

For individual tasks or goals, an importance rating must be established as well as for deadlines and priorities assigned. This process results in a plan with a task list or a schedule or calendar of daily, weekly, and monthly activities or even customized periods.

Planning and prioritizing helps us to prevent losing any task we have to do. Additionally, this also makes sure that we do the most important ones first. I want to share the Stephen Covey Matrix which can help you think about your priorities, and determine which of your activities are important, and which distractions are essential.

Use your time effectively, not just efficiently.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Distraction is the major time killer that makes us ineffective.

With innumerable distractions these days, it is very easy to be taken hold by any one of them and lose sight of all that should have stayed as a priority. Many developers will not code for 8 hours straight. Some developers say that distractions are often caused by a lack of motivation. Obviously, developers must be motivated enough (usually in some form of profit sharing) in order to do their best work, but it is wrong to assume that distractions are unethical to do good work.

In fact, some developers said that their best work comes from not thinking about a problem for a while and returning to it after being appropriately distracted. In other words, it means to get away from a problem and think about something else.

Developers frequently distract themselves when they are investigating a problem, because they finish everything on a web page that is not related to the main problem. So, get focused!

Here are some helpful hints to become more focused for everyday tasks.

- Discipline yourself to know when it is time to work and when it is time to play.

- Get the proper amount of sleep and try to avoid stress.

- Inform friends and family who may try to contact you that you need some peace and quiet to complete some work and shouldn't be disturbed.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

- Think ahead as to what could be a distraction and try to distance yourself from it. For example, Social media, chats, a lot of noise, and web browsing that is not related.

Planning is the starting point of time management, while identifying risks that are retrospective. Sometimes it is even more important than the planning. That is because planning is working on something uncertain, while retrospect is based on reality and intended to make improvement. So, how do we identify distractions? Track the time and see where your time is being spent the most. Our memory is unreliable to keep track of how long we spend time on the things to be done. We need to actually write it down and write it down when it happens (at the beginning or the end of the task).

Jessica Ayala has a Bachelor in Psychology specialized in Corporate Psychology with professional experience in recruiting. She currently works at iTexico as Human Resources Analyst. You can contact her at her email: jayala@itexico.com, LinkedIn profile or Twitter account.

View the original article here

at 11:16 PM

No comments:

Labels: Development, Management, Project, Softw are

iTexico Top 5 Mobile Development Stories. November 2013 Edition


Recommend this on Google

The end of 2013 is near and looking back weve 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.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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 smartphones main feature is not only the curved screen but also that it is the first self-healing smartphone Thats 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, its not about converting into a particularly technology but to provide some insight into how applications are created in different technologies.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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.

Lets 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 dont know about you, but Im excited to see what is coming in the near future.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

With the surprise announcement of the new Android OSs 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.

View the original article here

at 11:11 PM

No comments:

Labels: Development, Edition, iTexico, Mobile, November, Stories

HR Perspective: Technical Interviews for Mobile App & Web Developers


Recommend this on Google

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?

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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. iTexicos developers like to work with faster, easier, and cleaner code. They are owners of their projects and they interact amicably with their customers.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

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 Villaseor 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.

View the original article here

at 11:06 PM

No comments:

Labels: Developers, Interview s, Mobile, Perspective, Technical

Home Subscribe to: Posts (Atom)

Older Posts

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

The New Windows Phone


41 Megapixels. Cloud Connected. Point, Shoot & Share! Learn More. by Window s Phone on YouTube

Template images by Bim. Powered by Blogger.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

You might also like