Thursday 24 September 2015

HOUSEKEEPING;GETTING XAMARIN AND SETTING THINGS UP

Now that you've read all that chatter online about all the trade-offs of Web,Hybrid and Native cross-platform mobile app development am happy that you finally made that important decision i favor of Xamrin.

We're going to start off with a little house-keeping here;

  1. Let's register ourselves here and get Xamarin for Students from here.
  2. Great,go ahead and give your details.
  3. You'll be expected to prove that you're a student-a student email address will suffice for the most part coupled with your student ID or other evidence you may have.
  4. Once that is done you'll receive an email confirmation and links to download the latest version of Xamarin. You'll get an online installer which will download and set everything up for you.But,if your internet is as bad as mine normally is,do request for an offline installer for your OS-in my case I'm using a Windows 10 PC-7/8/8.1 still works.
  5. Once your download is complete,launch Xamarin and select the "Options" tab-however note that it'll ask you to login,do so with your Xamarin credentials.
  6. Now,hover over to the "Options" tab and click on it.

 

Now that is a good sign, but we're not out of the woods yet;

We have some other things to set up.
  1. If you love Visual Studio-like I do, Xamarin will seamlessly integrate with Visual Studio allowing you {Windows users} to use the environment you're most comfortable with
  2. We also need to ensure we can access Xamarin Component store and Nuget;now if your not accessing internet via a proxy server then you can skip this step and move on,else you need to listen good.Go to your environment settings(-Windows users) by typing "env",and "Choose edit system environment variables".Click on the "Environment Variables" button.
  3. In the new window,under "System Variable" click on "New" and create a variable by the name "http_proxy" -without the quotes -in the "Variable name" field and insert you proxy address in the "Variable value" field.Do the same for a new variable "https_proxy";for the most part the addresses are the same.I had to bring this up because it's an issue I had faced.
  4. Now we set up the emulators.You can get emulators from Google,that ships with Android SDK,you can get Xamarin Android Player form here  ,use Genymotion,or use Visual Studio Android Emulators from here.Do note that when you'll be using Genymotion or Xamarin Android Player,Oracle Virtual Box will need to be on and apparently,Virtual Box and Hyper-V do not play well.What I mean is you won't run Virtual Box when Hyper-V is enabled.You may use to stock Google Android Emulators or Visual Studio emulators(-creates virtual Android machine in Hyper-V).
  5. You're pretty much set to go.
Issues you may face(-Windows users);

Issue:You can not access internet when you install Hyper-V powered emulators
Fix: Delete all virtual switches,uninstall all network drivers(works in windows 10),and run the following commands as admin


  • netsh int ip reset reset.txt
  • netsh winsock reset
  • netsh advfirewall reset


Then reboot.

Issue:You can not access Component Store or Nuget.
Fix: Check if your proxy changed and reset them in the environment variable settings.

Issue:You can not run an emulator.
Some fix:This arises from so many issues;ranging from buggy Hyper-V,to low development machine memory.
Ensure you have added you emulator set-up app to list of exceptions in firewall settings(for Visual Studio Android emulator add XDE to communicate via firewall:
"C:\Program Files (x86)\Microsoft XDE\10.0.10240.0" and select XDE-path may vary.)
If it's a memory issue,close some apps(-check if "Evented I/o for v8 javascript" is running in the background,it's very famous for this).

So let's meet in the next blog and run our Hello World App!.



Saturday 12 September 2015

CROSS PLATFORM (MOBILE) APPS DEVELOPMENT


CAVEAT: Am not an experienced developer and most of which is expressed here
is based on my shallow research, do feel free to learn more via the various resources in the internet.

I had to get that out of the way.

Well, this series of blogs will take you through my journey as Xamarin developer from a noob(-which I currently am as I write this post) to a pro(-which I plan to be). I do warn you that I've chosen C# as my primary development language and am not turning back.

