background

Posts Tagged ‘android’

andengine – Android 2D Open GL ES Game Engine Similar to cocos2d-iphone for iOS

Posted in Shared on July 24th, 2010 by herkulano – Be the first to comment

A sweet engine for getting started with Android game development is the andengine 2D OpenGL ES engine. This is very simple and compares with cocos2d-iphone for iOS development in 2D with OpenGL ES.  They both support a wide range of 2d techniques with an OpenGL renderer.  Some great videos are posted on the andengine google code page showing a box2D example, multiplayer example and more.

Mobile games are on slower hardware, similar to later 90′s computers so native is a great way to go for 3d and 2d game development because of this limitation at the current time and well into the next few years.  Take this time to learn you some native gamedev. andengine isn’t native directly as it is Java based but compiled with the Dalvik JIT virtual machine. Another way to go native on Android is the Android NDK which allows C and C++.

The engine also has extensions that can be easily added and some great ones exist already.

Video Chat for Android in 30 Lines of Code

Posted in Shared on July 23rd, 2010 by herkulano – Be the first to comment

Here is a simple Video Chat application I built with Flex 4 and deployed on AIR for Android. The Application is just 30 lines of code and allows multiple users to join a chat room and “video chat”.

Video streaming is powered by LiveCycle Collaboration Services, a set of hosted Flash Services that enable developers to easily add real-time collaboration and social capabilities to their applications.

This application is obviously a bare-bones proof of concept. However, it is fully operational, and the same code can run on different runtime environments: AIR for Android, AIR on the Desktop, and Flash Player in the Browser. Users can participate in the same collaboration session regardless of the runtime environment they use.

Watch the video:

The 30 lines of code:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:cs="AfcsNameSpace" currentState="logon" fontSize="28">

	<fx:Script>
		[Bindable] private var roomURL:String = "http://connectnow.acrobat.com/YOUR_ROOM_NAME";

		protected function connect():void {
			auth.userName = userName.text;
			currentState = "default";
			session.login();
		}
	</fx:Script>

	<s:states>
		<s:State name="default"/>
		<s:State name="logon"/>
	</s:states>

	<fx:Declarations>
		<cs:AdobeHSAuthenticator id="auth"/>
	</fx:Declarations>

	<s:TextInput id="userName" includeIn="logon" top="200" horizontalCenter="0"/>
	<s:Button label="Connect" click="connect()" includeIn="logon" top="250" horizontalCenter="0" height="50" width="150"/>

	<cs:ConnectSessionContainer id="session" roomURL="{roomURL}" authenticator="{auth}" autoLogin="false" width="100%" height="100%" includeIn="default">
		<cs:WebCamera top="10" left="10" bottom="10" right="10"/>
	</cs:ConnectSessionContainer>

</s:Application>

AS3-P2P-LIB and P2P Video Calls on Android

Posted in Shared, Uncategorized on July 22nd, 2010 by herkulano – Be the first to comment

I am very happy that the community is getting more and more involved in P2P. I told you, it has endless possibilities! :)

AS3-P2P-LIB
AS3-P2P-LIB is a pure ActionScript 3.0 Library by Dominic Graefen that helps Flash developers get started with P2P easily.

as3-p2p-lib

All Classes | Example | Project page at GitHub

P2P Video Calls on Android

My fellow evangelist Mark Doherty built a great demo app using P2P and AIR 2.5 for Android. Watch this video, where he shows how it works. And btw: I should really teach him how to pronounce my name :) Mark, you are going to get a lesson at MAX 2010!

Check Mark’s blog post for further information.

Use Chrome like a pro

