I am trying to add my textFile onto my android emulator in Visual Studio. Can anyone help on how to do so?

Ali, Bilal (Student) 1 Reputation point
2021-03-12T11:58:46.353+00:00

Working on an application. I have a text file created filled with data and am trying to get it onto the emulator to access it from the device. Anyone have any tips or know how to do so. Thanks in advance.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,362 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 76,471 Reputation points Microsoft Vendor
    2021-03-12T13:31:08.57+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    First of all, please just only one android emulator. Then open Android Adb Command Prompt like following screenshot.

    77251-image.png

    For example, I put a file to Desktop, then I want to copy this text file to sdcard, I used following command to execute it

       adb push C:\Users\xxxxusername\Desktop\Topic.txt  /mnt/sdcard/myfile.txt  
    

    Here is running screenshot.

    77189-image.png

    Best Regards,

    Leon Lu


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.