Coder Social home page Coder Social logo

bencoding.android.tools's Introduction

benCoding.Android.Tools

A collection of utilities designed to make working with Titanium on Android alittle easier.

Before you start

* This is an Android only module * Before using this module you first need to install the package. If you need instructions on how to install a 3rd party module please read this installation guide.

Download the release

The go to the dist folder. This will have a release compiled for anyone download it from github.

Building from source?

If you are building from source you will need to do the following:

  • Modify your build.properties to reflect the path to your android and other directors
  • You might need to update your .classpath depending on your setup.

Setup

  • Download the latest release from the releases folder ( or you can build it yourself )
  • Install the bencoding.android.tools module. If you need help here is a "How To" guide.
  • You can now use the module via the commonJS require method, example shown below.

var tools = require('bencoding.android.tools');

Platform Methods

The platform methods proxy provides access to several helpful Android apis not currently exposed in the core Titanium SDK.

To learn more about these please visit the documentation here or the examples here.

BootReceiver

The BootReceiver proxy provides extended functionality for handling the BOOT_COMPLETED system broadcast.

To learn more about these please visit the documentation here or the examples here.

Licensing & Support

This project is licensed under the OSI approved Apache Public License (version 2). For details please see the license associated with each project.

Developed by Ben Bahrenburg available on twitter @benCoding

Learn More

Examples

Please check the module's example folder or view the [sample on github](https://github.com/benbahrenburg/benCoding.Android.Extras/tree/master/example) .

Twitter

Please consider following the @benCoding Twitter for updates and more about Titanium.

Blog

For module updates, Titanium tutorials and more please check out my blog at benCoding.Com.

bencoding.android.tools's People

Contributors

adampax avatar benbahrenburg avatar darknos avatar fokkezb avatar gimdongwoo avatar janisr avatar ludooo avatar tvfoodmaps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bencoding.android.tools's Issues

Service not starting after boot

Hey,

how could i get just the notification service running after restart of android?
i cant get the service example to work
regards
goran

Restart Example tiapp.xml Syntax Error

It says:

<receiver android:exported="true" android:name="bencoding.android.receivers.BootReciever">

Instead of:

<receiver android:exported="true" android:name="bencoding.android.receivers.BootReceiver">

Just in case somebody copies it from the example :)

BootReceiver: sendToBack meta-data doesn't work!

Hi!

I've tried the BootReceiver function included on Android.Tools but it doesn't work as I expected. There is an option in the meta-data parameters to set the restart to background or foreground (sendToBack).

The problem is it doesn't matter the value on sendToBack: Always restart the app on foreground!

<receiver android:exported="true" android:name="bencoding.android.receivers.BootReceiver">

     <intent-filter>
         <action android:name="android.intent.action.BOOT_COMPLETED"/>
         <action android:name="android.intent.action.QUICKBOOT_POWERON"/>
    </intent-filter>

    <meta-data android:name="bootType" android:value="restart"/>
    <meta-data android:name="sendToBack" android:value="true"/>

</receiver>

I tested the app on a Nexus 4 running Android 4.4.2 and I used Titanium SDK 3.4.1 to develop it.

Backwards compatibility with 6.0.0

Hey. This is not really an issue but more of a question. I'm developing a Titanium module and am trying to make it with 7.0.0.GA but backwards-compatible to 6.0.0.GA like yours.

I made a new module project and choose 7.0.0.GA as my SDK version but it only accepts apps that are built with 7.0.0.GA and above.

How did you make your module backwards compatible?

Much appreciated

Inconsistent function rebooting app.

Hi Ben,

I just tried out your module to get my app rebooted when I reboot my device, at first it looked good, except the sendToBack property, but the real problem is that when trying to make multiple reboots of my device the app only reboots the first time at fresh install/start almost 99% of all consequent reboots do not reboot the app. Thanks for the effort to do this module, maybe you can guide me a little to where the centerpiece is in your code and I can look at it my self... How do you test it in Android with this module? Or you test it in the test apps right here? Could it matter that I have a background service running as well? The error in the logg is simply that the app is started by ActivityManager but shortly after just "killed". with no extra information, well or actually I think it is something about empty #17 but that tells me nothing... Is there other modules that do the same? Or could Ti 5 support this now in other ways?

Thanks!

Detecting of foreGround

Hi Ben,

I try to build an own module for implementing of

Ti.App.addEventListener("paused",function(){});

This is my code:

