TwinTechs

Dream, Create, Deliver…

Twin Tech Guru Gus Holcomb Speaks at InsideMobile

August 2nd, 2009 Written by: julie.colwell · Android, Flash Catalyst, J2EE, Java, LiveCycle, Mobile Devices, News, RIA

Twin Technologies’ Gus Holcomb spoke at the first ever InsideRIA conference this week in San Francisco.  Java engineers interested in learning how to program iPhone apps came to hear his presentation.  

Gus says people are often intimidated by programming for the iPhone  because the language is weird and while there are a number of tools you can use, selecting the right one for what you want to do can be tricky.  Gus talked about what makes the iPhone  language different,  the language features you need to know about.  By using the right tools, what might initially look daunting, gets a lot easier when you look at how to link objects together.  

Gus showed two code examples… enough to get people to get out and start working on it, so they knew enough to start getting their programs out.   Since the audience was already fluent in Java, Gus used Java to prove concepts that appear tricky on the surface so he could relate them to familiar material.  

Look for Gus’ lunch and learn on iPhone development coming this fall!

→ No CommentsTags: ····

Twin Technologies Client ZapMyTV Enters Into VOD and SVOD License Agreement with Paramount Digital Entertainment

July 1st, 2009 Written by: julie.colwell · FLEX, Flash, Mobile Devices, RIA

Today, according to BusinessWire Twin Technologies’ partner and customer ZapMyTV has signed an agreement with Paramount Digital Entertainment to license content for live streaming broadcast across the Internet.  Under the agreement, viewers will have on demand access to Paramount’s vast library of movies and content.  Zap subscribers only have to access one web site to watch live television, view movies on-demand, search the internet, email, chat, video conference, and blogging. 

Viewers expect more control over their content and flexibility in where it’s consumed and how they share and discuss it.  To offer licensed, live cable TV to any streaming device, combined with social networking, interactive video, text and audio chat together in one place, Zap enlisted Twin Technologies to help create a multi-functional digital platform from the ground up using tools like Adobe Flash, Flex and ColdFusion.  This is the first web-based platform to offer live, fully licensed television over the Internet with picture-in-picture, recording capabilities and the ability to watch what you want, when you want it, wherever you are.

Before ZapMyTV, most TV content available on demand was pre-recorded and encoded into a format for viewing on a computer or mobile device. The few streams that are live are owned and managed by broadcast organizations, so users have to visit mul­tiple web sites for their favorite content.  Moreover, current platforms did not offer options for chatting or social networking with people watching different channels, and many required custom software that was limited by operating systems and browser.

ZapMyTV is currently in an early beta test period. Consumers may sign up for the beta at www.zapmytv.com. The site is currently streaming live cable channels, and at the time of its official public launch plans to have 50-100 channels in addition to Paramount’s theatrical motion picture content.

Zap is lining up additional content providers and studios, so viewers have lots of content to choose from.  This announcement is the first of several key strategic alliances with entertainment companies that ZapMyTV will announce in the near future.

Twin’s combined expertise in digital media and product manage­ment and development allowed us to get our product up and run­ning quickly,” says Steven Turner CEO of ZapMyTV.

→ No CommentsTags: ················

Automating meta-data extraction from video’s

June 29th, 2009 Written by: twintechs · LiveCycle, Mobile Devices, Security, Technical, Uncategorized, Web 3.0, writings

We recently had an internal project that required us to extract meta-data from video files.  We needed information such as the number of streams, length of the video, format, creator, encoding, and anything else we could gather.  This information was then stored in a database for the easy extraction and categorization of a large set of videos.

Twin has also recently started an internal streaming media framework using tools like Red5, Xuggler, and ffmpeg.  Using the expertise we gained with Xuggler, I decided to quickly write our own meta-data extractor. Later I decided on an even simpler solution.

The first method was to write our own meta-data extractor using Xuggler.  In order to use Xuggler, download and install it from http://www.xuggle.com/xuggler/downloads/.  In Linux, you will also need to add the XUGGLE_HOME/lib directory to the LD_LIBRARY_PATH environment variable so the native libraries are picked up by Java (Xuggler uses JNI to call its own C++ wrappers around ffmpeg).  The Windows installer does this automatically for you.