Posted in Shared on July 15th, 2010 by herkulano – Be the first to comment
This week I sent a note to Googlers about some of the Chrome team's favorite extensions. So many of them asked if they could share the list with people outside the company that I thought I would just do it for them. Here it is. We're proud of the Chrome browser and the great extensions that its developer community has created, and we hope you enjoy them! They can all be found at chrome.google.com/extensions.
  • Opinion Cloud: Summarizes comments on YouTube videos and Flickr photos to provide an overview of the crowd’s overall opinion.
  • Google Voice: All sorts of helpful Voice features directly from the browser. See how many messages you have, initiate calls and texts, or call numbers on a site by clicking on them.
  • AutoPager. Automatically loads the next page of a site. You can just scroll down instead of having to click to the next page.
  • Turn Off the Lights: Fades the page to improve the video-watching experience.
  • Google Dictionary: Double-click any word to see its definition, or click on the icon in the address bar to look up any word.
  • After the Deadline: Checks spelling, style, and grammar on your emails, blog, tweets, etc.
  • Invisible Hand: Does a quick price check and lets you know if the product you are looking at is available at a lower price elsewhere.
  • Secbrowsing: Checks that your plug-ins (e.g. Java, Flash) are up to date.
  • Tineye: Image search utility to find exact matches (including cropped, edited, or re-sized images).
  • Slideshow: Turns photo sites such as Flickr, Picasa, Facebook, and Google Images into slideshows.
  • Google Docs/PDF Viewer: Automatically previews pdfs, powerpoint presentations, and other documents in Google Docs Viewer.
  • Readability: Reformat the page into a single column of text.
  • Chromed Bird: A nice Twitter viewing extension.
  • Feedsquares: Cool way of viewing your feeds via Google Reader.
  • ScribeFire: Full-featured blog editor that lets you easily post to any of your blogs.
  • Note Anywhere: Digital post-it notes that can be pasted and saved on any webpage.
  • Instant Messaging Notifier: IM on multiple clients.
  • Remember the Milk: The popular to-do app.
  • Extension.fm: Turns the web into a music library.
Posted by Jonathan Rosenberg, Senior Vice President, Product Management

Some Flash Android Components

Posted in Shared on May 28th, 2010 by herkulano – Be the first to comment

You have those times when you get an idea, so you sit down and start building it? You know, maybe you are a designer, and that means cracking up Flash Pro CS5. Or perhaps you are a developer and you start messing with item renderers. As I travel around from conference to conference, I get a lot of ideas like that. And for most of them, I either run out of steam, get distracted, or simply get bored. Over the next several weeks I’ll be dropping projects like that on the old blog – starting with these Flash components that look like Android.

I wanted to get to know Android – intimately. So I started examining the user interface controls. At first this was mostly on the device, to get a feel for the types of controls that were available, and the way they transitioned states. Next I started using the “ddms” screen capture utility that comes with the Android SDK to get a closer look at the pixels. I’d get the screen to a state I wanted, capture it, and then dissect it using Fireworks CS5. Finally, I started reassembling the controls in Flash Pro CS5 and putting ActionScript logic behind them.

The result is a pretty performant, and decent foundation of controls that look and feel like Android, but are done all with Flash, and expected to be deployed using AIR for Android. I could go a lot further with these, but then again, there’s that running out of steam thing. For example, these are really designed for the NexusOne – I don’t account for screen density. I also don’t account for screen orientation, though there’s hooks in the components for some basic sizing.

Okay, enough about what’s not there, what is there?

  • Button
  • CheckBox
  • ComboBox
  • DateChooser
  • Footer
  • Label
  • List
  • Menu
  • NumericStepper
  • TextInput
  • TimeChooser
  • Title

Some of these components need additional explanation. For example, the “DateChooser”. Most of the dates in Android are presented via a modal dialog box. Mine is no different. Though I don’t call them out as components in the above list, there’s stepper controls used by the dialog to control month, date and year. Likewise for the “TimeChooser” where you will find controls for the hour and minute.

“Footer” is the bar you find at the bottom of most Android forms. The Footer control accepts up to three strings, that will give you up to three buttons. Why three? Well, because that’s the most I saw in use on any Android application. The “Title” is the gray bar you see at the top of most Android forms. The “Menu” takes up to six buttons, and shows up at the bottom of the screen when you use the hard menu button on the device.

Regardless of the component, they are designed to be pretty atomic, and although they were designed in Flash Pro CS5, then can easily be used in Flash Builder 4 from an ActionScript project, because I include a SWC in the build. Here’s some example code, and the result user interface. In short, you instantiate the control you want, position it and size it if necessary, and then add it to the stage. Register for any events you may want to drive the rest of the application at runtime.

