Ajax

JFlubber! A Google Android Podcast Helper App

Tagged:  

Straight from the Android Developers Blog, we bring you an article by Dick Wall [Google Developer Programs] on his mission to port an existing Java app over to the Android platform. He discusses a important point about reconsidering the choices that were made when the app was originally developed as a desktop application. In particular, he realizes the need to refactor his use of the java.util.Timer class since it isn't very efficient in a mobile environment with limited resources.

JFlubber

The original application is a Java Swing and SE application. It is like a stopwatch with a lap timer that we use when recording podcasts; when you start the recording, you start the stopwatch. Then for every mistake that someone makes, you hit the flub button. At the end you can save out the bookmarked mistakes which can be loaded into the wonderful Audacity audio editor as a labels track. You can then see where all of the mistakes are in the recording and edit them out.


In the original version, the timer code looked like this:

class UpdateTimeTask extends TimerTask {
   public void run() {
       long millis = System.currentTimeMillis() - startTime;
       int seconds = (int) (millis / 1000);
       int minutes = seconds / 60;
       seconds     = seconds % 60;

       timeLabel.setText(String.format("%d:%02d", minutes, seconds));
   }
}

And in the event listener to start this update, the following Timer() instance is used:

if(startTime == 0L) {
   startTime = evt.getWhen();
   timer = new Timer();
   timer.schedule(new UpdateTimeTask(), 100, 200);
}

Fortunately, the role of Timer can be replaced by the android.os.Handler class, with a few tweaks. To set it up from an event listener:

private Handler mHandler = new Handler();

...

OnClickListener mStartListener = new OnClickListener() {
   public void onClick(View v) {
       if (mStartTime == 0L) {
            mStartTime = System.currentTimeMillis();
            mHandler.removeCallbacks(mUpdateTimeTask);
            mHandler.postDelayed(mUpdateTimeTask, 100);
       }
   }
};
private Runnable mUpdateTimeTask = new Runnable() {
   public void run() {
       final long start = mStartTime;
       long millis = SystemClock.uptimeMillis() - start;
       int seconds = (int) (millis / 1000);
       int minutes = seconds / 60;
       seconds     = seconds % 60;

       if (seconds < 10) {
           mTimeLabel.setText("" + minutes + ":0" + seconds);
       } else {
           mTimeLabel.setText("" + minutes + ":" + seconds);            
       }
     
       mHandler.postAtTime(this,
               start + (((minutes * 60) + seconds + 1) * 1000));
   }
};

For the full post, and more code, check out this article at the Android's Developer Blog and for more tips and an opportunity to ask questions, check out the Android Developers Group

Android

Silverlight Beginner's Tutorial

Tagged:  

Laurence Moroney over at Information Week has posted a great beginner's Silverlight tutorial that covers the following:

  • Your First Silverlight Application
  • Understanding XAML
  • Understanding the Blend series of Products
  • Building Silverlight applications using Aptana on the Mac
  • Building Silverlight applications using Visual Studio Express on the PC
  • Programming Silverlight 1.0 with JavaScript

Click here to start the tutorial

AJAXWorld 2008 East in New York

Tagged:  

AJAXWorld 2008 East will be held in New York on March 18-20, 2008. The focus of the conference is Rich Web Technologies for Enterprise Web 2.0 and Social Applications.

Topics, like these below, will be covered throughout the sessions at the conference:

• AJAX development IDEs: what are the alternatives?
• When it comes to accessibility, how do I know what's required?
• How can I make AJAX applications that easily go offline?
• How do you make a secure AJAX application?
• Are mashups really contributing to the experience of the Web?
• What's the difference between a mashup and a composite application?
• Am I better off using an AJAX framework, a toolkit or just coding?
• Is AJAX commoditized or will it be soon?
• Will AJAX be standardized in the form of widget APIs or declarative markup?
• What AJAX development tools are available for visual development today?
• How should you handle Web analytics and metrics for Rich Web sites?
• Do we really need JavaScript 2.0?
• How do you scale an AJAX-based design to a very large application?
• How can I harness the energy of my customer base online?
• On what timeline will AJAX skills become commoditized?