After Xuggler is installed, I cracked open the demos it had and modified one.  The code is very simple and required few changes.  The Java code is downloadable below.  Just make sure the xuggle-xuggler.jar (included in the XUGGLER_HOME/share/java/lib folder) is in your classpath before compiling and running it, and pass in a movie file as a command line parameter.  For example:

java com.twintechs.video.demo.GetMediaMetaData /path/to/your/video.mpg.

The output will be something along the lines of:
Opening video file: /home/dave/workspace/twin/MetaData/video/test.mpe
null (probesize):     32000
set mux rate (muxrate):     0
set packet size (packetsize):     0
null (fflags):     0x00000000
set the track number (track):     0
set the year (year):     0
how many microseconds are analyzed to estimate duration (analyzeduration):     3000000
decryption key (cryptokey):     §C,
max memory used for timestamp index (per stream) (indexmem):     1048576
max memory used for buffering real-time frames (rtbufsize):     3041280
print specific debug info (fdebug):     0x00000000
file "/home/dave/workspace/twin/MetaData/video/test.mpe": 2 streams; duration (ms): 53700; start time (ms): 149; file size (bytes): 11323804; bit rate: 1686972;
stream 0: type: CODEC_TYPE_VIDEO; codec: CODEC_ID_MPEG1VIDEO; duration: 4833000; start time: 13490; language: unknown; timebase: 1/90000; coder tb: 1/30; width: 432; height: 320; format: YUV420P; frame-rate: 30.00;
stream 1: type: CODEC_TYPE_AUDIO; codec: CODEC_ID_MP2; duration: 4810187; start time: 13490; language: unknown; timebase: 1/90000; coder tb: 1/90000; sample rate: 44100; channels: 2; format: FMT_S16

And a lot of other stuff.

The output is hard to make sense of, however, since it’s essentially in its rawest format.  Instead of painstakingly mapping each raw field to human-readable English, (for the record: not a good use of a consultant’s time!) I searched a little online for a pre-existing solution.  Not surprisingly, there were many.  The best one, which is also an open source project on SourceForge, was MediaInfo.

So, the second method of extracting data from source videos, which is a little easier but more limited because the program’s sole purpose is for info on media (e.g. you couldn’t play a video sample if you wanted), is to download and install MediaInfo.  The website is at http://mediainfo.sourceforge.net/en.  Download and install this on your platform, and then using either the GUI or the CLI (command line interface), you can see the available information of essentially any video.  For example, using the CLI, you can then type something like:

MediaInfo –Full “/path/to/your/video.mpg”

This will give a lot of information, most of which is human-readable. Then this information can be extracted using any of a number of methods, like Python or Perl text parsing, etc., and fed into a database for categorization.  And there you have it; two easy ways to extract every bit of information from a video file and categorize it for further use!

Here is a example file getmediametadata .

→ No CommentsTags:

SVP Robi Sen Guest Blogs for InsideRIA.com

May 14th, 2009 Written by: julie.colwell · AJAX, Android, Mobile Devices, News, RIA, Web 3.0, books, iPhone/iPod Touch

Senior Vice President and Managing Partner Robi Sen launched his blog series, Building Higher Performance RIAs for Smart Phones today on InsideRIA. The series will address the challenges of optimizing software for mobile platforms.

Today’s smart phones are not only used for making calls, taking pictures, and listening to music; now people are using their phones to do business, build presentations, make quick edits to important files, and even surf the web.

