Formatted sd card android 6 Marshmallow

I have a big problem with recovering files from a SD Card.
I had a SD Card putted as internal memory on an Infinix android 6 Marshmallow, i’ve accidentally formatted the sd card when inserted on my PC to copy files, i’ve tested all the recovery program but no luck, i’ve found that when the sd card is used as internal it got encrypted.
So is there any way to recover files or to decrypt the sd card ?

Best Regards,

linux – restore data from internal storage of android phone

I am struggelling with the file recovery of an internal storage of an android phone.

I made a dd copy of the /dev/sda device which includes the system and userdata and some other partitions of the phone.

bla@bla:/media/Volume$ mmls sda.raw 
GUID Partition Table (EFI)
Offset Sector: 0
Units are in 4096-byte sectors

      Slot      Start        End          Length       Description
000:  Meta      0000000000   0000000000   0000000001   Safety Table
001:  -------   0000000000   0000000005   0000000006   Unallocated
002:  Meta      0000000001   0000000001   0000000001   GPT Header
003:  Meta      0000000002   0000000002   0000000001   Partition Table
004:  000       0000000006   0000000015   0000000010   padding0
005:  001       0000000016   0000016399   0000016384   recovery
006:  002       0000016400   0000032783   0000016384   boot
007:  003       0000032784   0001011727   0000978944   system
008:  004       0001011728   0001026063   0000014336   apppreload
009:  005       0001026064   0001041423   0000015360   cota
010:  006       0001041424   0015447055   0014405632   userdata
011:  007       0015447056   0015450106   0000003051   reserve0
012:  -------   0015450107   0015450111   0000000005   Unallocated

I am able to mount some partitions:

bla@bla:/media/Volume$ sudo fsstat -b 4096 -o 32784 sda.raw 
File System Type: Ext4
Volume Name: system
Volume ID: 7019a2b4b48a33b92c4409cbe0a229c7

Last Written at: 2020-05-28 21:04:07 (CEST)
Last Checked at: 2019-07-22 16:11:16 (CEST)

Last Mounted at: 2020-05-28 20:55:42 (CEST)
Unmounted properly
Last mounted on: /system

Source OS: Linux
Dynamic Structure
Compat Features: Journal, Ext Attributes, Resize Inode, Dir Index
InCompat Features: Filetype, Extents, Flexible Block Groups, 
Read Only Compat Features: Sparse Super, Large File, Huge File, Extra Inode Size

Journal ID: 00
Journal Inode: 8


But not the userdata partition. Are there any tricks I missed so far?

TestDisk 7.0, Data Recovery Utility, April 2015
Christophe GRENIER <>

Disk sda.raw - 63 GB / 58 GiB - CHS 7694 255 63
     Partition               Start        End    Size in sectors
>P MS Data                   262272    7971615    7709344 (system)
 P MS Data                  8093824    8208511     114688
 D MS Data                  8208512    8331391     122880
 D MS Data                  8331390  123576413  115245024 

Outputs for userdata:

bla@bla:/media/Volume$ sudo fsstat -b 4096 -o 1041424 sda.raw
Cannot determine file system type

Thanks for any hints in advance!


¿Se puede imprimir un .txt desde Android Studio?

Quería saber si es posible una vez escrito un fichero .txt de la siguiente manera en Android Studio:

OutputStreamWriter fichero = new OutputStreamWriter(openFileOutput("fichero.txt", Context.MODE_PRIVATE));
fichero.append("Lo que quiero escribir");

Si teniendo el fichero así, hay alguna forma sencilla de mandarlo a imprimir a una impresora.

Un saludo y gracias

Native debug on Android – Android Enthusiasts Stack Exchange

It has been a few years since I last needed to debug any native applications on Android. After poking around a bit I found this Google reference referring to gdbserver and

I found the former in the NDK


And the latter in the SDK


When I went to run the python script I am met with:

$ python
Traceback (most recent call last):
  File "", line 27, in <module>
    import gdbrunner
ImportError: No module named gdbrunner

For the life of me I cannot find any information on what gdbrunner is. Nor have I found any other reference to it in the (S/N)DKs.

