Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,807,340 Members 43,660 Now Online
XDA Developers Android and Mobile Development Forum

[APP]Wear Reboot bootloader & recovery

Tip us?
 
AdamOutler
Old
(Last edited by AdamOutler; 5th August 2014 at 03:43 AM.)
#1  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9,623
Posts: 5,196
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
Default [APP]Wear Reboot bootloader & recovery

Its difficult and annoying to try to put the Galaxy Gear into bootloader mode. Recovery takes a couple of extra steps. I made a quick wear app that allows for rebooting to Bootloader, Recovery and plain ol' reboot. Google won't allow me to upload API level 20 yet(Android L beta), and my device wont accept API level 19. So, I've attached the apk to this post.


Download Here:http://forum.xda-developers.com/atta...1&d=1407200684

Image:


here's the code.

Code:
public class RebootMenu extends Activity implements OnClickListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reboot_menu);
        final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
        stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
            @Override
            public void onLayoutInflated(WatchViewStub stub) {
                setupWidgets();
            }
        });
    }

    private void setupWidgets() {
        Button reboot = (Button) findViewById(R.id.reboot);
        Button recovery = (Button) findViewById(R.id.recovery);
        Button bootloader = (Button) findViewById(R.id.bootloader);

        reboot.setOnClickListener(this);
        recovery.setOnClickListener(this);
        bootloader.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) { // view handler
        switch (v.getId()) {
            case R.id.reboot:
                reboot("");
                break;
            case R.id.recovery:
                reboot("recovery");
                break;
            case R.id.bootloader:
                reboot("bootloader");
                break;
        }
    }

    private void reboot(String mode) {
        String[] command = new String[]{"su", "-C", "reboot", mode};
        try {
            Process process = new ProcessBuilder(command).start();
        } catch (IOException e) {
        }
    }
}
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2014-08-04 19:58:19.png
Views:	321
Size:	25.4 KB
ID:	2884249  
Attached Files
File Type: apk app-release.apk - [Click for QR Code] (1.65 MB, 270 views)
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
Wanna see the longest Linux BASH script ever made? click here.
The Following 7 Users Say Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
Tower1972
Old
#2  
Tower1972's Avatar
Senior Member
Thanks Meter 198
Posts: 960
Join Date: Mar 2008
Location: Somewhere in Wisconsin
this requires root like the one made for the LG?
AT&T HTC One M8 ex-Harmon Kardon edition!
ARHD 10.2 Android 4.4.3!
Rooted, bootloader unlocked, SuperCID
TWRP 2.7.1.0
Moto 360 Silver/gray!
 
AdamOutler
Old
#3  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9,623
Posts: 5,196
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
Quote:
Originally Posted by Tower1972 View Post
this requires root like the one made for the LG?
Yes it requires root.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
Wanna see the longest Linux BASH script ever made? click here.
The Following User Says Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
Tower1972
Old
#4  
Tower1972's Avatar
Senior Member
Thanks Meter 198
Posts: 960
Join Date: Mar 2008
Location: Somewhere in Wisconsin
Quote:
Originally Posted by AdamOutler View Post
Yes it requires root.
Well...there is one other guy here (aside from me) who is looking on how to root this thing. We both read your post and seen all the work you did, but at the very bottom, someone commented that doing so wouldnt be a wise idea lol. So I THINK we are waiting for see who will take the first shot !
AT&T HTC One M8 ex-Harmon Kardon edition!
ARHD 10.2 Android 4.4.3!
Rooted, bootloader unlocked, SuperCID
TWRP 2.7.1.0
Moto 360 Silver/gray!
 
AdamOutler
Old
#5  
AdamOutler's Avatar
Recognized Developer - OP
Thanks Meter 9,623
Posts: 5,196
Join Date: Feb 2011
Location: Louisiana

 
DONATE TO ME
Quote:
Originally Posted by Tower1972 View Post
Well...there is one other guy here (aside from me) who is looking on how to root this thing. We both read your post and seen all the work you did, but at the very bottom, someone commented that doing so wouldnt be a wise idea lol.
Install TWRP, use that to root your device. Then remove the /System/app/Superuser.apk.

Boot into TWRP
Mount the system
Use the TWRP terminal emulator
rm /system/app/SuperSU.apk