Yet contrary to what the commercials would have you believe, few smart phones provide a web experience equivalent even to a netbook. In large part this is because web application developers rarely consider the memory and CPU constraints of smart phones. At the same time, an increasing number of people are using their smart phones as a secondary or even primary method for accessing the web (http://www.theiphoneblog.com/2009/03/02/iphone-mobile-browser-share-67/). This becomes problematic because most websites are slow to download, hard to navigate for mobile users, and, most importantly, often take a long time to render, which is driving more and more mobile users away from the interactivity and power that Rich Internet Applications promise to deliver. The answer to this dilemma is that developers need to create RIAs, generally using AJAX, that are specifically designed and optimized for mobile phone users. In this series of blog posts, we are going to look at how to make applications that are not only rich and powerful, but respond quickly and offer users the experience they have come to expect from the web.

Leveraging its digital media and RIA expertise, Twin Technologies is creating web applications for the mobile platform.  These are optimized for use on mobile devices and offer the  functionality of desktop software and the agility of RIAs so users can access the material they need whenever they need it.

→ No CommentsTags: ·········

More SafariWatir additions: linkhandledbyjs

May 1st, 2009 Written by: Ryan Schutt · Mobile Devices, RIA, iPhone/iPod Touch

In our app, we use the jQuery tabs plugin to provide a JavaScript-driven tabs interface. The tabs themselves are a elements, and clicking on them hooks into the jQuery tab click handler to switch different content areas to be visible. Unfortunately, when trying to automate tests with SafariWatir, the test was not working when trying to click the tabs, because SafariWatir assumes a elements to always be traditional links with HREFs.

I was able to patch SafariWatir with a HtmlElement::linkhandledbyjs method for a elements like the jQuery tabs that aren’t traditional links, but are instead handled by JavaScript. Here’s the code:

# Add our linkhandledbyjs method to HtmlElement.  This is to be used
# for "a" elements that have their click event handled by JavaScript,
# as opposed to traditional "a" elements that follow their href attr.
module Watir
  module Container
    class LinkHandledByJS < Link
      def click
        @scripter.highlight(self) do
          click_element
        end
      end
    end

    def linkhandledbyjs(how, what)
      LinkHandledByJS.new(scripter, how, what)
    end

    class HtmlElement
      OPERATIONS = {
        :id => "by_id",
        :index => "by_index",
        :class => "by_class",
        :name => "by_name",
        :text => { "Link" => "on_link", "Label" => "by_text",
           "LinkHandledByJS" => "on_link" }, # add our class here
        :url => "on_link",
        :value => "by_input_value",
        :caption => "by_input_value",
        :src => "by_src",
      }
    end
  end
end

→ No CommentsTags:

Adding XPATH support for SafariWatir

April 28th, 2009 Written by: Ryan Schutt · Mobile Devices, RIA, iPhone/iPod Touch

Recently, I was tasked with writing automated functional tests for a web app we were developing. We first had to decide what platform/browser we wanted to test. The target platform for the app was actually an iPhone. As we knew of no tools to run automated functional tests on an iPhone, we decided the best approach would be to run our tests on Safari on  Mac. The tool we picked to develop the tests was SafariWatir, a port of the Watir tool to OS X on Mac driving Safari.

Everything seemed well until I realized that SafariWatir does not support retrieving elements from the browser document via XPATH. This was a significant minus. Not having XPATH support means test writers have to look up the document element they need by id, element text, or some other less flexible method. Furthermore, one cannot rely on elements always having ids or unique names defined.

Fortunately, we have XPATH to solve this problem. Safari has native JavaScript support for resolving XPATH to select document elements, so it was relatively easy to patch SafariWatir to allow us to fetch elements via XPATH:

# Add xpath support.  Example:
#
# @browser.text_field(:xpath, "/html/body/div[2]")
module Watir
  module Container
    class HtmlElement

      OPERATIONS = {
        :id => "by_id",
        :index => "by_index",

        :class => "by_class",
        :name => "by_name",
        :text => { "Link" => "on_link",
          "Label" => "by_text" },

        :url => "on_link",
        :value => "by_input_value",
        :caption => "by_input_value",

        :src => "by_src",
         :x path => "by_xpath"  # add xpath here

      }
    end
  end
  class AppleScripter
    # add method to allow us to fetch elements via XPATH
    def operate_by_xpath(element)

      js.operate(%|
var result = document.evaluate('#{element.what}',
                    document.documentElement,
                    null,
                    XPathResult.FIRST_ORDERED_NODE_TYPE,
                    null);
var element = result ? result.singleNodeValue : null;|,
      yield)
    end
  end
end

Now we can easily fetch almost any element in the DOM using XPATH expressions. For example, there were multiple forms on my page, all with a classification of “select-form”, and I had to find the one with an input named “userId”. This was simple using XPATH:

@browser.form( :x path,
  '//form[@class="select-form"]/input[@name="userId"]/..')

Imagine trying to accomplish the same thing without XPATH.

→ 1 CommentTags:

Unlocking Android Available

April 27th, 2009 Written by: Robi Sen · Android, Mobile Devices, Uncategorized

 

Twin Technologies’ Robi Sen and Jesse Dailey have both recently finished work on the book “Unlocking Android” from Manning press. Robi was a co-author (along with Charlie Collins and Frank Ableson) and Jesse was the technical editor. Unlocking Android is currently the most up-to-date discussion of Google’s Android SDK and covers SDK 1.+. Amazon is now taking orders that should ship around April 28th, or you can just pop into your local book store and pick up a copy. If you’re interested in developing on Android, check the book out and please let us know what you think of it.

→ No CommentsTags:

Unlocking Android Sample Code

December 25th, 2008 Written by: Robi Sen · Android, Mobile Devices, books, writings

Charlie Collins, has setup a Google Code project with updated source for the Unlocking Android book here.  There are several really interesting projects in the source and all the code is running and working on the lattest 1.0 builds of the SDK.  Whats great is the authours will be actively updating the code and you can leave comments at the Manning forum if you find issues.

→ No CommentsTags: ····

Frame by Frame XML Animation with Google Android

June 23rd, 2008 Written by: Robi Sen · Android, Mobile Devices

One major issue I ran into when working on the new manning book, Unlocking Android, was trying to use the Google Android Frame by Frame animation example and API from Google. It appears to be outdated and several people seemed to be having this issue. Frank Abelson, the main author, lent me a hand and updated my code to work well. Here is the source so hopefully others can overcome their problems with the API (note I am we are using the latest version of the SDK (m5-rc15). Anyways here is the code and the actual Eclipse project is attached.

 

 simple_animation.xml

 <?xml version=”1.0″ encoding=”utf-8″?>
<animation-list xmlns:android=”http://schemas.android.com/apk/res/android” id=”selected” android:oneshot=”false”>
<item android:drawable=”@drawable/ball1″ android:duration=”50″ />
<item android:drawable=”@drawable/ball2″ android:duration=”50″ />
<item android:drawable=”@drawable/ball3″ android:duration=”50″ />
<item android:drawable=”@drawable/ball4″ android:duration=”50″ />
<item android:drawable=”@drawable/ball5″ android:duration=”50″ />
<item android:drawable=”@drawable/ball6″ android:duration=”50″ />
</animation-list>

 Main.xml

<?xml version=”1.0″ encoding=”utf-8″?>
<LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
>
<ImageView android:id=”@+id/simple_anim”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:gravity=”center”
android:layout_centerHorizontal=”true”
/>
<TextView
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:text=”Hello World, XMLAnimation”
/>
</LinearLayout>

 

XMLAnimation.java 

package com.msi.manning.chapter10.xmlanimation;

import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;
import java.util.Timer;
import java.util.TimerTask;

public class XMLAnimation extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);

ImageView img = (ImageView)findViewById(R.id.simple_anim);
img.setBackground(R.anim.simple_animation);

MyAnimationRoutine mar = new MyAnimationRoutine();
MyAnimationRoutine2 mar2 = new MyAnimationRoutine2();

Timer t = new Timer(false);
t.schedule(mar, 100);
Timer t2 = new Timer(false);
t2.schedule(mar2, 5000);

}

class MyAnimationRoutine extends TimerTask
{
MyAnimationRoutine()
{
}

public void run()
{
ImageView img = (ImageView)findViewById(R.id.simple_anim);
// Get the background, which has been compiled to an AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();

// Start the animation (looped playback by default).
frameAnimation.start();
}
}

class MyAnimationRoutine2 extends TimerTask
{
MyAnimationRoutine2()
{
}

public void run()
{
ImageView img = (ImageView)findViewById(R.id.simple_anim);
// Get the background, which has been compiled to an AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();

// stop the animation (looped playback by default).
frameAnimation.stop();
}
}
}

XML Animation

→ No CommentsTags: