System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
System directories
Method | Result |
---|---|
Environment.getDataDirectory() | /data |
Environment.getDownloadCacheDirectory() | /cache |
Environment.getRootDirectory() | /system |
External storage directories
// Obtain a SurfaceView. | |
// SurfaceView surfaceView = (SurfaceView)findViewById(R.id.surfaceView1); | |
Canvas canvas = surfaceView.getHolder().lockCanvas(); | |
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); | |
// Draw someting | |
surfaceView.getHolder().unlockCanvasAndPost(canvas); |
// This is an outdated way to do this... | |
// Inspired by: | |
// http://stackoverflow.com/questions/8560501/android-save-image-into-gallery/8722494#8722494 | |
// https://gist.github.com/samkirton/0242ba81d7ca00b475b9 | |
public static void saveImageToGallery(ContentResolver cr, String imagePath) { | |
String title = "Saved From Glance"; | |
String description = title; |
So we're working on creating Android Material Awesome, a library which will hopefully incorperate the benefits of Material Design, Twitter's Bootstrap, and FontAwesome. What we really wanted is a project other people can easily include into their projects using gradle dependencies. To do this we needed to create a standalone library project so we could make it as lightweight as possible for including as a dependency, and a sample app that would use it for testing. These are the steps we took to get started in Android Studio (version 1.1).
The first thing we needed to do was to create two new projects, with all the default settings (Blank Activity etc). One for our sample app, and one for our library. We added both of ours into the same GitHub repo, however you can save them wherever you like.
package com.pixite.fragment.widget; | |
import android.content.res.Resources; | |
import android.graphics.Canvas; | |
import android.graphics.ColorFilter; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.graphics.drawable.Drawable.Callback; | |
import android.view.Gravity; |
package cc.cubone.turbo.core.rom; | |
import android.os.Build; | |
import android.view.Window; | |
import android.view.WindowManager; | |
import java.lang.reflect.Field; | |
import java.lang.reflect.Method; | |
/** |
import React, { Component } from 'react'; | |
import { TextInput } from 'react-native'; | |
class Input extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
text: '' | |
}; | |
} |
This is an old way to Upload an Image from camera or gallery in WebView. It was made a long time ago and is not maintened anymore. Use it at your own risk.
import android.media.AudioFormat | |
import android.media.AudioRecord | |
import android.media.MediaRecorder | |
import java.io.IOException | |
import java.io.InputStream | |
class AudioInputStream( | |
audioSource: Int = MediaRecorder.AudioSource.DEFAULT, | |
sampleRate: Int = 44100, | |
channelConfig: Int = AudioFormat.CHANNEL_IN_MONO, |
import 'package:flutter/animation.dart'; | |
import 'package:flutter/material.dart'; | |
class AutoScrollText extends StatefulWidget { | |
final double height; | |
final List<Widget> items; | |
AutoScrollText({this.height = 24.0, this.items}); | |
@override | |
State<StatefulWidget> createState() => new _AutoScrollTextState(); |