A moment ago i have a problem about how to get Home Line or status from a group users list in my Air Application and sort them by date ascending. My analyst is if an account has 20 tweets but the group has 10 users, it means that i have to sort 200 list. Why don't use SortOn for Array? If you try myArray.SortOn("date",[Array.CASE_SENSITIVE, Array.UNIQUE ]), it can't sort date (string type in twitter) very well, we have to convert them from string to millisecond, and it will take time, maybe crashed.
My idea is, unite them in a list in customer twitter account then get the list status, make sense, no ? For this case i use library from Sandro (Thanks Dude) , which is named tweetr, badly no more example about create list like my case. When i read the documentation, it seems simple, but the process is not like that. The list status, only can pull status of users which are public, so if it is protected you can't pull them.
Here is the sample of my work, you can try by clicking the demo link below (this sample not stores your twitter login ^_^), the demo is in flex version, but you can convert it to Air easily.
DEMO
SOURCE (Flex)
How To Create List & Add User Twitter in Flex and Air
6:33 AM
Reinhart
Develop SmartPhone Using RhoHub
3:25 PM
Reinhart
- Debugging Console : Use the collapsible console to quickly view output from your RhoSync source adapters.
- File Manager : Navigate and modify your app's files in a simple view.
- Rich Editor : Use the powerful Ruby/HTML/CSS/Javascript editor right from your browser, or work locally and upload your app.
- Text Search : Search for text in all files of your app.
- Toolbar & Quick Links : Access all of RhoHub's productivity tools right from the editor.
What you can do in RhoHub ?
Generate Objects
You will describe a set of objects that your app uses by providing names of their attributes. RhoHub will then generate client side controller and views to work with this information. Specifically it will provide HTML templates for the interfaces and a Ruby-based controller for manipulating those objects. RhoHub will also generate a server side "source adapter" with empty query, create, update and delete methods that you can use to synchronize information with some backend service.Edit Client Code
From the Client tab you can see all components of your app that are used to generate the app running on the device. RhoHub provides a fully functional CRUD (create, read, update, delete) UI for your app. This is a set of Rhodes framework views (HTML templates) and a Ruby based controller. But you will likely want to customize the interface further. You can now edit the HTML/CSS/Javascript interface, or the Ruby controller code (controller.rb) that has your app's business logic.Edit Server Code
From the Server tab, you can also edit the backend source adapter to add synchronized data to your app. A copy of the RhoSync server on RhoHub will then execute your source adapter. Note that this step is not actually required. Before you test the source adapter (by clicking Show Records) you will want to subscribe a user to the app. A link is provided to remind you to do that if necessary. By clicking on Show Records, the RhoHub-provided RhoSync server will execute the query method of your source adapter. If there are errors with your source adapter, they will be displayed in a console above the editor.Build For Your Device
From the build screen you can choose your target smartphone OS and RhoHub will run a build job for you. Generally builds take about a minute to complete. By downloading one of the simulators that we provide links to you can test your smartphone app locally by downloading the build. If you want to accelerate the time to see the results of your code, you can download the Rhodes desktop simulator if you are running Windows or Mac OSX. From the desktop simulator you can then use the "Refresh Bundle" option to instantly test code changes made in the RhoHub IDE.List and read files and directories in a zip file
7:32 AM
Reinhart
First of all you should download library here
And then short play with script below
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import nochump.util.zip.ZipEntry;
import mx.events.ListEvent;
import nochump.util.zip.ZipFile;
[Bindable]private var _zipFile:ZipFile;
[Bindable]private var _file:File;
private function browseFile():void{
var _file:File = new File();
_file.browseForOpen("Open.", getTypes());
_file.addEventListener(Event.SELECT, fileSelected);
}
private function getTypes():Array {
var allTypes:Array = new Array(getImageTypeFilter());
return allTypes;
}
private function getImageTypeFilter():FileFilter {
return new FileFilter("ZIP File", "*.zip");
}
private function setFileInfo(name:String, size:uint):void {
zipFileLabel.text = "Archive: " + name + " (" + sizeFormatter.format(size) + " bytes)";
}
private function fileSelected(event:Event):void {
_file = event.currentTarget as File;
var urlStream:URLStream = new URLStream();
urlStream.addEventListener(Event.COMPLETE, completeHandler);
urlStream.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
urlStream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
urlStream.load(new URLRequest(_file.nativePath));
}
private function completeHandler(event:Event):void {
var data:URLStream = URLStream(event.target);
setFileInfo(_file.name, data.bytesAvailable);
_zipFile = new ZipFile(data);
}
private function errorHandler(event:ErrorEvent):void {
Alert.show(event.text);
}
private function itemClickEvent(event:ListEvent):void {
var entry:ZipEntry = event.currentTarget.selectedItem as ZipEntry;
if(entry) taEntryData.text = String(_zipFile.getInput(entry));
}
private function labelSize(item:Object, column:DataGridColumn):String {
return sizeFormatter.format(item[column.dataField]);
}
private function labelModified(item:Object, column:DataGridColumn):String {
return dateFormatter.format(new Date(item.time));
}
private function labelCrc(item:Object, column:DataGridColumn):String {
return item.crc.toString(16).toUpperCase();
}
]]>
</mx:Script>
<mx:NumberFormatter id="sizeFormatter" useThousandsSeparator="true" />
<mx:DateFormatter id="dateFormatter" formatString="MM/DD/YYYY L:NN A" />
<mx:Panel title="Zip Demo" height="100%" width="100%">
<mx:Label id="zipFileLabel" />
<mx:VDividedBox width="100%" height="100%">
<mx:DataGrid id="dgEntries" width="100%" height="100%" dataProvider="{_zipFile.entries}" itemClick="itemClickEvent(event);">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name" width="300" />
<mx:DataGridColumn headerText="Size" dataField="size" labelFunction="labelSize" />
<mx:DataGridColumn headerText="Packed" dataField="compressedSize" labelFunction="labelSize" />
<mx:DataGridColumn headerText="Modified" labelFunction="labelModified" width="150" />
<mx:DataGridColumn headerText="CRC32" labelFunction="labelCrc" />
</mx:columns>
</mx:DataGrid>
<mx:TextArea id="taEntryData" width="100%" height="100%">
</mx:TextArea>
</mx:VDividedBox>
<mx:ControlBar>
<mx:Spacer width="100%"/>
<mx:HBox>
<mx:Form>
<mx:FormItem label="Open Zip File:" width="100%" styleName="lblForm" required="true">
<mx:Button id="btnBrowse" label="Browse" click="{browseFile()}"/>
</mx:FormItem>
</mx:Form>
</mx:HBox>
</mx:ControlBar>
</mx:Panel>
</mx:WindowedApplication>
Posted in
Flex
Anti Distorted resolution picture when resizing
7:13 AM
Reinhart
If you resize picture by defining new width or height from normal size, you will get the picture resolution's distorted or broken quality. There's a method how to make the picture keeps soft and smooth.
Create a utility class
package com.jackBite.utils
{
import mx.controls.Image;
import flash.display.Bitmap;
public class CleanImage extends Image
{
/*public function CleanImage()
{
}*/
override protected function updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void
{
super.updateDisplayList(unscaledWidth, unscaledHeight);
if(content is Bitmap)
{
var bmp:Bitmap = Bitmap(content);
if(bmp && bmp.smoothing == false)
bmp.smoothing = true;
}
}
}
}
In MXML Component, You Put this
<utils:CleanImage id="feedLogo" height="30" source="{_imageRss}"/>
Posted in
Flex
How To add image into any Textinput
2:09 AM
Reinhart
You maybe want to add image or icon like magnifiying icon in textInput of your flex, Here i have some method how you can do that :
Create AS Component
package nebula.utils
{
import mx.controls.Image;
import mx.controls.TextInput;
public class SearchTextInput extends TextInput
{
public function SearchTextInput()
{
}
override protected function createChildren():void
{
super.createChildren();
var searchImg:Image = new Image();
searchImg.source = Images.search_icon;
searchImg.width=12;
searchImg.height=12;
searchImg.x = 2;
searchImg.y = 3;
setStyle("paddingLeft",searchImg.width+2);
addChild(searchImg);
}
}
}
in mxml component you put this:
<utils:SearchTextInput text="enter professional name ..." id="searchPro" click="{searchPro.text = ''}" width="200"/>
Another Alternative (sometime not work)
<mx:HBox>
<mx:TextInput id="myTextInput" />
<mx:Images source="{your_image_url}" paddingLeft="6" />
</mx:HBox>
Posted in
Flex
Hacking Zindus (ThunderBird Add-On)
1:53 AM
Reinhart
Zindus is a thunderbird add-on to import your google contact to thunderbird. The problem of zindus is not shown the first_name and last_name, address and organization if you use google data V.3
Let's see how it works:
1. Download Zindus from your ThunderBird.
2. Open the xpi file using winRar/7zip and extract the file.
3. Go to folder 'chrome' and then extract zindus.jar using WinRar/7zip
4. After you extract the JAR, go to folder content/zindus/
5. Open const.js and find 'const GD_API_VERSION ' and then change the value tobe "3"
6. Open contactgoogle.js and after that replace all with my script from this url: http://pastie.org/879955
7. archive the changes file to zindus.jar and archive back zindus.jar to xpi using 7zip or WinRar(drag and drop the xpi root folder to opened xpi in winRar)
8. Install it into your thunderbird and start import the google document
9. Binggo ^o^ address now display well and also organization and your first & last name.
Posted in
Import contact information in Google Spreadsheet To Google Contact Using Rake
12:04 AM
Reinhart
This March, I had a sexy task to import all employees and departments contacts information which were stored in Google Spreadsheet into Google contact.
A dummy people will think to pay data entry for entering them through google contact form. Whoa.. if i were a data entry, i would have had broken fingers after entering all data. Any way, I found a shortcut to import all data in only seconds or minutes, that is; make a robot to enter all data when we have a lunch.
Now, let's prepare the tools :
1. Installed Ruby on Rails Application
2. gem install gdata
3. gem install google-spreadsheet-ruby
4. open any text editor
Create Basic Rake Frame
namespace :db do
desc "GS2C: Google spreadsheet to Google contact"
task :gs2c => :environment do
require 'gdata'
require 'google_spreadsheet'
#Here will be some sexy scripts
end
end
Here it is, The Robot
namespace :db do
desc "GS2C: Google spreadsheet to Google contact"
task :gs2c => :environment do
require 'fastercsv'
require 'gdata'
require 'google_spreadsheet'
#sample spreadsheet URL
#https://spreadsheets.google.com/a/kiranatama.com/ccc?key=0AlQZq7IIjE6UdF92SkhRazlYaVFUWFNYZGxxLWpoT0E&hl=en
#settings
@spreadsheet_key = "0AlQZq7IIjE6UdF92SkhRazlYaVFUWFNYZGxxLWpoT0E"
login_config = YAML.load_file("#{RAILS_ROOT}/config/google_login.yml")[RAILS_ENV]
login_config["google"].each { |key, value| instance_variable_set("@#{key}", value) }
def create_spreadsheet_connector
@google_spreadsheet = GoogleSpreadsheet.login(@email_contact, @password_contact)
create_contact_connector
end
def create_contact_connector
@google_contact = GData::Client::Contacts.new({
:authsub_scope => 'http://www.google.com/m8/feeds/',
:source => 'google-DocListManager-v1.1',
:version => '3.0'})
@google_contact.clientlogin(@email_contact, @password_contact)
create_contact_entry
end
def create_contact_entry
@contact_entry = <<-EOF
<atom:entry xmlns:atom='http://www.w3.org/2005/Atom'
xmlns:gd='http://schemas.google.com/g/2005'>
<atom:category scheme='http://schemas.google.com/g/2005#kind'
term='http://schemas.google.com/contact/2008#contact' />
EOF
start_load_csv
end
def start_load_csv
@spreadsheet = @google_spreadsheet.spreadsheet_by_key(@spreadsheet_key)
#Sample Row Header / First Row
#First Name | Last Name | Email | Work Phone | Home Phone | Address | City | State | Country | ZIP
#You have to skip first row and blank row
i = 0
@spreadsheet.worksheets do |row|
if i < 1
i++
return
end
@google_contact.post( 'http://www.google.com/m8/feeds/' + 'contacts/default/base?v=3', create_google_contact(row,i))
i++
end
end
def create_address(address,city,state,country,zip)
address = <<-EOF
<gd:postalAddress rel='http://schemas.google.com/g/2005#home' primary='true'>
#{address}
#{city}
#{state}, #{zip}
#{country}
</gd:postalAddress>
EOF
return address
end
def create_google_contact(row,i)
first_name = row[i, 1].blank? ? "---" : row[i, 1]
last_name = row[i, 1].blank? ? "---" : row[i, 2]
email = row[i, 3].blank? ? "---" : row[i, 3]
work_phone = row[i, 4].blank? ? "---" : row[i, 4]
home_phone = row[i, 5].blank? ? "---" : row[i, 5]
address = row[i, 6].blank? ? "---" : row[i, 6]
city = row[i, 7].blank? ? "---" : row[i, 7]
state = row[i, 8].blank? ? "---" : row[i, 8]
country = row[i, 9].blank? ? "---" : row[i, 9]
zip = row[i, 10].blank? ? "---" : row[i, 10]
full_name = first_name + last_name
data = <<-EOF
#{@contact_entry}
<title>#{full_name}</title>
<atom:content type='text'>#{contact.note}</atom:content>
<gd:name>
<gd:fullName>#{full_name}</gd:fullName>
<gd:givenName>#{first_name}</gd:givenName>
<gd:familyName>#{last_name}</gd:familyName>
</gd:name>
<gd:email primary='true' rel='http://schemas.google.com/g/2005#home' address='#{email}'/>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#home'>#{home_phone}</gd:phoneNumber>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#work'>#{work_phone}</gd:phoneNumber>
#{create_address(address,city,state,country,zip)}
</atom:entry>
EOF
return data
end
create_spreadsheet_connector
end
end
Command Line : rake db:gs2c or rake -T
Posted in
Ruby
Create and Update Google Contact from Ruby without Batch
5:34 PM
Reinhart
There's less information about ruby on rails method in google contact. I would like to share you about how to export new google contact / create new google contact from our table contacts through Ruby.
in my contacts_controller.rb, i wrote this script
class ContactsController < ApplicationController
require 'yaml'
require 'cgi'
before_filter :prepare_google_contact, :expect => [:create, :update]
CONTACTS_SCOPE = 'http://www.google.com/m8/feeds/'
def create
@contact = Contact.new(params[:contact])
respond_to do |format|
if @contact.save
feed = @google_contact.post( CONTACTS_SCOPE + 'contacts/default/base', google_contact(@contact)).to_xml
@contact.update_attribute(:google_contact_id, feed.elements['id'].text)
flash[:notice] = 'Contact was successfully created.'
format.html { redirect_to(@contact) }
format.xml { render :xml => @contact, :status => :created, :location => @contact }
format.fxml { render :fxml => @contact }
else
format.html { render :action => "new" }
format.xml { render :xml => @contact.errors, :status => :unprocessable_entity }
format.fxml { render :fxml => @contact.errors }
end
end
end
# PUT /contacts/1
# PUT /contacts/1.xml
# PUT /contacts/1.fxml
def update
@contact = Contact.find(params[:id])
@saved = @contact.update_attributes(params[:contact])
respond_to do |format|
if @saved
@google_contact.headers = {'If-Match'=>'*'}
feed = @google_contact.put(@contact.google_contact_id,
create_google_contact(@contact.reload())).to_xml
flash[:notice] = 'Contact was successfully updated.'
format.html { redirect_to(@contact) }
format.xml { head :ok }
format.fxml { render :fxml => @contact }
else
format.html { render :action => "edit" }
format.xml { render :xml => @contact.errors, :status => :unprocessable_entity }
format.fxml { render :fxml => @contact.errors }
end
end
end
private
def prepare_google_contact
contact_setup = YAML.load_file("#{RAILS_ROOT}/config/contact.yml")
contact_setup["google"].each { |key, value| instance_variable_set("@#{key}", value) }
@google_contact = GData::Client::Contacts.new({
:authsub_scope => 'http://www.google.com/m8/feeds/',
:source => 'google-DocListManager-v1.1',
:version => '3.0'})
session[:token_contact] = @google_contact.clientlogin(@email_contact, @password_contact)
@contact_entry = <<-EOF
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:contact="http://schemas.google.com/contact/2008"
xmlns:gd="http://schemas.google.com/g/2005">
<category term='http://schemas.google.com/contact/2008#contact'
scheme='http://schemas.google.com/g/2005#kind'/>
EOF
session[:token_contact] = @google_contact.clientlogin(@email_contact, @password_contact)
end
def google_contact(contact)
data = <<-EOF
#{@contact_entry}
<title>#{contact.first_name}</title>
<content>#{contact.note}</content>
<gd:name>
<gd:fullName>#{contact.first_name}</gd:fullName>
</gd:name>
<gContact:birthday when='#{contact.birth_day}'/>
<gd:email primary='true' rel='http://schemas.google.com/g/2005#home' address='#{contact.email}'/>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#mobile'>#{contact.mobile}</gd:phoneNumber>
<gd:phoneNumber rel='http://schemas.google.com/g/2005#work'>#{contact.phone}</gd:phoneNumber>
<gd:structuredPostalAddress rel='http://schemas.google.com/g/2005#home'>
<gd:formattedAddress>#{contact.street}
#{contact.city}
#{contact.province}, #{contact.zipcode}
#{contact.country}
</gd:formattedAddress>
</gd:structuredPostalAddress>
</entry>
EOF
return data
end
end
in this study case I put my login google information in config/contact.yml file like this :
google:
email_contact: yacobus.r@kiranatama.com
password_contact: dec.07.1982
and here is my contact migration script lines :
class CreateContacts < ActiveRecord::Migration
def self.up
create_table :contacts do |t|
t.string :first_name
t.string :middle_name
t.string :last_name
t.string :phone
t.string :mobile
t.string :email
t.string :street
t.string :province
t.string :zipcode
t.string :city
t.string :country
t.string :note
t.string :type
t.string :google_contact_id
t.timestamps
end
end
def self.down
drop_table :contacts
end
end
and of course you have to install gem install gdata
Do not confuse about "format.fxml" this is respond data type for Restfulx (Flex/Air Framework).
Simple right !! but when this written's published, google still not release how to create and update trough ruby on rails. And many developer stucked because google provided create and update contact trough Batch method.
Posted in
Ruby
Basic Authentication in Flex or Air
11:41 AM
Reinhart
After discussing about AuthSub and ClientLogin in Google in Flex or Air, now I would like to step forward about Basic authentication in Flex or Air. To know more about Basic Authentication please browse to this link https://mail.google.com/mail/feed/atom/all , you will be asked by pop up window to enter your login information right? now let we see how to handle it :
<mx:VBox
xmlns:mx = "http://www.adobe.com/2006/mxml"
width = "100%"
height = "100%"
verticalAlign = "middle"
horizontalAlign = "center"
backgroundColor = "#364a59"
creationComplete= "{creationHandler()}"
>
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.mxml.HTTPService;
import mx.utils.*;
private function creationHandler():void{
gmailService.headers = {Authorization:"Basic " + basicAuth()};
gmailService.url = "https://mail.google.com/mail/feed/atom/all"
gmailService.contentType = "application/x-www-form-urlencoded"
gmailService.resultFormat = "e4x"
gmailService.addEventListener(ResultEvent.RESULT, feedSuccess);
gmailService.addEventListener(FaultEvent.FAULT, faultHandler);
gmailService.send(); //Update Here
}
private function basicAuth():String{
var encoder:Base64Encoder = new Base64Encoder();
encoder.insertNewLines = false;
encoder.encode("yacobus.r@kiranatama.com:Dec.07.1082"));
return String(encoder);
}
private function feedSuccess(event:ResultEvent):void{
//Do any logic for feed result here
trace(XML(event.result))
}
private function faultHandler(event:FaultEvent):void{
}
]]>
</mx:Script>
<mx:HTTPService id="gmailService" showBusyCursor="true"/>
</mx:VBox>
Perfect right!!
AuthSub Authentication on Flex or Air
10:13 AM
Reinhart
There are 3 types of authentication on when you are accessing website nowdays, they are :
- AuthSub / ClientLogin authentication, this authentication uses credential login information and give back to you authentication token that will be used on header as security login token to make you available login in 24 hours.
- OAuth authentication, this authentication is using secret key and customer key, more secure than AuthSub, this kind authentication will use your token and secret token in header Authentication information to identify you are the valid user when accessing secure data or page.
- Basic Authentication, if you see pop up alert that ask you to enter username or password, that is Basic Authentication.
Now, try access this page : http://docs.google.com/feeds/documents/private/full
You will see error like this Authorization required, Error 401. These scripts all you need to pass the authentication easily :
you can use
<mx:VBox
xmlns:mx = "http://www.adobe.com/2006/mxml"
width = "100%"
height = "100%"
verticalAlign = "middle"
horizontalAlign = "center"
backgroundColor = "#364a59"
creationComplete= "{creationHandler()}"
>
<mx:Script>
<![CDATA[
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.mxml.HTTPService;
import mx.utils.*;
private function creationHandler():void{
var data:Object = new Object;
data.Email = "yacobus.r@kiranatama.com";
data.Passwd = "Dec.07.1082"
data.accountType = "GOOGLE";
data.service = "writely";
//ClientLogin Url : https://www.google.com/accounts/ClientLogin
//AuthSub Url : https://www.google.com/accounts/AuthSubRequest
gmailService.url = "https://www.google.com/accounts/ClientLogin";
gmailService.contentType = "application/x-www-form-urlencoded";
gmailService.method = "POST";
gmailService.request = data;
gmailService.addEventListener(ResultEvent.RESULT, successHandler);
gmailService.addEventListener(FaultEvent.FAULT, faultHandler);
gmailService.send();
}
private function successHandler(event:ResultEvent):void{
gmailService.removeEventListener(ResultEvent.RESULT, new Function);
var txtAuth:String = String(event.result);
var authPosition:int = txtAuth.search("Auth");
txtAuth = txtAuth.substring(authPosition);
txtAuth = txtAuth.replace("Auth=","");
authPosition = txtAuth.length;
authPosition = authPosition - 1;
txtAuth = txtAuth.substring(0,authPosition);
accessProtectedUrl(txtAuth);
}
private function accessProtectedUrl(txtAuth:String):void{
gmailService.headers = {Authorization:"GoogleLogin auth="+txtAuth};
gmailService.url = "http://docs.google.com/feeds/documents/private/full";
gmailService.method = "GET";
gmailService.addEventListener(ResultEvent.RESULT, feedSuccess);
gmailService.addEventListener(FaultEvent.FAULT, faultHandler);
}
private function feedSuccess(event:ResultEvent):void{
//Do any logic for feed result here
trace(XML(event.result))
}
private function faultHandler(event:FaulttEvent):void{
}
]]>
</mx:Script>
<mx:HTTPService id="gmailService" showBusyCursor="true"/>
</mx:VBox>
List of Google Apps Service : http://code.google.com/apis/base/faq_gdata.html#clientlogin
Posted in
ActionScript,
Air,
Flex
How to make Air Application become iPhone SDK
12:45 PM
Reinhart
Adobe air is great and smooth desktop application, many developers of Air dream their application can be installed into iPhone SDK. Now that dream come true. Thanks to my friend auraAnar for this great information :
First thing you do is downloading editor Eclips (like Flex Builder) from openplug.com, once you have successfully download it, create new project, in this show case i would to create sample parking searcher based on google Map for iPhone SDK.

