android - Is there a way to get a File path to a Drawable compiled into the project? -
Code> content values = new content value (); Values.put (Bluetooth share.URI, Uri.fromFile (new file (filePath)). ToString ()); Values.put (BluetoothShare.DESTINATION, device.getAddress ()); Values.put (Bluetooth Share Direction, Bluetooth Share. DIRECTION_OUTBOUND); Long ts = System.currentTimeMillis (); Values.put (Bluetooth share.TIMESTAMP, ts); Uri Content URI = C. Gate Content Resolver (). Enter (Bluetooth Share, Contransurance, Value); LD. ("Insert content": "+ contentUri +" on device: "+ device.getName ());
This works perfectly for files on sdcard (this Note, on the second line of the sample, the file path is being passed).
But now I allow the user to print compiled images in the app.
It seems that the Drawable Folder does not have its direct path because of how Android has its image based on the device Prepares them, I'm curious that I can go through this printing method to get some code so that it can print embedded images in the app.
last Uri Uri = Uri. PRS ("android.resource: //your.package.here/drawable/image_name"); Values.put (Bluetooth Share.URI, Yuri);
Comments
Post a Comment