Skip to content

Instantly share code, notes, and snippets.

@RikkaW
RikkaW / gist:0ae7f51117768a03c6581c956d75958c
Last active November 28, 2024 01:01
insert general file with MediaStore
Context context = view.getContext();
ContentResolver cr = context.getContentResolver();
ContentValues values;
try {
// create a file for test
File file = new File(context.getFilesDir(), "1234568");
file.createNewFile();
try (OutputStream os = new FileOutputStream(file)) {
os.write("test".getBytes());
@z3ntu
z3ntu / android_configure.sh
Last active November 16, 2019 21:09 — forked from nddrylliog/android_configure.sh
Use this for cross-compiling native Applications for Android! Place this script preferably in ~/bin and add this folder to your path variable. Instead of using ./configure just call this script.
#!/bin/sh
# THIS SCRIPT IS FOR A STANDALONE TOOLCHAIN!!
# For more information please consult https://z3ntu.github.io/2015/12/12/Cross-compiling-native-linux-applications-for-android.html
# Don't forget to adjust this to your standalone toolchain path
export TOOLCHAIN_PATH=$HOME/Android/standalone-toolchain/
# This is just an empty directory where I want the built objects to be installed
export PREFIX=$HOME/Android/out/prefix
@nddrylliog
nddrylliog / android_configure.sh
Created February 1, 2013 00:51
Cross-compile autotools library for Android / arm-linux-androideabi I stick that in ~/bin/, chmod +x, and then run it in place of "./configure" in my project. Then a make and make install later, the prefix contains libraries built for android. Neato eh?
#!/bin/sh
# I put all my dev stuff in here
export DEV_PREFIX=$HOME/Dev/
# Don't forget to adjust this to your NDK path
export ANDROID_NDK=${DEV_PREFIX}/android-ndk-r8d/
export CROSS_COMPILE=arm-linux-androideabi