Preview builder application
- Create WindowedApplication example project name is parkingApp.mxml
- Design indexView for iPhone application, let's called it as indexView.mxml (click the link)
- For component you can use mx:xxx like Flex or Air, but for control you should use mob:xxx from openPlug. Take a look my textinput Here
- Here is the screenshot of iPhone Emulator :
Once you success compiling your script without error, you need XCode of Apple to compile your script to iPhone SDK, i am using this way to compile my script in XCode. Happy iPhoning.
PS: I've tried commiting my script to google codes but it seems the google SVN is under maintenance, once it works i will upload the sample codes. Here is the address:
svn checkout http://airiphone.googlecode.com/svn/trunk/
AutoLogin to google account in Air without Oauth
10:30 AM
Reinhart
i believe a part number of you there want their application allow the user to enter google account credential information to access the page, right? It's like i were faced off in my project. So how we will do it ?
If you use webservice, here's the information you should send to air application :I believe to access protected google page it will asked thridparty login, right? Note: OAuth, AuthSub and ClientLogin will not allow you to remote interface specially page after login google. In this case i create a component which is called GoogleBrowser.mxml and here the codes:
Google Account Credential Information and CallBack Url (the next url you want go after login)
<?xml version="1.0" encoding="utf-8"?>
<mx:Window xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
width="600" height="600" backgroundColor="#242424"
creationComplete="init()" >
<mx:Script>
<![CDATA[
private var googleUserName:String = "yacobus.r@kiranatama.com";
private var googlePassword:String = "i_love_u";
private var nextUrl:String = "http://docs.google.com/a/kiranatama.com/Doc?docid=0AWbobJ8BSfPlZGcyaGtiYmJfMjlkajlwc3hncw&hl=en";
private function init():void{
browserStack.selectedIndex = 1;
gdocHtml.addEventListener(Event.COMPLETE, onCompleteHandler);
gdocHtml.location = nextUrl;
}
private function onCompleteHandler(event:Event):void{
gdocHtml.removeEventListener(Event.COMPLETE, removeListenerHandler);
var additionalScript:String = '<script type="text/javascript">\n'+
"gaia_setFocus();\n" +
"document.gaia_loginform.submit();\n"+
"</script>";
var username:String = googleUserName.split("@")[0];
var body:String = String(event.target.htmlLoader.window.document.body.innerHTML);
body = body.replace('id="Passwd"','id="Passwd" value="'+googlePassword+'" ');
body = body.replace('value="" class','value="'+username+'" class"');
body = body + addScript;
gdocHtml.htmlLoader.window.document.body.innerHTML = body;
browserStack.selectedIndex = 0;
}
private function removeListenerHandler(event:Event):void{
event.stopPropagation();
}
]]>
</mx:Script>
<mx:ViewStack id="browserStack" width="100%" height="100%">
<mx:Canvas width="100%" height="100%">
<mx:HTML width="100%" height="100%" id="gdocHtml" />
</mx:Canvas>
<mx:Text id="loadingText" text="Loading ..." />
</mx:ViewStack>
</mx:Window>
Posted in
Action Script,
Air,
Flex