You don't want to use my thread except for the stock firmware flash if you get in a jam.
Flash with Odin on Windows, Linux and Mac. Use JOdin3, Available in a web browser or offline
Check out my developer pages. Add me to your circles on Google Plus.
Wanna see the longest Linux BASH script ever made? click here.
The Following 2 Users Say Thank You to AdamOutler For This Useful Post: [ Click to Expand ]
 
Tower1972
Old
#6  
Tower1972's Avatar
Senior Member
Thanks Meter 198
Posts: 960
Join Date: Mar 2008
Location: Somewhere in Wisconsin
Quote:
Originally Posted by AdamOutler View Post
Install TWRP, use that to root your device. Then remove the /System/app/Superuser.apk.

Boot into TWRP
Mount the system
Use the TWRP terminal emulator
rm /system/app/SuperSU.apk

You don't want to use my thread except for the stock firmware flash if you get in a jam.
Im going to take this to the proper thread..sorry for hijacking it
AT&T HTC One M8 ex-Harmon Kardon edition!
ARHD 10.2 Android 4.4.3!
Rooted, bootloader unlocked, SuperCID
TWRP 2.7.1.0
Moto 360 Silver/gray!
The Following User Says Thank You to Tower1972 For This Useful Post: [ Click to Expand ]
 
Tower1972
Old
#7  
Tower1972's Avatar
Senior Member
Thanks Meter 198
Posts: 960
Join Date: Mar 2008
Location: Somewhere in Wisconsin
well ill be...it works lol...Thank ya!!
AT&T HTC One M8 ex-Harmon Kardon edition!
ARHD 10.2 Android 4.4.3!
Rooted, bootloader unlocked, SuperCID
TWRP 2.7.1.0
Moto 360 Silver/gray!
The Following User Says Thank You to Tower1972 For This Useful Post: [ Click to Expand ]
 
therider4u
Old
#8  
Junior Member
Thanks Meter 0
Posts: 4
Join Date: Aug 2013
Default Useful One

Useful App

Quote:
Originally Posted by AdamOutler View Post
Its difficult and annoying to try to put the Galaxy Gear into bootloader mode. Recovery takes a couple of extra steps. I made a quick wear app that allows for rebooting to Bootloader, Recovery and plain ol' reboot. Google won't allow me to upload API level 20 yet(Android L beta), and my device wont accept API level 19. So, I've attached the apk to this post.


Download Here:http://forum.xda-developers.com/atta...1&d=1407200684

Image:


here's the code.

Code:
public class RebootMenu extends Activity implements OnClickListener {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reboot_menu);
        final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
        stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
            @Override
            public void onLayoutInflated(WatchViewStub stub) {
                setupWidgets();
            }
        });
    }

    private void setupWidgets() {
        Button reboot = (Button) findViewById(R.id.reboot);
        Button recovery = (Button) findViewById(R.id.recovery);
        Button bootloader = (Button) findViewById(R.id.bootloader);

        reboot.setOnClickListener(this);
        recovery.setOnClickListener(this);
        bootloader.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) { // view handler
        switch (v.getId()) {
            case R.id.reboot:
                reboot("");
                break;
            case R.id.recovery:
                reboot("recovery");
                break;
            case R.id.bootloader:
                reboot("bootloader");
                break;
        }
    }

    private void reboot(String mode) {
        String[] command = new String[]{"su", "-C", "reboot", mode};
        try {
            Process process = new ProcessBuilder(command).start();
        } catch (IOException e) {
        }
    }
}
 
panthersdzynes
Old
#9  
panthersdzynes's Avatar
Member
Thanks Meter 2
Posts: 52
Join Date: Feb 2008
Location: Evansville, Indiana
It's crazy to think that we can do so much with a watch. Lol. Thanx for this, been looking for an easier way to put in dl mode n such. Appreciate the work!
Device: - Samsung galaxy Galaxy S5 Active, AT&T, Unlocked bootloader, Safestrap
Device: - Samsung Galaxy Note 3, Verizon, SIM Unlocked, Unlocked bootloader, Safestrap, Currently using Jasmine ROM 2.3

Device: - Samsung Galaxy Gear
Device: - Samsung Galaxy Note 10.1 2014 Edition
Device: - Apple iPhone 5
Device: - Apple iPad 2
Device: - Apple iPhone 4
Device: - HTC 8525
Device: - HTC Fuze aka Raphael (AT&T)
Device: - HTC Tilt 2 aka Rhodium aka HTC Fortress (ST7377)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes