Archive for the ‘Tablets’ Category.

LANDesk Support Tools – Android Edition (Demo)

This is my first real project written for Android. Yes, I wrote it in C# using Mono for Android.

How to create an Android menu?

Ok, so adding a menu that pops up from the bottom when the menu button is clicked is very common and quite easy to do.

Note: This assumes you have the Android SDK, Emulator, and Eclipse all working already.

Step 1 – Create your Android project

  1. In Eclipse, select File | New Project | Android | Android Project.
  2. Give your project a Name.
    I named this project “HelloAll”.
  3. Select the Build Target (the minimum version of Android).
    I selected Android 2.2.
  4. Enter a Package name.
    Package name is like a namespace, it can be anything you want, but you should actually choose a name as carefully as you choose and the name of an object.  I named the package this: org.rhyous.
  5. Click Finish.

Your project is now created.

Step 2 – Add an XML file for the menu

  1. Expand the res directory in your project.
  2. Right-click on the layout folder and choose New | Other.
  3. Choose XML | XML file and click Next.
  4. Name the file.
    I named my file menu.xml.
  5. Click Finish.
  6. Add the following text into your menu:
    <menu xmlns:android="http://schemas.android.com/apk/res/android">
        id="@+id/menu_item_1" android:title="@string/menu_1"/>
        id="@+id/menu_item_2" android:title="@string/menu_2"/>
        <item android:id="@+id/menu_item_3" android:title="@string/menu_3"/>
    </menu>
    

Step 3 – Add the strings for the menu items

  1. Expand the res\values directory in your project.
  2. Open the strings.xml.
  3. Add strings for each menu item.
    Make sure you use the same id strings you used in the menu.xml for the title of each menu item.
    Your strings.xml should now look like this:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="hello">Hello World, HelloAllActivity!</string>
        <string name="app_name">HelloAll</string>
        <string name="menu_1">Menu 1</string>
        <string name="menu_2">Menu 2</string>
        <string name="menu_3">Menu 3</string>
    </resources>
    

You now have a menu and strings for each menu item.

Step 4 – Overload onCreateOptionsMenu

  1. Open your Activity.
    Mine is src\org.rhyous\HelloAllActivity.java.
    It should look like this:

    package org.rhyous;
    
    import android.app.Activity;
    import android.os.Bundle;
    
    public class HelloAllActivity extends Activity {
    	/** Called when the activity is first created. */
    	@Override
    	public void onCreate(Bundle inSavedInstanceState) {
    		super.onCreate(inSavedInstanceState);
    		setContentView(R.layout.main);
    	}
    }
    
  2. Add code to override onCreateOptionsMenu and add code to inflate the menu.
    	@Override
    	public boolean onCreateOptionsMenu(Menu inMenu) {
    		super.onCreateOptionsMenu(inMenu);
    		getMenuInflater().inflate(R.layout.menu, inMenu);
    		return true;
    	}
    

You can now build your application and test that the menu pops up. However, the menu doesn’t do anything yet.

