yashsingh1/xdaforums huggingface dataset:
[Motorola Droid 3] Dri94:
Ok so for these last three days i have been trying to get into the android game. I did the hello android tutorial and yea. that was boring lol, so i decided to try and create a program to temporarily fix the keyboard backligh issue. i have only part of the code done but it does not execute at all. I am not sure whats the problem. Im not sure if i should post the code here but the program will be free anyways and idc if someone takes it cause its sloppy and doesnt run ahah. and everyone will know i posted it first :p

'

package com.dri94.led;

import java.util.*;
import java.io.*;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class LEDLightActivity extends Activity {
/** Called when the activity is first created. */
@SuppressWarnings("null")
@Override
public void onCreate(Bundle savedInstanceState) {
final int SDK_INT;
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Scanner input = new Scanner(System.in);
DataOutputStream os = null;
TextView tv = new TextView(this);
tv.setText("Enter 'y' to turn on keyboard light or 'n' to turn it off");
String yOrN = input.next();

if (yOrN == "y") {

tv.setText("Enter SDK number 7 for GB devices or 14 for ICS devices. No other devices are supported at this time");

SDK_INT = input.nextInt();

if (SDK_INT == '7') {
try {
os.writeBytes("echo 255 > /sys/class/leds/keyboard-backlight/brightness\n"
+ "chmod 444 /sys/class/leds/keyboard-backlight/brightness\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

else {
try {
os.writeBytes("echo 255 > /sys/class/leds/kpd_backlight_en\n"
+ "chmod 444 /sys/class/leds/kpd_backlight_en\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}

i know there are probably many problems with this but right now i want to focus on why it doesnt run. Im giong to try and do everything else like ui and making it an actual program on my own :)

Im not sure if this is the right forum or not but developers usually dont post in the General Forum

Edit; this is based on code from... another developer whose name i cant remember but i will try and post back here so he gets credit. either way, not all mine. i read his code and then figured out how to write this.
[Motorola Droid 3] eww245:
Don't think I can help with your code but I think the problem with this is the light sensor which will override /sys/class/leds/kpd_backlight_en

Looking at getevent it shows /dev/input/event6 as the light-prox, that is /sys/class/input/input6 in userspace. I haven't found any values of use in there though. You could always decompile Keyboard Backlight	Controller to see what it does.
[Motorola Droid 3] Dri94:
Keyboard backlight controller didn't fix my keyboard. it just worked with the led home lights. Even if hash fixes the issue in this next build. I want to finish this program for the fact that I'm working to be an android developer.

Sent from ICS Droid3 using xda premium
[Motorola Droid 3] eww245:
No it won't, but I assume it uses the same logic that would work for the keyboard
[Motorola Droid 3] edmann:
Gallery takes "foreva" to load after selecting Gallery wiget, camera under Albums. Though pressing menu/wallpaper/gallery/camera and pictures load pretty much right away. Long press on launcher, choose Gallery, camera and loads just as fast.

FYI
[Motorola Droid 3] Dri94:
I never thought of that. Thanks im going to look into that this morning.

I have no clue what this is referring to lol. Explain please.
[Motorola Droid 3] Rennert:
i've solved this issue with the app tasker. the keyboard backlight is permanently on, if the keyboard is slided out.

in tasker:

new profile, keyboard slided out and ok. then new task: and use run shell:

echo 1 > /sys/class/leds/kpd_backlight_en/brightness; chmod 444 /sys/class/leds/kpd_backlight_en/brightness

use root don't forget;-)

new profile, keyboard slided out and reverse and ok, new task: run shell:

chmod 777 /sys/class/leds/kpd_backlight_en/brightness; echo 0 > /sys/class/leds/kpd_backlight_en/brightness

use root;-)

for the button backlight i do this same, but with display on and off.
[Motorola Droid 3] Dri94:
yeai know this keeps the keyboard on permanently. Im was going to make it better later. Right now i just dont know why the app wont start.

I dont know how to request Su permissions either. I have yet to look that up. Trying to solve this issue first because adding more code to it is easy, i already have everything planned out with the code. But i dont want to add it because more code before i fix this will make it harder for me to see the problem
[Nexus One Android Development] madmaxx82:
Features of 4EXT Recovery Classic:

(Use 4EXT Recovery Control or Recovery Updater for complete Changelogs and Known issues!)

not all features may be relevant for all devices

Displays additional information:

Identifies your current rom and displays its name

Current filesystems on your partitions

Free space remaining of all of your volumes

Current battery charge level

Backup | Restore:

Correctly calculates free space needed to complete a backup ( version > 2.2.6 RC4 )

Tar backups (can be switched on or off)

Complete CWMR5 compatibility

All Backups you create will be named after your currently installed Rom for easier identification.

Never unwillingly get "downgraded" to EXT3 again

Always restores backups using the file systems you HAD on your partitions at the time of creation!

-> all partitions formatted with ext4 at that time, will be restored to ext4. The same is true for ext3.​

You can manually change any existing Backup to ext4 or ext3

-> so that after a restore, all partitions and up with the file system you wanted!​

Advanced Backup: backup only a single partition

Convert any of your partitions to EXT4 or EXT3 without data loss.

Formatting:

When you wipe or format it will always use the same file system you currently have.

-> but you can change that​

When you format ext4 it will always create an aligned file system

Correctly identifies unformatted sd-ext partitions

-> if it finds one it displays a warning and suggests you may format them by visiting the 4EXT menu​

Filesystem check and repair option in advanced menu

Partitioning:

Alignment check of your partitions

Full support for up to 2 sd-ext partitions + swap (Backup/restore/format/convert, fsck, et.c.)

(RE-) Partition your sdcard for sd-ext without removing your fat32 partition.

All partitions created with 4EXTRecovery will be perfectly aligned to 4k

Installing:

Integrated md5sum checking option

Menus:

Most popular menu items rearranged

Format menu

Power Menu + option to reboot into bootloader

Changed Advanced Restore: first select what you want to restore, then select the backup

-> Useful for restoring from "Advanced Backups"​

4ext.prop:

Configuration file on your sdcard where you can set options to be used by 4EXTRecovery

Change all settings conveniently with 4EXT Recovery Control

Many more options to come

Share your settings / themes by packing your config into a flashable theme

Other stuff:

USB Storage Autostart (must be switched on)

Mount usb storage exposes all partitions on your sdcard to the os (not just fat32)

-> you could even partition your sdcard from your PC while connected via USB​

Switch haptic feedback on/off

Button backlights

​
[Nexus One Android Development] madmaxx82:
reserved ...
[Nexus One Android Development] madmaxx82:
Recovery Interface Api for Apps and Scripts​

Both: free and paid 4EXT apps now provide a very easy to use interface you can use to access 4EXT Recovery from within your shell scripts or apps.

Features:

wipe cache

wipe dalvik

wipe data / factory reset

install multiple zips at once

backup

If you are interested, please download this zip file with examples​

How to make use of 4EXT Recovery Touch from within updater-scripts:​

Since Beta 1.0.0.3 Beta 4 you can do the following:

identify whether the user is running 4EXT Recovery Touch or not (to use or not to use the following commands)

make use of the native yes/no dialogue (confirm / cancel buttons)

prevent recovery from redrawing the screen ( in case you need to use your own 3rd party interactive binary )

​

To identify 4EXT Recovery Touch:

if getprop("ext.edition") == "ng" then

<your code>

endif;

To use the native confirm dialogues:

ui_print("4ext: show_yesno"); # <-- recovery will pause your script and display "yes / no" buttons.
run_program("/sbin/sleep", "2"); # <-- for safety since the above is executed asynchronous

#check the return value by calling:

if getprop("ext.confirm") == "yes" then

<yourcode>

endif;

To prevent recovery from redrawing the screen ( if you want to use an external binary that needs to occupy the screen and get the focus )

ui_print("4ext: disable_scrn_update");

# don't forget to enable it again after your yesno binary or graphical installer is finished, by calling:

ui_print("4ext: enable_scrn_update"); #otherwise the recovery will appear to be frozen as it won't update the screen anymore.
[Nexus One Android Development] pseudoheld:
let me be the first to congratulate you!

really great work. been using 4ext for a while now and will be flashing this asap ;)

great job mate!
[Nexus One Android Development] Theshawty:
Absolutely wonderful! You my friend have done an outstanding job with this! Touch-recovery, wow, almost sounds too good to be true :D
[Nexus One Android Development] madmaxx82:
Thank you both VERY much :)

It is now online ;)
[Nexus One Android Development] Guineapig:
Just bought your Control version on android market and bro, this recovery is amazing!

EPIC!!!
[Nexus One Android Development] madmaxx82:
Thank you very much for your support :)
[Nexus One Android Development] uoY_redruM:
Great job man, this is simply brilliant.

Sorry i didn't get to test it for you though. I'm using it now and its great.
[Nexus One Android Development] madmaxx82:
I'm very sorry.

A bug slipped through in Beta 6.

It was a last minute change.

Some menu items were out of order inside the wipe menu!

Please flash beta 7.

Sorry again!

Thanks very much :)

No problem!
[Nexus One Android Development] Nedlinin:
Great stuff! Just messing around in it and doing a few basic operations (backing up, sd card check, etc) it seems to be working great. I had given up hope for a nice touch recovery on my N1 but you've made it :)
[Nexus One Android Development] Nico_FR:
Works fine ! Thank you so much !
[Nexus One Android Development] Theshawty:
Beta 7 is wonderful! No bugs as of yet, and I didn't expect there to be any for that matter ;)
[Nexus One Android Development] Kelvino9:
The normal 4EXT Recovery was already awesome, but this is awesome x1000.

Thanks madmaxx82!
[Nexus One Android Development] madmaxx82:
Thank you all very much! :)

Thanks :)

