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 'package:flutter/material.dart'; | |
class MainScreen extends StatefulWidget { | |
@override | |
_MainScreenState createState() => _MainScreenState(); | |
} | |
class _MainScreenState extends _BaseStatefulState<MainScreen> { | |
@override | |
Widget build(BuildContext context) { |
/* | |
This method can be used to download an image from the internet using a url in Android. This use Android Download Manager to | |
download the file and added it to the Gallery. Downloaded image will be saved to "Pictures" | |
Folder in your internal storage | |
*/ | |
private void downloadImageNew(String filename, String downloadUrlOfImage){ | |
try{ | |
DownloadManager dm = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE); | |
Uri downloadUri = Uri.parse(downloadUrlOfImage); |
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(); |
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 React, { Component } from 'react'; | |
import { TextInput } from 'react-native'; | |
class Input extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
text: '' | |
}; | |
} |
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; | |
/** |
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; |
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.
// 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; |