mTimer.scheduleAtFixedRate(new TimerTask() {
    @Override
    public void run() {
        Boolean isInForeground = BensModule.isInForeground();
        if (isInForeground != wasInForeGround) {
            KrollDict dict = new KrollDict();
            String key = (isInForeground == true) ? "resumed" : "paused";
            app.fireAppEvent(key, dict);
            wasInForeGround = isInForeground;
        }
    }
}, 0, 1000);

I use your method in tools ;-))

If the app goes to background, this will detected, but:
V8Object: (KrollRuntimeThread) [1,26193] Runtime disposed, cannot fire event 'paused'

Is it normal? Can I solve?

Code strong!

Rainer

Callback

Now i wont to know how to fireEvent that lunch when i click on the notification that shows after reboot the device but i can't know how could u help me ?

BootReciever Not Working ClassNotFoundException

Hi,

I followed the exact steps in your blog/documentation to register your broadreciever when the device is booted but it fails to work. from the logcat I can see the following exception:
11-08 11:30:08.016: E/TiApplication(547): (main) [336,1217] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to instantiate receiver bencoding.android.receivers.BootReciever: java.lang.ClassNotFoundException: bencoding.android.receivers.BootReciever; Titanium 3.1.3,2013/09/18 12:01,222f4d1

The exception tells us that it cannot instantiate receiver cause it doesn't find the class which is weird.

I'm using your latest distribution 0.31.
In simulator I tried it on Google APIs level 15.
and also my device Samsung Galay 2 JellyBean 4.1.2

This is my android section in tiapp.xml

  <android 
        android:permission="android.permission.RECEIVE_BOOT_COMPLETED" xmlns:android="http://schemas.android.com/apk/res/android">
        <tool-api-level>15</tool-api-level>
        <manifest>
            <uses-sdk android:minSdkVersion="10"/>
            <supports-screens android:anyDensity="false"/>
            <!-- supports-screens 
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:xlargeScreens="true" 
                  android:anyDensity="true" / -->
            <application android:debuggable="true" android:theme="@style/Theme.Gontell">
                <activity android:alwaysRetainTaskState="true"
                    android:configChanges="keyboardHidden|orientation"
                    android:label="GoNTell"
                    android:launchMode="singleTop"
                    android:name=".GontellActivity" android:theme="@style/Theme.Titanium">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                </activity>
                <receiver android:exported="true" android:name="bencoding.android.receivers.BootReciever">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED"/>
                    <action android:name="android.intent.action.QUICKBOOT_POWERON" />
                </intent-filter>
                <meta-data android:name="enable" android:value="true"/>
                <meta-data android:name="bootType" android:value="restart"/>
                <meta-data android:name="sendToBack" android:value="true"/>
                </receiver>
                <receiver android:name="bencoding.alarmmanager.AlarmNotificationListener"/>
                <receiver android:name="bencoding.alarmmanager.AlarmServiceListener"/>
            </application>
            <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
            <uses-permission android:name="android.permission.CALL_PHONE"/>
            <uses-permission android:name="android.permission.WAKE_LOCK"/>
        </manifest>
        <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/>
        <activities>
            <activity android:alwaysRetainTaskState="true"
                android:theme="@style/Theme.Titanium" url="services/handheld/android/scripts/openSessionDetails.js">
                <intent-filter>
                    <action android:name="android.intent.action.VIEW"/>
                    <category android:name="android.intent.category.DEFAULT"/>
                </intent-filter>
            </activity>
            <activity android:alwaysRetainTaskState="true"
                android:theme="@style/Theme.Titanium" url="services/handheld/android/scripts/openFeebacksList.js">
                <intent-filter>
                    <action android:name="android.intent.action.VIEW"/>
                    <category android:name="android.intent.category.DEFAULT"/>
                </intent-filter>
            </activity>
        </activities>
        <services>
            <service type="interval" url="services/handheld/android/NotificationService.js"/>
        </services>
    </android>

please help :(, I'm kind of lost.

Thanks,

Nadav

How to know that the module called my app on boot?

There is some way to know that I'm on the first run after a reboot?
If not by this module, do you know if there is some way to get the system uptime or something that indicates I'm running from a boot_complete event?
Thx

Titanium 7.0 compatible

It seems that the last version is not currently compatible. Any chance we could get a compatible version?

Thanks

Bug 2373 still relevant?

Is bug 2373 (the additional XML elements in your readme) still a relevant bug? Do I still need to include these?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.