If your signature is correct, you are using Beta 6?

Please upgrade to beta 7 asap.

In Beta 6 I added another menu item to the wipe menu. This change went too quick before release and so it happened that the order of some later items got reversed, which can be VERY annoying if you don't watch out when you see the text with the confirm button and just confirm blindly.

This was a mistake that is really bad and should never happen..

This has been fixed in Beta 7 which was uploaded 2 hours afterwards.
[Nexus One Android Development] inblues4u:
This is the coolest ever version of 4EXT
[Nexus One Android Development] ctfrommn:
Yeah, I didn't catch that bug and ended up accidentally wiping my sdcard, oh well I had a backup at least and it gave me a reason to reformat my card. This is an awesome recovery though, only minor issue I see is scrolling through long lists of folders on sd card is not smooth or fast, it seems like you have to press hard and it doesn't scroll quickly. All in all great job Max.
[Nexus One Android Development] madmaxx82:
That's really bad :(

I'm very sorry this has happened.

I was not fast enough in replacing Beta 6 with 7.

That must have been the biggest failure since the release of the first 4ext version in june.
[Nexus One Android Development] madmaxx82:
Thank you very much :)
[Nexus One Android Development] milomak:
How does one check the md5 of the nand backups to make sure the restore doesn't fail?

Does changing the name of the folder have an impact on the md5?
[Nexus One Android Development] madmaxx82:
If you want to flash a new rom and you would really like to format everything, then choose "super wipe ext4" or "superwipe ext3" in the install dialog when you do that from out of recovery control.

