Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't create Sample Data Directory - Android Studio

I"m trying to Create a sample data directory, using Android Studio, by clicking on app in the project view and then right mouse click to find the menu item New > Sample Data Directory.

It is not working.

like image 595
mcarmel90 Avatar asked Mar 03 '19 19:03

mcarmel90


People also ask

What is sample data directory?

The sample data collection file is a regular JSON file. This file is placed in sampledata folder in the root of your application module. It is also possible to create this using android studio by right clicking on the module and navigating to New > Sample Data Directory as shown in the screenshot below.

How do I access Appdata on Android?

Accessing all of the files on your Android device is really simple: Open your devices' App drawer – Depending on the version of Android software you're running you can click on the home screen icon that has several dots or you can swipe up on the screen. Use the search bar to quickly locate the 'File Manager' app.


1 Answers

Creating the directory via android studio doesn't always work. You may need to create the directory manually in your directory structure (at /app/sampledata/) without using Android Studio. Once you create it (e.g., via Windows Explorer) it should show up in Android Studio. See the the following answer for more information about sample data in general: How to put new placeholder resources into Android Studio project ("tools:sample" resources)?

"Unlike resources like images, fonts, etc. The sample data does not go in /res/ (they are not compiled with the app, hence. It is probably easier to filter them out by putting them in a totally separate directory). They go in /app/sampledata/, for example: /app/sampledata/image.png."

like image 144
Shawn Avatar answered Sep 30 '22 23:09

Shawn