Where to find assets in the Device File Explorer of Android Studio? - android-studio

I've created an asset folder and placed my GUI.png image in it (left image).
But i can't find the image in the Device File Explorer after the app is started in the AVD emulator.
Where was it placed?
Is it supposed to be in /data/data (right image) ?

Android allow us to use two parts of memeory:
1 as internal
and
1 as external (generally refered as SD card).
"Device File Explorer" is used to see the internal files (that too in debug mode).
Your "data" folder is part of source (code), it has nothing to be seen in internal storage folder of app in device.
You will see a file inside "data/data/" folder, if specifically you have written code to copy it there.

Related

There is no external storage in "Device File Explorer"

I created an AVD with Sdcard with 2GB capacity in android studio. I need to upload my files in Sdcard(Not Internal that is name Sdcard) but there is no Sdcard in "Device File Explorer", There is just only internal memory with name "Sdcard" . I tried to upload my files to internal storage and move them to sdcard in next step but none of those files doesnt show in gallery and this solution it's not worked for me, Even I tried "Media Provider" in "Dev Tools" but Dev Tools crashes after clicking on "Scan Sdcard" Button. My app needs to load files using "MediaStore" and if images & videos on Sdcard are exists they wiil not load in my app
I created another avd again and sdcard showed up.
But to load images & videos from sdcard in gallery, I have to eject & mount sdcard on changing sdcard content every time

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.
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."
You can create a sample data directory in Android Studio itself by following the below steps:
Change the view of directory structure from Android to Project as follows
Right click app folder and select New->Directory
Finally, give a name to your directory, in your case, it should be sampledata
I have already created sampledata directory that's why it says "Directory already exists".
That's it. You have done it. Remember that Android Studio also supports loading sample data from a json file. All you have to give is fully qualified name of the key residing in the json file.
Ex- if your json file contains key name inside a Json Array student, then you have to specify it as "#sample/your_student_file.json/student/name" to use values present in key name.
Unless your issue happens to be different, this is a known issue that only affects Windows. As I've found, it has something to do with 'C:\' in the file path.
https://issuetracker.google.com/issues/124553391
As Shawn mentioned, you need to manually create the directory.
I've been unable to get the images to actually display in the previewer, which I suspect may also be caused by the file path bug.
Inside the app folder in file explorer, You can create a new folder (sample data) which will be reflected in your android studio.

Distribute MonoTouch app to testers using Organizer?

I am trying to archive my MonoTouch app and to supply it to our testers using Apple's/Xcode's organizer.
Can somebody tell me how to do that? In ObjC projects I can archive an application. But how can I achieve the same in MT/MonoDevelop?
My starting point was this documentation:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/145-Distributing_Applications/distributing_applications.html
René
The archive that Xcode provides is in the form of an .ipa file. This is a glorified zip file with a certain expected file structure.
The .ipa is made up of the following components:
A folder named "Payload", which contains the compiled
(release/iPhone) .app
a 57x57 .png icon file (which is displayed while the app is being
downloaded)
a 512x512 .png file of the icon once again - however this has to
renamed itunesartwork with no extension
iTunesMetadata.plist - this contains information about the app,
such as copyright name, genre, itemname, softwareIconNeedsShine (you
can google what information this needs).
The way I package up our .ipa, is I have a folder called "App Packaging" which has all of these components already in, and I simply update the .app file whenever we do an upload, "Compress..." then rename the file to x.ipa (OS X will ask if you want to use this extension, make sure you select ("use .ipa" !).
You can then send the file to the testers to install via itunes. If the testers are all testing on devices that are iOS 4.0+ then it is possible to distribute this over the air as well but I can go into that only if you would like me to?
EDIT - Over the air distribution
It is possible to do over the air distribution of apps as well. We use it for distribution of an enterprise app we develop but it is possible to use it for testing purposes as well. It should be noted here that in order for the app to installed, the device needs to be included in the provisioning profile you signed the app with (but you knew that already!).
In order to do over the air, you need 3 things:
the .ipa file we created earlier.
a 57x57 .png icon file (same as the one included in the .ipa preferably)
a file called "Manifest.plist"
The Manifest plist contains the following structure/information:
You'll then want to upload all of these files to your website/intranet etc. In order to download the app, you'll need to create a page that points to the Manifest.plist file and then then iOS takes care of the rest and downloads the app from the location specified in the manifest.
There is now a much much easier way. On the Project menu in MonoDevelop, choose Publish to TestFlight.
You'll need a free TestFlightApp.com account, but it works great!

Turn a folder into a bundle/package for iTunes file sharing

iTunes File Sharing for iOS apps allows users to pull down folders from apps via syncing to the device but it doesn't allow the reverse and load in directories from a computer to the device. Is there a way to make a in-app folder a bundle/package like a .app package so that the OS thinks it is a file rather than a directory?
From what I can tell GarageBand for the iPad is doing exactly this for files off the device. The context menu on the exported file in the Finder allows you to "Show Package Contents".
I appended a made up extension to the directory path and it shows up in iTunes as a file, but on export it comes out as a directory.
The following worked for me:
Rename folder to <foldername>.pkg
Drag it into the file sharing panel
In the file sharing panel, rename it back to <foldername>
I just found! Windows users can use iExplorer!
Start iExplorer (available at this URL http://www.macroplant.com/iexplorer/)
Connect iOS device to PC using USB cable
Find this folder: "Apps" > [YOUR_APP] > "Documents"
Drag and Drop the bundle/package into "Documents" folder
Note: A bundle/package on Mac is simply a folder on Windows. There is no need to have any file extension like .pkg on Windows.

MonoTouch Enterprise - Deployment

Our firm has begun building MonoTouch iPad/iPhone apps for enterprise deployment.
How do I take the app and create a *.ipa file for upload to our MDM server?
An .ipa file is basically a glorified .zip file. There are a couple of routes you can go down:
Export the project to xcode and under "Build" click "Build and Archive" - fill in the appropriate details and the project should create the .ipa for you as expected.
If this isn't an option, (which it isnt for us, so this is the method I've used, to great success) you can simply create all the components that go into the .ipa and right-click, "Compress..." in Finder.
The .ipa is made up of the following components:
A folder named "Payload", which contains the compiled (release/iPhone) .app
a 57x57 .png icon file (which is displayed while the app is being downloaded)
a 512x512 .png file of the icon once again - however this has to renamed itunesartwork with no extension
iTunesMetadata.plist - this contains information about the app, such as copyright name, genre, itemname, softwareIconNeedsShine (you can google what information this needs).
The way I package up our .ipa, is I have a folder called "App Packaging" which has all of these components already in, and I simply update the .app file whenever we do an upload, "Compress..." then rename the file to x.ipa (OS X will ask if you want to use this extension, make sure you select ("use .ipa" !).
With the current Monodevelop (2.8.6.5) and Monotouch (5.2.5) it is as easy as right clicking on your project -> options -> iPhone IPA Options -> check Build ad-hoc/enterprise package (IPA) for the desired configuration.
We created a special configuration called Distribution which builds using the Distribution Certificate and In House Distribution Profile.
Luke, I like your answer and have given you the credit. I am adding some more details for my own, and others, notes.
Use SpotLight to find one of your own MonoTouch apps. Search on ".ipa".
Rename it to SomeThing.Zip
Unzip it.
You can then use the structure of the unzipped folder to edit then rezip.
Just another way to get an IPA that made it easy for me, drag your .app file onto your itunes library and sync your device. ITunes then creates a copy of the app as an .ipa file in the user/music/itunes/itunes media/mobile applications. This can then be distributed much easier than the .app file.

Resources