If you use recovery directly, use "format all partitions (except sdcard)" from the wipe menu.

When you restore a backup using Recovery Control, the md5sum check will be done inside the app instead of in recovery. So you know whether the backup is okay or not before it even tries to reboot into recovery.

You can also check a backup manually -> click one of your backups and then select md5sum check.

To do that manually, open a shell, change into the directory of your backup and type md5sum -c nandroid.md5

Usually renaming a backup folder won't have any impact on that.

However when you do that by toggling usb storage on your computer and you really have bad luck and corrupt your fat32 file system slightly while doing that (not used safely unmount et.c.) it's possible that the md5sums won't match anymore.
[Nexus One Android Development] milomak:
click the backup when i am in recovery?

edit - nvm, found it in the app
[Nexus One Android Development] n1newbie:
Y does the backup gets stored in clockworkmod folder and not in 4ext folder? :rolleyes:
[Nexus One Android Development] Pr0fess0rX:
Hi, I'm using 1.0.0.4 RC1 and I can't format the 2nd ext partition!!
[Nexus One Android Development] baseballfanz:
My guess would be because it's base on CWM.
[Nexus One Android Development] Theshawty:
That would be a correct guess. :)
[Nexus One Android Development] madmaxx82:
Why not? What happens?

Just posting that something doesn't work is of no use.

Formatting sd-ext2 works perfectly. If it doesn't for you, please add more details.

The reason is interoperability. We could put the backups anywhere.. but that doesn't make sense.

There are apps that look for your backups in the clockworkmod folder.

Since CWMR is the defacto standard, it makes sense to stay compatible.
[Nexus One Android Development] n1newbie:
now i understand. thanx max :)
[Nexus One Android Development] Pr0fess0rX:
I've done the formatting using the recovery in v 1.0.0.3