Technical sessions will cover challengers to AJAX such as new innovations like Silverlight and JavaFX. As well as performance and browser compatability issues, showcasing strategies for performing unit/stress testing on an AJAX application, and how you apply user interface patterns and user experience design to your AJAX project.

During the first day of the conference, there will be a full day track for an AJAX Security Bootcamp. The speakers, Billy Hoffman and Bryan Sullivan, are notable AJAX security experts and this will be the first ever full day AJAX Security Bootcamp at AJAXWorld. Click here for more information on the bootcamp or here for the whole conference.

AJAX + iPhone = Ultimate Shopping Gadget?

Tagged:  

Prixtag Logo

Yes, it's true. The folks over at Prixtag have put together an AJAX based product pricing comparison tool for the big names in online shopping, like: amazon, ebay, buy.com, overstock, google, etc...

They've produced an iPhone friendly version of the tool, that's optimized for the iPhone's screen size. I know what you're thinking... this is just in time for Black Friday!

Click here to visit the site and start comparing prices, so when you're shopping around Target & Best Buy at 4AM this Friday, you'll have a leg up on your competition.

JSValidate - Javascript Form Validation

Tagged:  

JS Validate

JSValidate is a form validator that utilizes aspects of prototype and scriptaculous to bring you a simple to execute, non-intrusive javascript form validator. With minimal setup, your forms can be processing clean data in no time at all.

What sets JSValidate apart from other similar scripts is the simplicity of it's setup. Another important characteristic is the importance of browser compatibilty. JSValidate is run through very thorough browser tests to ensure it works on any platform with any browser.

Client-side form validation is great. It saves a trip to the server and it provides users with immediate feedback on the content the've entered into a form. JSValidate is a javascript library that can be incorporated in any of your existing forms, or any new forms, and can provide you with some slick Web 2.0 style validation (No More Alert Boxes!). After including the library in your page, it's as easy as assigning specific class names to your form elements to enable the validation. Here is a short list of the classes that can be assigned to your form fields:

jsrequired - Field must have some sort of value.
jsvalidate_number - Any integer; accepts decimal and negative
jsvalidate_digits - Only Numbers
jsvalidate_alpha - Only letters
jsvalidate_alphanum - Only letters, numbers, and underscores.
jsvalidate_email - Any valid email address.
jsvalidate_uscanzip - US or Canada Zip code; Accepts optional US zip + 4
jsvalidate_usstate - Any 2 letter uppercase state of the United States.
jsvalidate_usphone - US Phone Number, accepts most common formats.
jsvalidate_creditcard - Validates VISA, MasterCard, American Express; formats: no spaces, spaces, or dashes.
jsvalidate_ssn - Social Security Number in the format: XXXXXXXXX, XXX XX XXXX, or XXX-XX-XXXXX
select-notfirst - This class can be applied to select boxes (drop-downs). It prohibits the user from selecting the first option from the list.

Click here to visit the JSValidate Homepage.

Or Here to check out the demo

Starbox - Shine Like a Star! (or atleast rate with them)

Tagged:  

Starbox

Starbox allows you to easily create all kinds of rating boxes using just one PNG image. The library is build on top of the Prototype javascript framework. For some extra effects you can add Scriptaculous as well.

Starbox Demo

Here are the options Starbox allows you to specify:

new Starbox(
  element,                  // the id of your element
  rating,                   // rating to start with
  {  
    background: false,      // or a css background to overwrite the one in class
    buttons: 5,             // the number of buttons (choices)
    className : 'default',  // or your own classname
    color: false,           // color of the colorbar
    duration: 0.6,          // duration of the effect across the bar, if used
    effect: { mouseover: false, mouseout: true } // or your own
    hoverClass: 'hover',    // or your own classname
    hoverColor: false,      // color of the colorbar when hovered
    identity: false,        // used on the return info
    indicator: false,       // adds an indicator after the starbox using a string,
                            // #{average}, #{max} and #{total} can be used.
                            // example: '#{average}/#{max} out of #{total} votes'
    inverse: false,         // true, false
    locked: false,          // true, false
    lockOnRate: true,       // true, false
    max: 5,                 // maximum rating, that of the last star
    onRate: false,          // or function(element, info){}
                            // info = { identity: identity,
                            //          rating: rating,
                            //          average: average,
                            //          max: max,
                            //          total: total
                            //        }
    overlay: 'default.png', // or other png in same folder as starbox.css
    stars: 5,               // the amount of stars
    total : 0               // the amount of votes cast
  }
);