package  
{
  import flash.display.Sprite;
  import flash.display.StageScaleMode;
  import flash.display.StageAlign;
  import flash.events.MouseEvent;
 
  public class Components extends Sprite 
  {
    private var btn:Button = null;
    private var chk:CheckBox = null;
    private var cmb:ComboBox = null;
    private var day:DatePicker = null;
    private var ftr:Footer = null;
    private var lbl:Label = null;
    private var listing:ListPicker = null;
    private var opt:OptionPicker = null;
    private var time:TimePicker = null;
    private var mnu:Menu = null;
    private var tme:Button = null;
    private var ttl:Title = null;
    private var txt:TextInput = null;
 
    public function Components() 
    {
      super();
      init();
    }
 
    private function init():void
    {
      var btnx:Button = null;
      var lblx:Label = null;
      var today:String = DateDialog.formatShort( new Date() );
 
      stage.scaleMode = StageScaleMode.NO_SCALE;
      stage.align = StageAlign.TOP_LEFT;
 
      ttl = new Title( "Event details" );
      addChild( ttl );
 
      lbl = new Label( "What" );
      lbl.x = 9;
      lbl.y = 52;
      addChild( lbl );
 
      txt = new TextInput( "Event name" );
      txt.x = 9;
      txt.y = 85;
      addChild( txt );
 
      lblx = new Label( "From" );
      lblx.x = 9;
      lblx.y = 170;
      addChild( lblx );
 
      btn = new Button( today, 282, Button.TRIGGER );
      btn.x = 14;
      btn.y = 203;
      btn.addEventListener( MouseEvent.CLICK, doDateClick );
      addChild( btn );
 
      tme = new Button( "1:00pm", 158, Button.TRIGGER );
      tme.x = 306;
      tme.y = 203;
      tme.addEventListener( MouseEvent.CLICK, doTimeClick );
      addChild( tme );			
 
      lblx = new Label( "To" );
      lblx.x = 9;
      lblx.y = 276;
      addChild( lblx );
 
      btnx = new Button( today, 282, Button.TRIGGER );
      btnx.x = 14;
      btnx.y = 309;
      addChild( btnx );
 
      btnx = new Button( "2:00pm", 158, Button.TRIGGER );
      btnx.name = "to";
      btnx.x = 306;
      btnx.y = 309;
      addChild( btnx );			
 
      chk = new CheckBox();
      chk.x = 416;
      chk.y = 396;
      chk.addEventListener( MouseEvent.CLICK, doCheckClick );
      addChild( chk );
 
      cmb = new ComboBox( "Home" );
      cmb.x = 13;
      cmb.y = 487;
      cmb.addEventListener( MouseEvent.CLICK, doComboClick );
      addChild( cmb );
 
      ftr = new Footer( "Done", "Revert" );
      ftr.y = 680;
      addChild( ftr );
 
      mnu = new Menu( [
        {path: "search.png", label: "One"},
        {path: "search.png", label: "Two"},
        {path: "search.png", label: "Three"},
        {path: "search.png", label: "Four"},
        {path: "search.png", label: "Five"},
        {path: "search.png", label: "Six"}
      ] );
      mnu.addEventListener( MenuEvent.CLICK, doMenuClick );
      addChild( mnu );
 
      day = new DatePicker();
      day.addEventListener( DialogEvent.OK, doDateOk );
      day.addEventListener( DialogEvent.CANCEL, doDialogCancel );
      addChild( day );
 
      time = new TimePicker();
      time.addEventListener( DialogEvent.OK, doTimeOk );
      time.addEventListener( DialogEvent.CANCEL, doDialogCancel );
      addChild( time );			
 
      listing = new ListPicker();
      listing.addEventListener( ListEvent.CLICK, doListingClick );
      addChild( listing );
    }
 
    protected function doCheckClick( event:MouseEvent ):void
    {
      var btnx:Button = null;
 
      if( chk.selected )
      {
        tme.visible = false;
        btn.setWidth( 450 );
      } else {
        tme.visible = true;
        btn.setWidth( 282 );				
      }
    }
 
    protected function doComboClick( event:MouseEvent ):void
    {
      listing.show( [
        "Default ringtone", "Backroad", "Bell Phone", "Big Easy",
        "Bird Loop", "Bollywood", "Bus' a Move", "Cairo",
        "Calypso Steel", "Champagne Edition", "Chimey Phone",
        "Club Cubano", "Crayon Rock", "Curve Ball Blend", "Dancin Fool",
        "Digital Phone", "Ding", "Don' Mess Wiv It", "Eastern Sky",
        "Enter the Nexus", "Ether Shake", "Flutey Phone", "Free Flight",
        "Funk Y'all", "Gimme Mo' Town", "Glacial Groove", "Growl",
        "Halfway Home", "Loopy Lounge", "Los Angeles, 2019", 
        "Love FLute", "Medieval Jaunt", "Mildly Alarming", "Nairobi",
        "Nassau", "No Limits", "Organ Dub", "Paradise Island", "Playa",
        "Radiation by Spagnola", "Road Trip", "Safari", "Seville", 
        "She's All That", "Silky Way", "Steppin' Out", "Terminated",
        "Third Eye", "Twirl Away", "World"], 
        "Ringtones" 
      );
    }
 
    protected function doDialogCancel( event:DialogEvent ):void
    {
      trace( "Dialog cancel." );
    }
 
    protected function doDateClick( event:MouseEvent ):void
    {
      day.show( new Date() );
    }
 
    protected function doDateOk( event:DialogEvent ):void
    {
      btn.label = DateDialog.formatShort( day.date );
    }
 
    protected function doListingClick( event:ListEvent ):void
    {
      cmb.label = event.label;
    }
 
    protected function doMenuClick( event:MenuEvent ):void
    {
      trace( event.label );
    }
 
    protected function doTimeClick( event:MouseEvent ):void
    {
      time.show( new Date() );
    }
 
    protected function doTimeOk( event:DialogEvent ):void
    {
      tme.label = TimeDialog.formatShort( time.time );
    }		
  }
}

main_screentext_input

date_dialogtime_dialog

combo_dialogdevice_menu

Again, I want to note that this is a random idea project. It’s pretty modular, but may not be to the liking of many. The package structure is totally flat, though I suppose that’s a nit-pick more than a problem. If you are thinking that I should have skinned Keith Peters’ Minimal Comps, you’re probably right, but I started this on a plane, and it grew from there before Keith’s components could be skinned. All of it is available for download. If you find it useful, or have any questions about the architecture, don’t hesitate to ask.

Mobile Enterprise Sample Applications Powered by Adobe AIR, Flex and Android

Posted in Shared on May 25th, 2010 by herkulano – Be the first to comment

Last week at the Google I/O conference, we announced the public availability of the Adobe AIR for Android Developer Prerelease program. This week, we wanted to highlight a few excellent examples of AIR and Android powered enterprise applications developed by two members of our evangelism team, Christophe Coenraets and James Ward.

Both Christophe and James recently recorded inspiring video demonstrations of some of the sample applications they have been working on lately.

Mobile version of Employee Directory application by Christophe Coenraets.

Trading sample application by Christophe Coenraets.

Example of a Flex and AIR application that includes multi-touch support by James Ward.

Android passes iPhone sales in U.S. smartphone market

Posted in Shared on May 10th, 2010 by herkulano – Be the first to comment

New market research from The NDP Group confirms Android phones outsold the iPhone last quarter in the United States. RIM’s Blackberry OS remained at the top with 36%, while Android jumped to number two with 28%, followed by the iPhone OS at only 21%.

Now that all four major U.S. carriers (and several regional) are selling Android phones, we can’t say this comes as a surprise. A dozen smartphones across all the carriers should result in higher sales (just look at Blackberry).

The real question now, is how long will the iPhone remain an AT&T exclusive? Engadget is reporting that Apple and AT&T signed a five-year deal that reportedly does not end till May 21st, 2012. Can Apple afford to keep the iPhone locked to a single U.S. carrier while Android adoption continues to rise?

Q1 2010 smartphone sales in the U.S.

Data from The NPD Group.


Looking For The Best Android Twitter Client? You May Want To Try Twitter’s (Yes, It’s Here)

Posted in Shared on April 30th, 2010 by herkulano – Be the first to comment

One of my major gripes with the Android platform is a lack of apps that are on-par with the iPhone. Sure, the total number of apps is getting up there, but for the most part, in my opinion, they’re nowhere near as good. One area where this was evident was with Twitter clients. While the iPhone has a number of great ones (led by Tweetie, which Twitter just bought), Android’s options are pretty weak. Seesmic is pretty nice, but wouldn’t be in the top 5 on the iPhone. Today, Twitter may have just solved this problem.

The service has just launched it’s own Android client. We noted they were working on it just a few weeks ago when CEO Evan Williams made the announcement at the company’s Chirp conference. Now, just over two weeks later, it’s here.

Twitter has just announced the client on its blog. When we first wrote about it, it wasn’t exactly clear how they would make it (all internally, or a partnership), now it appears that just as with the BlackBerry one, Twitter’s team of developers and designers worked closely with the Android team over at Google to get the client out there. But they also note that they’re hiring an Android engineer, so you can expect that person to be in charge of future versions.

Some cool-sounding features:

Twitter for Android is a fantastic application to use, and sharing any link or photo is super simple too – just look for the share button in your favorite application and choose Twitter.

Reading tweets is easy in a bunch of places on your phone. Quickly access your timeline with the home screen widget, view a tweet location on a map, and see your friend’s latest tweet in your phonebook, GoogleTalk list or any application that uses Android’s QuickContact bar.

It clearly looks as if thanks to Android’s more open nature, the Twitter client can be deeply integrated into your phone. For example, there’s a seamless way to sync with the contacts on your Android phone. For Twitter addicts, this level of integration is very nice. “This is just the beginning,” Twitter notes.

A word of warning, this client is apparently only for Android phones running version 2.1 and above of the software. For older Android phones, Twitter suggests using the standard mobile site.