Corona中文站

强大、易学的跨平台(iOS/Android)开发框架。QQ群1:74390406(满) 群2:221929599

导航

五分钟学会Corona(二十二) - System and OS
System Library

system.getInfo( param )返回应用程序所运行的系统的信息。第一个参数param是个字符串,用来确定返回什么。param的有效值如下:

• "name" 返回设备的人类可读的名称。在iPhone上,就是在iTunes上显示的手机名称,比如 "Steve's iPhone".

• "model" 返回人类可读的模型名,如 "iPhone".

• "deviceID" 返回设备唯一的ID,例如IMEI或类似的数字

• "environment" 返回应用程序运行的环境,有效值可以是:
...
五分钟学会Corona(二十一) - 应用内支付
这个特性允许你支持应用内支付。当前,只有Apple iTunes Store被支持。在未来也许其他商店会加入这个特性。

Apple iTunes Store 的应用内支付

应用内支付允许用户购买额外的内容。然而, Apple iTunes Store只管理交易信息!开发者不能使用 Apple App Store来分发内容。所以,要么你捆绑内容在你的app里,等到付费之后来解锁这个内容;要么你不得不开发一个你自己的系统来下载付费后你想分发的内容。为了支持可下载内容,你应该使用我们新的 Network/AsynchHTTP API。
...
五分钟学会Corona(二十) - 异步HTTP
该特性允许你发起异步的HTTP和HTTPS/SSL调用,任何有效的HTTP方法(“GET”,“POST”等等),以及添加自定义的 header和body content。你的 Corona程序不需要停止, 等到服务器的响应到来时,通过event listener来捕获并且从event中取得数据。

另外,你可以选择下载网络响应到一个特定的文件,而不是加载到内存中。当这个响应是一个很大的文档或一个图片时,是很有用的。

两个新的例子工程说明了该特性的用法: "Network/AsynchHTTP" 和 "Network/AsynchImageDownload".
...
五分钟学会Corona(十九) - OpenFeint
OpenFeint是一个第三方的库,提供了社会化游戏特性,例如公共排行榜和成就系统。为了获得更多信息,请参看 http://www.openfeint.com/ 和 http://www.openfeint.com/developers.

• 这个API是实验性的,并且会变化,因为OpenFient目前也在完善中,而Apple Game Center最近也将发布。

• 在当前的alpha版本,只支持iOS,因为OpenFient暂不支持Android。

• 没有模拟器可以支持这个特性,因为 OpenFeint 对MacOS也不可用。
...
五分钟学会Corona(十八) - 网络和Web Services
Corona包含了最新版本(v2.02)的LuaSocket库。这些Lua模块实现的常见的网络协议,例如SMTP,HTTP和FTP。也包括一些特性支持如MIME,URL操作和LTN12。

LuaSocket是一个被预装到corona中的扩展库的集合。为了加速程序的启动,他们不会默认被自动加载。为了使用他们,你必须显式的加载每一个,以使库函数可以在你的代码中使用。为了做到这一点,你应该require他们。并且吧下面代码放在你的lua文件的顶部。

local socket = require("socket")
...
五分钟学会Corona(十七) -
Corona provides routines for calculating common message digests (hashes) and hash-based message authentication codes (HMAC).

The crypto library is an external library pre-installed into Corona apps. To speed up launch time, it is not automatically loaded by default. In order to use this library, you must explicitly load the library to make the library's functions available to your code. To do this, you should use require, i.e. placing local crypto = require("crypto") at the top of your Lua file.
...
五分钟学会Corona(十六) - Files
Applications are sandboxed meaning your files (e.g. application images, data, preferences) are stored in a location that no other application can access. Your files will reside in an app-specific directory for documents, resources, or temporary files.
...
五分钟学会Corona(十五) - Database (SQLite)
Corona includes support for SQLite databases on all platforms. This is based on the built-in sqlite support on the iPhone, and a compiled version of SQLite on Android. Note that this increases the size of the Android binary by 300K.

SQLite is available in all versions of Android, iPhone, and iPad, as well as in the Corona Simulator.
...
五分钟学会Corona(十四) - Math
This library is an interface to the standard C math library. It provides all its functions inside the table math.

math.abs (x)

Returns the absolute value of x.

math.acos (x)

Returns the arc cosine of x (in radians).

math.asin (x)

Returns the arc sine of x (in radians).
...
五分钟学会Corona(十三) - Tables and Arrays
Tables in Lua implement associative arrays. That is, they can be indexed not just with numbers, but also with strings or any other value of the language, except nil.

This library provides generic functions for table manipulation. It provides all its functions inside the table table.
...
«123456789»

日历

<< 2014-10 >>

Sun

Mon

Tue

Wed

Thu

Fri

Sat

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

最近发表

Copyright 2011-2015 BuildApp.Net. All Rights Reserved.