What kind of details you want? and how can I get it for you?

Do I have to reformat again?

Thnx
[Nexus One Android Development] madmaxx82:
The recovery.log or at least the exact error you get when you try to format sdext2.

Please contact me by mail or via the app and include this info.

Otherwise I'm not able to help since what you describe is not known to me (noone else has contacted me about a problem with formatting sdext2 and I cannot reproduce it)

Thanks.
[Nexus One Android Development] earth08:
After my deivce got hangup and when i pull my battery out and if i have to go to recovery the timezone(time) is different than the set timezone.

y its like this,

can somebody guide me is it my device prob, or its the recovery which on batterypull out forget the settings

I am using Runnymede ROM 5.0.1

pls guide me,

thanks in adv.
[Nexus One Android Development] madmaxx82:
Hi,

when the time is wrong in recovery although you set your time zone to a fixed value and you are running 1.0.0.4 then it's because it isn't able to access /system at bootup to read time zone related data ;)

Under certain circumstances it might take longer to access some mtd partitions on recovery boot. There is a time out. If that is reached, you won't get a proper time in recovery.

This is because I cannot wait indefinitely for /system to become available, which might never be the case when the user boots it directly after swapping hboot for example.

It's nice to have the local time in recovery, but remember that this is no must-have and that other recoveries don't even try.

So when this happens to you after a crash of your phone it's most probably due to a greater delay accessing /system.
[Nexus One Android Development] Theshawty:
I'm using 1.0.0.4 RC2 and mounting USB storage does not work.
[Nexus One Android Development] ShadowCodeGaming:
USE RC3, works fine there.
[Nexus One Android Development] Theshawty:
You mean 1.0.0.4 RC3 och 1.0.0.3 RC3?

The 1.0.0.4 RC2 version is much more responsive than previous versions and this little error isn't even bothering me that much. Just thought I'd share it. I use multi-mount SD and it works awesomely for me. :)
[Nexus One Android Development] baseballfanz:
Are you talking about while in recovery?

The USB storage show up fine once I "toggle usb storage"
[Nexus One Android Development] madmaxx82:
Did you use the mounts menu to mount /sdcard?

If so this is something completely different.

You need to press on "toggle usb storage" which is a menu item directly on the main menu screen.

I would not use that anymore.

1.0.0.4 RC2 is the most stable and fastest 4ext recovery since june ;)

Only one very minor glitch is known: screenshots via adb/ddms won't work ;)
[Nexus One Android Development] Theshawty:
Somehow, that won't work for me.

No, I used the ordinary menu. "toggle USB storage" or whatever it's called. Maybe a reflash of the recovery is in order? I remember I had some serious flashing problems with 1.0.0.4 RC1.
[Nexus One Android Development] Reaper82:
There is a delay in mounting the SD card when you go to install zips from SD. It's about 3-5 seconds before it shows the menu. Is that normal? It has only existed in 1.0.0.4RC1 and RC2. Otherwise everything is working great. File system checks out on FAT32 and SD-EXT.
[Nexus One Android Development] madmaxx82:
This delay exists because you enabled hide useless directories in recovery settings.

Take a look at the description ;)
[Nexus One Android Development] Reaper82:
oh ok that makes sense lol I must have missed that. thanks :)
[Nexus One Android Development] madmaxx82:
np mate :)
[Nexus One Android Development] mmathiou:
I loved that feature (screenshots).:(

What version shall I install to have it working?(I am using 4EXT Recovery Control )
[Nexus One Android Development] madmaxx82:
The screenshot feature of recovery always worked fine.

The bug in rc2 only concerns taking screens externally via ddms!

This was fixed in rc3 btw.

With any version you can press the search key to take screenshots!
[Nexus One Android Development] Theshawty:
It's almost unbelievable how awesome this recovery is. Can't even compare it to other recoveries. Intuitive and sexy ;)

And three bucks for the awesome app is nothing :)
[Nexus One Android Development] baseballfanz:
Treid the screenshot, see "Taking screenshot" and "Screenshot saved" but can't find it anywhere on the phone. Where is it save at?
[Nexus One Android Development] Theshawty:
Maybe in the folder named "4ext" or "clockworkmod?"
[Nexus One Android Development] madmaxx82:
After you are finished with taking screenshots, you need to enter the tools menu and select copy screenshots to sdcard. They are stored in ram until you do that