Step 5 – Overload onCreateOptionsMenu

  1. Add code to override onOptionsItemSelected and add code to inflate the menu.
  2. Use a switch statement with the inItem.getItemId() function to perform the appropriate action for each menu item.
    	@Override
    	public boolean onOptionsItemSelected(MenuItem inItem) {
    		switch (inItem.getItemId()) {
    		case R.id.menu_item_1:
    			// Do something here
    			return true;
    		case R.id.menu_item_2:
    			// Do something here
    			return true;
    		default:
    			// Should never get here
    			return false;
    		}
    

Based on the item clicked, the appropriate code will run.

Hope you enjoyed this simple Android development example.

A Hello World Android App in C#

This post is a continuation of Writing Android apps in C# using MonoDroid.

Writing your first MonoDroid project

Now that you have installed and configured MonoDroid and its prerequisites, you are ready to create your first project.

  1. Open Visual Studio.
  2. Go to File | New | Project.
  3. Choose “Mono for Android”. This is a new project type added by the Mono for Android Visual Studio 2010 Plugin.
  4. Give the project a name and click OK.

You now have a sample MonoDroid app.

Running your first MonoDroid App in an Emulator

Now that you have a sample MonoDroid app, learning to deploy it to an Android device and to test it is the next step.

  1. Simply press F5 in your “Mono for Android” Visual Studio project. The following screen appears however, there are no running Android devices.
  2. Click the link to “Start emulator image”.
  3. Wait until your Android emulator starts and you see the graphical display and not just a text display.
  4. Select your emulator from the Running Devices list and click OK.
  5. Wait. It is going to deploy the mono library to your emulator and deploy your app and this can take time.

You application should now be running in your Android emulator.

This is just a sample application that increments a counter and displays how many times you have click the button.

You are now ready to start writing your own application.

More Tutorials

Xamarin has multiple Tutorials to help you get a little further along.

MonoDroid Tutororials by Xamarin

Writing Android apps in C# using MonoDroid

As C# developers, many of us would prefer to write Android Apps in C# as well. Novell had promised us MonoDroid, but we were quite concerned as to whether MonoDroid would ever be released when Novell was dismantled.

However, Xamarin spawned from the ashes like a phoenix to restore the viability of MonoDroid, restoring our hopes to writing in C# for the Android platform.

Though I am hopeful that MonoDroid will become popular allowing C# to be a commonly used language for Android devices, there is still some question as to whether Xamarin and its MonoDroid product will survive.

Xamarin is a new company and needs to survive first. Its business is to sell MonoDroid, which is not open source, but is a proprietary product. Unfortunately, MonoDroid may cost too much, preventing adoption among app developers. Xamarin requires a customer base and a continual adoption rate if it is going to survive. If the company folds, what is going to happen to the library and the apps that use it?

Is Development with MonoDroid Free? Yes and No!

Yes and no.

Yes because anybody can use and develop with MonoDroid at no cost. It isn’t until you need to publish an app to the app store that you need to buy a license. You can use the MonoDroid trial for as long as you want. Here is a quote from the trial website. [2]

The evaluation version of Mono for Android does not expire, but enables development and testing against the Android Emulator only.

No, because you need to buy a license once either of the following become true:

  1. You need to test your code directly on a real device and not just an emulated device
  2. You are ready to publish an app to the app store

So what is the cost of MonoDroid? Depends on if you buy Professional, Enterprise, or Enterprise Priority. On the Xamarin store, the following table can be found. To see it you have to add MonoDroid to your cart and then click the “Show product comparison” link. [1]

Professional Enterprise Enterprise Priority
Deploy to your devices Has this feature Has this feature Has this feature
Publish to app stores Has this feature Has this feature Has this feature
Enterprise distribution Has this feature Has this feature
Priority support queue Has this feature
Guaranteed response time Has this feature
License expiration Never Never Never
Update subscription 1 Year 1 Year 1 Year
License usage Original User Seat Seat
Price (USD) $399 $999 $2,499

These costs are very low for business or enterprise customers who have C# developers and want to write Android apps.  The cost of training a C# developer to develop apps for Android in Java may be far greater than training them to develop apps for Android using C# and buying a MonoDroid license.

Is MonoDroid easy to set up?

Update
MonoDroid is not down to a one-click installer.

Here is the old method of Installing without the One-click Installer

MonoDroid is simple to set up.  Xamarin has some simple steps that can be found on their web site. They have MonoDroid installation instructions for installing MonoDroid for use with any of three environments.

  1. Visual Studio  (Important! Visual Studio Express is not supported)
  2. MonoDevelop on Windows
  3. MonoDevelop on Mac OSX

If you don’t have a Visual Studio license and you can’t afford one, then go with MonoDevelop because Visual Studio Express is noted to be enough [3].

However, the Visual Studio install is four simple steps.

  1. Install the Java SDK
  2. Install the Android SDK
  3. Configure your simulator
  4. Install the Mono for Android Visual Studio 2010 Plugin

These are very easy steps to complete, and I won’t repeat the steps here, but once you complete them, you are ready to start writing Android apps in C#.

Once you feel you have everything installed, click the following link to continue reading.

Writing your first MonoDroid project

http://android.xamarin.com/Installation/Windows

TechRepublic: ASUS Eee Pad Transformer tablet is a mixed bag

I read this article today and found it very insightful.

ASUS Eee Pad Transformer tablet is a mixed bag

One of the biggest complaints about the tablet is the ability to type and this device eases that some, though not completely.  One interesting quote, I am not sure if I agree with yet, but I have thought it myself is this:

A coworker who owns an iPad displayed some gadget envy when I first brought the Eee Pad Transformer to the office, but he also noted, “with the clam shell format, I think I’d end up using it mostly like that, and not like a tablet.” It turns out that this was a very astute observation, because my experience has been that I haven’t had much desire or reason to undock the tablet. This makes me wonder if tablet mania may not be a bit of a novelty.

I don’t know if I completely agree that tablets are a novelty. I remember the Palm Pilot was novelty that wore off and I am on the fence right now as to whether the iPad and devices such as the Motorola Xoom will end up as paper weights on peoples desk because typing and other uses just aren’t there and a laptop or desktop computer is desired.  However, this ASUS Eee Pad Transformer tablet may be an important bridge to these technologies, something that didn’t exist in the Palm Pilot days, so problems that existed for the Palm Pilot and still exist in tablets today may have new solutions that allow the technology to go further.

Smart phones and tablets can’t replace a desktop or laptop, yet!

I completely believe that the phones and tablets like the new T-Mobile 7″ Samsung tab are going to be continue to be huge industries and will not go away as the Palm Pilot did. However, will they continue to explode exponentially as many believe? Or is there a plateau coming?

I just reviewed the Motorola Xoom and it was a great tech toy. However, it wasn’t much more than a casual gaming tool. There is a crucial flaw that has yet to be solved with phones and tablets: Typing.

No matter how fast you can type on a phone or tablet, you will never type as fast as you can on a keyboard. Might there be a solution better than a keyboard that we just haven’t discovered yet…maybe…but even if we discover it will it work on a phone or tablet?

There are certain uses for a phone:

  1. Making calls
  2. MP3 player
  3. Texting
  4. Casual gaming
  5. Visual browsing (such as checking the whether)
  6. Reading email (notice, I didn’t put writing email)
  7. Pocket Portability
  8. GPS and Navigation
  9. Quick low quality photos/video

There are certain uses for a tablet

  1. Book reader
  2. MP3 player
  3. Casual gaming
  4. Visual browsing (such as checking the weather)
  5. Reading email (notice, I didn’t put writing email)
  6. GPS and Navigation
  7. Quick low quality photos/videos

However, will the Laptop and Desktop be taken over by a tablet?  What about 20″ to 27″ monitors? Some of use need so much real-estate we have multiple monitors.  Here are using for a computer that a tablet does not solve.  For those of you thinking of going 100% to phones and tablets, you may just want to hold on.

Here is a list of requirements and uses that are met by a desktop or laptop that the phone and tablet haven’t really solved yet.

Note: I am not going to repeat the items on the list for the smart phones and tables but be aware that the only feature the phone or tablet has that a desktop or laptop doesn’t have today is pocket portability.

  1. Keyboard and typing
    1. Writing email
    2. Writing documents
    3. Creating spreadsheets
    4. Writing code, yes, even writing code for tablets
    5. Writing blog posts (like this one)
  2. CD/DVD/Blu-Ray drive (yes, people are going to still want to play there DVDs and Blu-Ray movies 10 years from now)
  3. Monitors
    1. 17″ or larger monitor
    2. Multiple monitors
    3. Viewing multiple applications simultaneously
  4. Local storage of data.
  5. Serious desktop gaming
    1. Joysticks
    2. Short-cut keys
  6. Peripherals
    1. Printers
    2. External drives
    3. Cameras and Video cameras
    4. Projectors
    5. Custom peripherals (like those that are designed for one company, telescope, craft vinyl cutters, industrial equipment, etc…)
  7. Ethernet, no not everywhere has wireless yet and some secure facilities will never have wireless or allow VPN from a 3G/4G device. Some places don’t allow web-cams or camera devices and unfortunately you can’t take your camera out of your phone or tablet.

We have been using desktops for three decades. Smart-phones and tablets are in their infancy. Many problems, including millions of custom problems for companies in all industries, have been solved using laptops and desktops. To replace desktops and laptops, these problems will have to be solved.

Many problems have solutions already.For example, blue-tooth and wireless technology can allow for peripherals but there are a lot of devices already out there that are not blue-tooth or wireless capable.

But another road block is in the way. Adoption.

Adoptions takes a long time.  First the manufacturers have to adopt a technology, design new products, produce them, distribute them.  Then consumers have to buy the new technology and if they already own an older version, that older version often has to go through its life cycle which can take a lot of years. I still have an HP LaserJet 5L from the late 90s that works perfectly. No, I am not going to invest in another laser printer until this one dies.

So will someone still be running a desktop or laptop with Windows XP/Vista/7 in 2020. Certainly.  Will they probably own a smart phone or tablet as well.  You bet!

The Motorola Xoom is in my hands

I am writing this post to you from a Motorola Xoom.

Typing is definitely harder than with a keyboard yet much easier than from a phone.

It didn’t work out of the box. Apps wouldn’t download, and Google talk wouldn’t connect. I finally factory reset it and started over and it worked. We think you have to log in during the initial configuration to avoid this issue, but we didn’t try to dupe it.

It is working great now.