Any idea? Is there another method to debug native components of Android not reliant upon this script?

Sending a customised Google Maps itinerary – as-is – to Android phone

I’d like to have a customised route available on my phone for turn-by-turn navigation. BY customised I mean an A-to-B-to-C-to… itinerary that has been dragged at various points along the route, starting from the originally computed itinerary. Detour points added by dragging are represented by large white dots:

enter image description here

Unfortunately, as it stands now, Google Maps does not allow sending this to the phone without removing all detour points defined by dragging:

enter image description here

One workaround is to redefine each detour point not by dragging but by adding its specific location (address, or lat/long), in which case the custom itinerary can be sent to the phone as-is. This has to be within the limit of no more than 10 named detour points, but then again the same limit also applies to dragged detour points, before the message “Route cannot be modified further” comes on.

The problem is that, for long tours, while you’re on the road, if you accidentally do an extra back tap on your phone, the entire itinerary is lost, and the only way to get it back is to use the “send to phone” command on an online computer, which may not be available.

Any solutions based on Google My Maps don’t seem good, as they all lack turn-by-turn navigation. Even more advanced options such as saving the tour as a GPX are out of the question if you’re going to navigate with Google Maps Android, as it does not do GPX.

Is there any way (even hacky) to retrieve the custom itinerary directly from the phone, without the need to send it from the computer?

samsung – Is it safe to manually “clear cache” of apps on Android?

Ever since I updated Device Care on my Samsung Galaxy A10s running Android Pie, I lost my “Clear Space” option that clears unnecessary data, including cache of all apps including system apps on my phone!

Since, I’m not installing any third party apps, for this purpose, I decided to manually “clear cache” of any desired apps from Settings > Apps > App name and tapping Clear Cache. To my surprise, I found the Gallery app has about half a GB of cache, and I immediately cleared it.

I realize that apps cache stuff to improve performance, predict data to auto fill on text boxes, and various other stuff, to improve user experience. But that’s taking up a lot of my Internal memory!

My question is :

  • Is this a safe practice?

  • Will this procedure damage the executable or normal functioning of my app?

  • Or, whether all these are dependent on the App developer / manufacturer ?

  • For default apps like Gallery or Chrome is this a safe practice?

bluetooth – Protocol to transmit audio from a smartwatch to Android

I’m currently currently trying to program a diy smartwatch. On my phone I’d like to run some kind of offline voice recognition like Mozilla’s DeepSpeech and on my smartwatch I’d like to run a program that takes the microphone input of the watch and send it to my phone so that I can use it with my voice recognition library.

So far so good, but I’m having a hard time finding the right protocol for transmitting the audio. The easiest way for me would be to create a serial connection over Bluetooth and send the audio over that, but that doesn’t sound like a very efficient solution. Ideally I would like to utilize Bluetooth Low Energy to get the most out of my battery, but I looked at the list of GATT characteristics and couldn’t find anything related to audio, microphones, voice recognition or the like.

I’m also thinking about making my smartwatch act as a Bluetooth Microphone, but it sounds like a lot of work to prevent Android to from taking over the microphone for use by the whole system and in addition to that I think it might be very problematic to quickly create such a connection and then drop it again because I only want to send audio when I really intend to send a voice command. I guess this could be done over A2DP?

But there are soo many other protocols. I’m just completely overwhelmed and don’t know what I should take a closer look at, for example:

File Transfer Profile (FTP)
Cordless Telephony Profile (CTP)
Generic Audio/Video Distribution Profile (GAVDP)
Hands-Free Profile (HFP)
Headset Profile (HSP)
Intercom Profile (ICP)

The smartwatch is powered by an ESP32 which unfortunately appears to only have a limited Bluetooth API supporting GAP, GATT, A2DP, AVRC, SPP and HFP.

I guess the actual question is, what would be a sane way of sending short audio recordings from an ESP32 powered Bluetooth smartwatch to a custom Android app?

(I don’t want to use use proprietary services like the Google Voice Assistent btw. It would however be interesting to know what protocol is being used for WearOS <-> Android communication when it comes to speech recognition.)