So, let's tackle the elephant in the room; cross-platform mobile application development.




This is where you-as a developer- develop a single app to target more than one operating system(mobile or desktops).This is the simplest definition I could come up with, to avoid being misinformed ,use Bing or Google or Yahoo or something!.

This is itself a brilliant step to take as you partake in your development journey. It means you'll be able to hit millions(-if not billions) of consumers worldwide with your great app.




To get you through this, there are tens of development environment out there that'll help you leverage your skills and reach your target. Well, most have very steep learning curves while some offer you the benefit of doubt that you'll get comfortable in "5 minutes after installation"(-Corona). The environments also vary, some offer you the opportunity to develop and emulate offline in your local machine(-Xamarin) others run fully in the cloud(-Rhomobile).With all these the languages used for each platform also vary. C#-Xamarin,C++/QML-Qt others rely on web technologies-Intel XDK;with some relying heavily on JavaScript-Appcelerator,or HTML5 -Phonegap/Apache Cordova,others rely on "exotic languages" like Lua - Corona...

That's a lot! Guess what you have your options narrowed down to 3 choices;
  1. Have a native app,
  2. Have a hybrid app,
  3. Have a web app.
There are trade-offs in making each of the options. You may run into issues such as problems normalizing your UI across platforms, laggy applications, having plugins not supported in certain APIs, lack of updates for certain plugins...

On the positive side most are FREE. Other come coupled with Mobile Backend-as-a-service(-Appcelerator) ,others even offer Cloud hosted testing devices for your apps-Xamarin. Plus a lot of great offerings from the multitude of companies.

Out of all these I chose Xamarin.

Why? Simple, I've never met a language as versatile as C#;run on web, run on mobile devices, run on desktops, run on IoT devices...etc and it does all these without breaking a sweat. Plus it's way more secure and great at garbage collection. Argue all you want, C# is great. ! :)

About Xamarin,you get to write your codes in C# for Android,Windows Phone(-Visual Studio) and iOs(-Desktop and Mac) with code sharing of up to 95%(-www.microsoftvirtualacademy.com).Whatever you want to do in Objective-C,Java or whatever, you can comfortably do it in C#;take lambda expressions for example.




Most of all Xamarin, is free for students!!! As long as you're a student and can prove it-go get it from xamarin.com/students. And it blends nicely with the best IDE in the world(-keep hating)-Visual Studio. You can also easily build cross platform games with so much ease.

I'll leave you with some great articles on cross-platform mobile application development and you'll surely see why Xamarin cut's it.

  1. Xamarin Home → xamarin.com
  2. Xamarin for students xamarin.com/students
  3. Xamarin Developer portal →developer.xamarin.com
  4. Xamarin blogs → blog.xamarin.com
  5. Cross-platform mobile app development options in Visual Studion https://www.visualstudio.com/en-us/features/mobile-app-development-vs.aspx
  6. Learn about PhoneGap features →http://phonegap.com/about/feature/
  7. Get Phonegap →http://phonegap.com/install/
  8. Get to know Corona → https://coronalabs.com/
  9. Some trade-offs of various platforms →http://www.developereconomics.com/pros-cons-top-5-cross-platform-tools/
  10. Featured list of most well known Cross-platform tools →http://appindex.com/blog/ten-best-cross-platform-development-mobile-enterprises/
  11. Intel XDK →https://software.intel.com/en-us/intel-xdk
  12. Over-view of cross-platform options including game development →http://thinkapps.com/blog/development/develop-for-ios-v-android-cross-platform-tools/
  13. Get to know Rhomobile →http://thinkapps.com/blog/development/develop-for-ios-v-android-cross-platform-tools/
Well this is not the exhausted list of dev tools available you surely find many more.

Read the articles and make your choice depending on the needs for your app or game.

Over the next series of blogs I'll walk you through getting Xamarin, Installing and some issues you may encounter and solutions.


See you in the next post!!