phonegap-plugin-brightness icon indicating copy to clipboard operation
phonegap-plugin-brightness copied to clipboard

How to use

Open nodu opened this issue 12 years ago • 7 comments

Hi! Thanks for writing this plugin for cordova. Could you please update the readme.md with better instructions on how to use? Do I need to insert the code at the bottom into a script tag?

nodu avatar Dec 19 '13 07:12 nodu

Yes. As I mentioned in the readme, you can insert the code into a script tag. I just don't understand what were you concerned about?

fiscal-cliff avatar Dec 19 '13 14:12 fiscal-cliff

Cannot seem to get it to work. I've included your code in a script and tried to utilize it. it just crashes the app when I run it on android. On Dec 19, 2013 10:15 PM, "Evgeniy L" [email protected] wrote:

Yes. As I mentioned in the readme, you can insert the code into a script tag. I just don't understand what were you concerned about?

— Reply to this email directly or view it on GitHubhttps://github.com/fiscal-cliff/phonegap-plugin-brightness/issues/2#issuecomment-30931150 .

nodu avatar Dec 21 '13 07:12 nodu

Could you attach crash dump please. It would appear that adding WRITE_SETTINGS permission can solve this issue.

fiscal-cliff avatar Dec 21 '13 14:12 fiscal-cliff

Mind explaining where to find the crash dump/log files?

nodu avatar Dec 22 '13 02:12 nodu

In case of Android, it can be "adb logcat".

fiscal-cliff avatar Dec 22 '13 03:12 fiscal-cliff

Thank you, I don't see anything meaningful in the logs perhaps you do?

I/ActivityManager( 383): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.ionicframework.starter/.StarterApp bnds=[200,585][360,785]} from pid 657 D/dalvikvm( 383): GC_FOR_ALLOC freed 2124K, 18% free 28648K/34884K, paused 130ms, total 131ms I/CordovaLog( 6165): Changing log level to DEBUG(3) I/CordovaLog( 6165): Found start page location: index.html D/Whitelist( 6165): Unlimited access to network resources D/CordovaActivity( 6165): CordovaActivity.onCreate() D/CordovaWebView( 6165): CordovaWebView is running on device made by: samsung D/JsMessageQueue( 6165): Set native->JS mode to 2 D/CordovaActivity( 6165): CordovaActivity.init() D/CordovaWebView( 6165): >>> loadUrl(file:///android_asset/www/index.html) D/PluginManager( 6165): init() D/CordovaWebView( 6165): >>> loadUrlNow() I/CordovaLog( 6165): Changing log level to DEBUG(3) I/CordovaLog( 6165): Found start page location: index.html D/Whitelist( 6165): Unlimited access to network resources D/CordovaActivity( 6165): Resuming the App D/CordovaActivity( 6165): CB-3064: The errorUrl is null D/CordovaActivity( 6165): onMessage(onPageStarted,file:///android_asset/www/index.html) D/SoftKeyboardDetect( 6165): Ignore this event I/ActivityManager( 383): Displayed com.ionicframework.starter/.StarterApp: +146ms D/SoftKeyboardDetect( 6165): Ignore this event I/ActivityManager( 383): Process com.google.android.gm (pid 6545) has died. D/CordovaActivity( 6165): onMessage(spinner,stop) D/dalvikvm( 6165): GC_CONCURRENT freed 78K, 2% free 9754K/9872K, paused 1ms+9ms, total 23ms D/CordovaWebViewClient( 6165): onPageFinished(file:///android_asset/www/index.html#/home) D/CordovaActivity( 6165): onMessage(onPageFinished,file:///android_asset/www/index.html#/home) D/CordovaLog( 6165): file:///android_asset/www/js/controllers.js: Line 3 : STARTXXXXXXXXXXX I/Web Console( 6165): STARTXXXXXXXXXXX at file:///android_asset/www/js/controllers.js:3 I/System.out( 6165): plugin has been started I/System.out( 6165): All went fine. D/CordovaLog( 6165): file:///android_asset/www/js/controllers.js: Line 6 : STOPXXXXXXXXXXX I/Web Console( 6165): STOPXXXXXXXXXXX at file:///android_asset/www/js/controllers.js:6 I/System.out( 6165): plugin has been started I/System.out( 6165): All went fine. D/CordovaLog( 6165): file:///android_asset/www/js/controllers.js: Line 28 : STARTXXXXXXXXXXX I/Web Console( 6165): STARTXXXXXXXXXXX at file:///android_asset/www/js/controllers.js:28 D/dalvikvm( 6165): GC_CONCURRENT freed 703K, 8% free 9511K/10280K, paused 3ms+6ms, total 38ms D/CordovaLog( 6165): file:///android_asset/www/js/controllers.js: Line 31 : STOPXXXXXXXXXXX I/Web Console( 6165): STOPXXXXXXXXXXX at file:///android_asset/www/js/controllers.js:31 W/InputMethodManagerService( 383): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@4261dc08 attribute=null, token = android.os.BinderProxy@42c5bf78 D/CordovaLog( 6165): file:///android_asset/www/js/controllers.js: Line 28 : STARTXXXXXXXXXXX I/Web Console( 6165): STARTXXXXXXXXXXX at file:///android_asset/www/js/controllers.js:28 I/System.out( 6165): plugin has been started I/System.out( 6165): All went fine. D/CordovaLog( 6165): file:///android_asset/www/js/controllers.js: Line 31 : STOPXXXXXXXXXXX I/Web Console( 6165): STOPXXXXXXXXXXX at file:///android_asset/www/js/controllers.js:31 W/InputMethodManagerService( 383): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@42951208 attribute=null, token = android.os.BinderProxy@42c5bf78 D/dalvikvm( 627): GC_CONCURRENT freed 391K, 6% free 9394K/9928K, paused 13ms+2ms, total 60ms D/dalvikvm( 1509): GC_CONCURRENT freed 466K, 6% free 9300K/9868K, paused 5ms+2ms, total 26ms I/goggles ( 1509): k: Checking for images newer than 1388119723847 D/LightsService( 383): Excessive delay setting light: 67ms

nodu avatar Dec 27 '13 07:12 nodu

Hello and sorry for late reply. Ok, here is the sample project. It's simple, but it works fine on my i9300. https://drive.google.com/file/d/0Bx3xmZPr9s7lbUFvQlgxNjRwY2s/edit?usp=sharing You should be careful with framworks like angular. Their initialization should invoked in the onDeviceReady event handler.

fiscal-cliff avatar Jan 08 '14 14:01 fiscal-cliff