sent from a phone using xda premium
[Nexus One Android Development] baseballfanz:
That was the first two places I look at.:(

Thanks, after doing that there is now a Screenshot folder inside 4ext folder
[Nexus One Android Development] Theshawty:
After browsing around the recovery a bit, I've come to this conclusion. The screenshots aren't stored on the SD-card unless you tell it to do so. Try booting into the recovery, then click the "tools" tab, then scroll down and select "copy screenshots to /sdcard/4ext/screenshots"

That seemed to sort it out for me.
[Nexus One Android Development] :
Hey guys,

I have been a using amon_ra for almost 2 years--it has been rock solid. Want to try this and got some questions. I have read entire thread and want to make sure I understand everything. Hopefully most are yes/no answers--

1. If I try 4ext and want to fastboot back to amon is there any issues there

2. I hear clockworkmod/rom mgr mentioned as a place that stores backups for interoperability reasons. I have used it and is still on sdcard although no bu's there now. Is clockwork folder on sdcard required for this recovery--in that I could delete all clockwork folders on sd card and 4ext still bu's to--_________?

3. 4ext recovery control has updater within it, so just dl it, click on install and amon_ra is gone?

4. Would it be better to dl from website and transfer to sdcard dl folder. Then open and install. That way I can extract recovery image and fastboot it if necessary? NVM-saw answer in OP-

5. Is there a System wipe choice as in "Format all Partitions" choice mentioned.

6. No ICS or adb issues?

7. No problems with flashing different hboots as I have none with amon_ra--

8. Has this changed as it relates to amon_ra bu's, even if I copy them from AR Nandroid to Clockwork folder--"Sorry to disappoint you there..Unfortunately it is only compatible with backups made by CWMR or any other compatible recovery."

9. As far as 8. goes I guess I could refastboot AR, restore rom then reflash/install 4ext and bu--right? I am pretty much on ICS and CM7 Kangs now--otherwise I would have to fresh flash my roms--

10. Finally--:rolleyes: If I install now over amon_ra running BCM ICS Rom no current functionality lost other than restoring AR bu's--

Sorry for all the questions, but I always try to understand everything before jumping in. I believe I know the answers, but just making sure--as like I mentioned AR has been flawless, but like the touchscreen feature--

Ken
[Nexus One Android Development] baseballfanz:
1. If I try 4ext and want to fastboot back to amon is there any issues there.

I did go back to Amon Ra at first with no problems

2. I hear clockworkmod/rom mgr mentioned as a place that stores backups for interoperability reasons. I have used it and is still on sdcard although no bu's there now. Is clockwork folder on sdcard required for this recovery--in that I could delete all clockwork folders on sd card and 4ext still bu's to--_________?

I delete my CWM folder long ago when I went to Amon Ra. At first use it just created a new CWM folder.

3. 4ext recovery control has updater within it, so just dl it, click on install and amon_ra is gone?

Yes it will replace Amon Ra. There were a few instance where I had to do it twice for it to flash.

5. Is there a System wipe choice as in "Format all Partitions" choice mentioned.

Yes (except sd card)

6. No ICS or adb issues?

Don't use ICS but no problems with ADB for me.
[Nexus One Android Development] :
Appreciate the answers on the first six baseballfanz--are you now exclusively on 4ext and don't miss AR?
[Nexus One Android Development] baseballfanz:
Yes I'm on 4ext now. Dont see me going back to AR any time soon.
[Nexus One Android Development] :
Cool--just checking out some of the HOT themes on that thread--
[Nexus One Android Development] :
bought 4xt and made first ICS bu--no problems

want to bu to pc recovery.img

in updater folder on sd card there is only an apk--do I push that if I lose recovery

don't see a recovery.img and the link on post 161 is dead

see madmaxx mentioned just do a restore thru fastboot by by wiping and going to recovery

thought there is an actual .img to save to my tools folder

Edit: OK. Guess I can just reinstall updater apk by copying it back to sdcard from PC backup.
[Nexus One Android Development] gregferns:
4Ext also makes a copy of the recovery.img it flashed and saves it on the root of your sdcard. Maybe you can copy that to your PC and keep. I don't remember if its a choice / option, but i remember it telling me / asking me and now i have the recovery image there. In case anything goes wrong i can still use that....

Cheers

greg
[Nexus One Android Development] n1newbie:
its an option/choice. you can enable or diasble it uner Application Setting -> save recovery.img to sd card :)

but what does that img contain? is it always advisable to have that option checked?