how to make android apps in visual c#

Tutorials and code examples for creating apps on the android platform.
1 post Page 1 of 1
Contributors
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

how to make android apps in visual c#
Shim
hello guys :)

I recently got myself an Android mobile phone and was really interested in writing applications for it. After downloading the Android SDKas well as the 32-bit Java SDK(noooooo!) I got it all installed and running the sample apps with Eclipse and browsed around the code.

Firstly, I wasn’t really too keen on getting into another development environment. Secondly, I really didn’t want to do any Java development if I didn’t have to. C# is my happy place, C++ is for the ugly stuff if you need it, Java is just, well, ugly... Besides the last time I did any serious Java was in college, enter MonoDroidto save the day!

Getting Started

To get everything installed read this guide. Then you can read about the API and architecture to get a better understanding about how it all gels together. Pretty much everything you need including signing up for the newsletter can be found by going directly to http://www.monodroid.net.

Once you have everything installed it’s pretty easy to get going. The beauty about diving in using a language you are familiar with, means you can get used to the Android SDK without having any knowledge of Java or even C++ (for more advanced features). MonoDroid wraps up all the calls using standard .NET constructs through a JNI bridge, plus, you get all of the power of the standard .NET API’s which work in Linux/Android.

Hello Android

Following the tradition of “Hello World”, let’s jump right in and write an Android application.

1.Make sure that you have everything installed, this guide couldn’t have made it easier.

2.Create a new Project in Visual Studio:

Image

3.MonoDroid does most of the heavy lifting for you. If you’re familiar with Android projects in Eclipse you should have any problems with the structure. Android uses layout and string resource files (the right way) for the UI. Activities are like UI controllers, all the info you need is on the Android Developers website.

4.Just run the application to check everything is working correctly, if you don’t have a device attached or an emulator running then now is the time to create one:

Image


If you don’t see anything then just click “Start emulator image”:

Image

Once again MonoDroid holds your hand by signing the package and also installing the Mono runtime if it’s not already available.

WARNING: If you are running an emulator then this will take a while, if you have a monster PC that does it in seconds then I hate you.
5.Unlock the phone/emulator and click the button:

Image

That’s it! There is a lot of documentation on writing Android applications. Java isn't that far off in syntax to C# so it will be easy to pick up sample code all over the place

Download Sourcecode

Source
Find my programs on Softpedia
1 post Page 1 of 1
Return to “Tutorials”