Skip to content

sunfurong/tiandroidservice

Repository files navigation

Appcelerator Titanium Mobile Module Project
===========================================

This is a skeleton Titanium Mobile Mobile module project.


MODULE NAMING
-------------

Choose a unique module id for your module.  This ID usually follows a namespace
convention using DNS notation.  For example, com.appcelerator.module.test.  This
ID can only be used once by all public modules in Titanium.


GET STARTED
------------

1. Edit manifest with the appropriate details about your module.
2. Edit LICENSE to add your license details.
3. Place any assets (such as PNG files) that are required anywhere in the module folder.
4. Edit the timodule.json and configure desired settings.
5. Code and build.


DOCUMENTATION FOR YOUR MODULE
-----------------------------

You should provide at least minimal documentation for your module in `documentation` folder using the Markdown syntax.

For more information on the Markdown syntax, refer to this documentation at:

<http://daringfireball.net/projects/markdown/>


TEST HARNESS EXAMPLE FOR YOUR MODULE
------------------------------------

The `example` directory contains a skeleton application test harness that can be
used for testing and providing an example of usage to the users of your module.


BUILDING YOUR MODULE
--------------------

Simply run `titanium build --platform <name of platform> --build-type production --dir /path/to/module`.
You can omit the --dir option if your working directory is in the module's project directory.


INSTALL YOUR MODULE
-------------------

Mac OS X
--------
Copy the distribution zip file into the `~/Library/Application Support/Titanium` folder

Linux
-----
Copy the distribution zip file into the `~/.titanium` folder

Windows
-------
Copy the distribution zip file into the `C:\ProgramData\Titanium` folder


REGISTER YOUR MODULE
--------------------

Register your module with your application by editing `tiapp.xml` and adding your module.
Example:

<modules>
	<module version="0.1">cn.named.service</module>
</modules>

When you run your project, the compiler will combine your module along with its dependencies
and assets into the application.


USING YOUR MODULE IN CODE
-------------------------

To use your module in code, you will need to require it.

For example,

	var my_module = require('cn.named.service');
	my_module.foo();

before you use this module
---------------------------------------------------------
you need add something into your  tiapp.xml
1、<service android:label="push service"  android:name="cn.named.service.CoreService" android:process=".pushservice"/>
2、<receiver android:name="cn.named.service.MyReceiver">
             <intent-filter>
                    <action android:name="ELITOR_CLOCK"/>
                    <action android:name="android.intent.action.BOOT_COMPLETED"/>
                    <category android:name="android.intent.category.LAUNCHER"/>
              </intent-filter>
    </receiver>
3、 <receiver android:name="cn.test.service.DataReceiver"/> this be used to the tiapp get some datas from notification
4、 <uses-permission android:name="android.permission.GET_TASKS"/>
5、 <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT"/>
6、<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
7、<uses-permission android:name="android.permission.INTERNET"/>

about this module method
-----------------------------------------------------------
startService(String url)
	url:websocket service address
	this method will start service and websocket
startApp()
	this method will resume tiAPP from background
clear()
	this method will clear all push notification
getServiceState()
	this method will get your service's state

About

titanium Android push service

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published