pinkelstar-android
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:The PinkelStar Android UI Library, an excellent start to integration
PinkelStar Android UI Framework
===============================

This is the home of the PinkelStar Android Client UI Framework. To use this framework you will need to register for a developer
account at [PinkelStar](http://www.pinkelstar.com). Once registered, you can download the framework by cloning this repository :

    git clone git@github.com:PinkelStar/pinkelstar-android-ui.git PinkelStarAndroidUI

This repository contains the entire UI project which you can use as-is or modify to fit the needs of your application.
Also contained is a jar file in the lib directory which is used by the UI to communicate with the PinkelStar server.
Full instructions are included below on how to add the UI code to an Android project.

If you want to play around with a [**demo app**](http://github.com/PinkelStar/pinkelstar-android-demo) which has PinkelStar already setup in it, you can [download the source here](http://github.com/PinkelStar/pinkelstar-android-demo/archives/master) or clone this repository using:

    git clone git://github.com/PinkelStar/pinkelstar-android-demo.git

(*remember to have a quick read of the readme)

If you wish to create a custom UI and use the server communication jar directly. Please see the documentation which is also available from the downloads section.

Please post feature requests and bug reports to the GitHub issues tab.

If you see a possible improvement or feature which can be added, please fork this project, make the required changes, and
send us a pull request so we can merge your enhancements in to the master UI project.

Many thanks to jteam.nl for their [tutorial on image caching](http://blog.jteam.nl/2009/09/17/exploring-the-world-of-android-part-2/).

Please post your questions to the [support forum](http://support.pinkelstar.com) and we will answer ASAP.

Happy Coding,

The PinkelStar Team


Requirements:
-------------
* Eclipse
* ADT 0.9.7
* Android 1.5 SDK


Steps for setting up your first PinkelStar enabled Android app :
----------------------------------------------------------------

- Create a new Android Project (create default activity to reference and edit later)

- Add a button inside the `LinearLayout` in `res/layout/main.xml`

        

- Add the following code to the default activity class, after setContentView, to start PinkelStar:

        Button b = (Button) findViewById(R.id.Button01);
        b.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
            Intent intent = new Intent(ACTIVITYCLASSNAME.this, com.pinkelstar.android.ui.PSSharing.class);
            intent.putExtra("developerMessage", "this is a custom developer message");
            startActivity(intent);
          }
        });

    - replace `ACTIVITYCLASSNAME` with your default activity.
    - set an appropriate developer message in the intent by setting developerMessage.
    - set an appropriate content url in the intent by setting contentUrl. (optional)

- Add the PinkelStar UI project as an Android library:
    - If not already done, import the UI project into your workspace. Make sure that the project name does not have dashes, underscores, periods or spaces.
    - Right click on your project and select `Properties`.
    - From the list on the left, select `Android`.
    - At the bottom press the `add` button and select the project you imported PinkelStar as from the dialog.

    > Project Properties > Android > Add (in Library section) > PinkelStarAndroidUI
    > (depending on the name of the PinkelStar UI project)


- Add the PinkelStar Server jar to the build path of your project.
    - Right click on your project and select `Properties`.
    - From the list on the left, select `Build Path`.
    - On the `Libraries` tab, press the `Add Jars..` button and select the jar in the `lib` directory of your PinkelStar project.

    > Java Build Path > Libraries > Add Jars.. > PinkelStarAndroidUI/lib/pinkelstar-android-server.jar

- In `AndroidManifest.xml` some changes are needed which:

    - reference the Application in the `name` parameter of the `application` tag.

        If your app (or another library your app uses) needs to implement its own application class, either make
        it a subclass of `PSApplication` or have it implement the same functionality
        as in PSApplication. Don't forget to reference your own application class in the `application` xml below.

            

    - add the pinkelstar activies *inside* the `application` tag

            
            
            

    - add the permissions for accessing the internet and the device id *below* the application tag

            
            

- Create a file in `/res/xml` called `pinkelstar.xml` and paste in the follow code, but don't forget to add your app key and secret from the application details in the [developer console](https://www.pinkelstar.com/account)

        
            insert your app key here
            insert your app secret here
            true
        

- To enable logging, open a shell using the adb tool and set the logging level to VERBOSE like so `setprop log.tag.PinkelStar VERBOSE`.

  Log messages tagged with 'PinkelStar' will be shown in the logcat output.

  If you are using eclipse, you can also set `-prop log.tag.PinkelStar=VERBOSE` to the 'additional emulator command line options' field on the 'target' tab of the run configuration of your app.


本源码包内暂不包含可直接显示的源代码文件,请下载源码包。