Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i fetch Whatsapp user's status and display in my android app?

I want to fetch live status from Whatsapp into my android activity. Is it possible to do this? If yes your guidance will be really appreciated.

Please see the image i want to make an activity containing all the statuses. Just like the image

Thanks

like image 916
Nauman Shafqat Avatar asked Apr 14 '18 07:04

Nauman Shafqat


2 Answers

WhatsApp store showed status to your device memory or sd card WhatsApp/Media/.Statuses folder. This folder is hidden. You can fetch data from there.

like image 51
RVK Avatar answered Oct 23 '22 22:10

RVK


For Kotlin Lover

   companion object {
    const val WHATSAPP_STATUS_FOLDER_PATH = "/WhatsApp/Media/.Statuses/"
   }

   fun getImagePath(): ArrayList<String> {
    // image path list
    val list: ArrayList<String> = ArrayList()

    // fetching file path from storage
    val file = File(Environment.getExternalStorageDirectory().toString() + WHATSAPP_STATUS_FOLDER_PATH)
    val listFile = file.listFiles()

    if (listFile != null && listFile.isNullOrEmpty()) {
        Arrays.sort(listFile, LastModifiedFileComparator.LASTMODIFIED_REVERSE)
    }

    if (listFile != null) {
        for (imgFile in listFile) {
            if (
                imgFile.name.endsWith(".jpg")
                || imgFile.name.endsWith(".jpeg")
                || imgFile.name.endsWith(".png")
            ) {
                val model = imgFile.absolutePath
                list.add(model)
            }
        }
    }

    // return imgPath List
    return list
}
like image 37
Tarif Chakder Avatar answered Oct 23 '22 20:10

Tarif Chakder