For more information, and to download the Starbox library, click here to visit Nick Stakenburg's site.

Three Different Views on AJAX

Tagged:  

Click the image below

Three Different Views on AJAX

Google's AJAX Photo Slide Show

Tagged:  

Need a image slideshow to show off your Flickr, Picasa, PhotoBucket, or other photos?

Check out the new release of Google's AJAX Slide Show.
http://www.google.com/uds/solutions/slideshow/

Google API

Last month google released an update to their AJAX Slide Show application, created using their AJAX Feed API.

New in this release are:

  • The Full Control Panel
    This will give you a pause/play button, as well as forward and previous controls. The Full Control Panel will fade in and out on mouse events. The Full Control Panel will also auto-fade out when the mouse does not move for some period of time.
  • Animation and Pause Callbacks
    The Slide Show supports a number of callbacks which your application can use to alter its behavior and react to whats going on in the slide show. For instance, you might have a custom feed which requires that you compute the url of the image for an entry, or you might want to alter the click behavior to play an embedded movie when someone clicks on an image (instead of following a hyperlink). All of this is easy to setup using the Slide Show callbacks.
  • Position Bias for Images and Controls
    By default the Slide Show is configured to center the images to be displayed. It also automatically positions the controls, such as the pause image, approximately on the bottom 1/3 of the Slide Show. As an application, you can provide position bias to images, controls, or both, using the centerBias and pauseCenterBias properties of options. Bias is expressed as an object with topBias and leftBias, both expressed as offsets in pixels.

Here's an example slide show from Google's site:

Here's the link to the Slideshow homepage.

And the here's the link to the Programming Guide with sample code to get you on your way to building you're slideshow.

Akelos - Ruby on Rails port to PHP

Tagged:  

Akelos

Akelos is a PHP framework for developing database-backed web applications according to the Model-View-Controller pattern. It allows you to write views using Ajax, control requests and responses through a controller, manage internationalized applications, and communicate models and the database using simple conventions in a pure-PHP development environment built upon programming best practices. To go live, all you need to add is a database and a web server.

Who is the Akelos PHP Framework for?

  • PHP developers who want to enjoy writing web applications.
  • Ruby on Rails developers who need to code in PHP.
  • Developers who want to distribute their work to the mass market of cheap shared hosting.
  • Developers who need to write multilingual web applications.

Akelos based applications only require that PHP and a database be installed and configured on your server. This means you can host your apps with any hosting provider that supports PHP & MySQL, and the last time I checked that was 99.9% of hosting providers online.

Check out this screen cast: Creating a Blog in 20 Minutes using the Akelos PHP Framework

Here's a study that was conducted to compare different Ruby on Rails PHP frameworks like CakePHP, PHP on Trax, Akelos, and Code Igniter.

Symantec's Top 10 Internet Security Trends

Tagged:  

Here's the Top 10: 

10) Virtual machine security - hot powerful technology ripe for the hacking. Using the power and flexibility of virtual machines could take cyber crime to the next level.

9) Professionalization of cybercrime - money is being made off discovering vulnerabilities/hacks and auctioning those findings to the highest bidder.

8) Web plug-in vulnerabilities - ActiveX had a number of issues this year and plugins will continue to be a chink in our armor

7) Bots - hacking by proxy, using bots, to siphon protected information

6) Exploitation of trusted brands - especially in the form of emails from financial institutions (banks, credit unions, paypal, etc...)

5) Phishing - hackers throwing out some bait and hoping they'll catch some victims

4) Professional attack kits - making it even easier for attackers to cause trouble

3) SPAM - it's what's for dinner, and now it's coming in new flavors (pdfs, mp3, greeting cards, etc...)

2) Windows Vista - 16 security patches (and counting) since its introduction

and the #1 Internet Security Trend is............

1) Data Breaches - average cost per incident is in the hundreds of thousands and rising. TJMaxx, Monster.com, and Salesforce.com being hacked, as well as an estimated half a million vulnerable database servers, have made this the #1 Security Trend.

Read the full articles on these trends over at Information Week and Application Development Trends

Syndicate content