A new player to the desktop RIA playground?
Labels: AIR, desktop, google, Prism, ria, SliverLight, webkit
Rumor, crap and unoriginal | 谣言、扯淡、非原创
Labels: AIR, desktop, google, Prism, ria, SliverLight, webkit
MySpace China has opened its developer platform to some beta testers. Similar to Facebook Platform, the dev zone has a list of APIs, some language wrappers(only ActionScript for now) for the API and a test console. Detailed comparison follows:
| MySpace | ||
|---|---|---|
| RESTful API | yes | yes (see below) |
| Query | FQL | n/a |
| Markup | FBML + FBJS | n/a |
| Test Console | yes | yes |
| Authentication | own protocol | OAuth |
| SDK | 15+ | 1 for now |
Generally, I appericiate their picking up of OAuth. But the number of objects and functions accessible via API is too much fewer than Facebook's. OpenSocial API to push activities is still on its way either.
Well, for MySpace, opening is a big step, but too early to give them a bravo.
The OAuth protocol enables websites or applications (Consumers) to access Protected Resources from a web service (Service Provider) via an API, without requiring Users to disclose their Service Provider credentials to the Consumers. More generally, OAuth creates a freely-implementable and generic methodology for API authentication.
OAuth协议致力于使网站和应用程序(统称为消费方)能够在无须用户透露其认证证书(译注:如登录密码)的情况下,通过API访问某个web服务(统称为服务提供方)的受保护资源。更一般地说,OAuth为API认证提供了一个可自由实现且通用的方法。
Official Document in English / My Translation in Chinese (中文版附录暂未翻译)
Labels: OAuth
A function to help upload without FileReference.upload() in AIR HTML/JS application.
Function Parameters:
void PrepareMultipartRequest(
URLRequest request, ByteArray file_bytes,
string field_name = "file", string native_path = "C:\FILE",
object data_before = {}, object data_after = {}
);
Sample JS Code:
var request = new air.URLRequest('http://example.com/upload.php');
var loader = new air.URLLoader();
var file = new air.File('C:\\TEST.TXT'); //use file.browseForOpen() on ur wish
var stream = new air.FileStream();
var buf = new air.ByteArray();
var extra = {
"id": "abcd"
};
stream.open(file, air.FileMode.READ);
stream.readBytes(buf);
MultipartRequest(request, buf, 'myfile', file.nativePath, extra);
loader.load(request);
Sample PHP Code:
$id = $_POST['id'];
move_uploaded_file($_FILES['myfile']['tmp_name'], '/opt/blahblah');
Download: multipart.js
Original code inspired from here.
Labels: AIR, javascript
The AIR(Adobe Integrated Runtime) 1.0b2 for win32 crashed on very simple js/html code.
Setting style.display of an iframe(or its container) element to none is dangerous, the workaround cound be setting style.visibility to hidden.
Get the crashing code here: AIRb2CrashSample.air.
It's even my first AIR program. :|
Labels: AIR, javascript