Skip to content

Instantly share code, notes, and snippets.

View vishhmakasana's full-sized avatar
🏠
Working from home

Vishal Makasana vishhmakasana

🏠
Working from home
View GitHub Profile
@vishhmakasana
vishhmakasana / AppDelegate.swift
Created April 28, 2023 06:30
How to communicate with native code from flutter?
/// iOS Swift Code
import Flutter
let CHANNEL = "com.example.native_calls"
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
@vishhmakasana
vishhmakasana / CameraActivity.java
Created November 27, 2015 12:11
Complete example of taking camera picture in Android. Tested complete. Works like charm in all device and all version.
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File photoFile = null;
try {
photoFile = createImageFile();
} catch (IOException ex) {
}
// Continue only if the File was
// successfully created
if (photoFile != null) {
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile));
@vishhmakasana
vishhmakasana / IntroVideoView.java
Last active August 10, 2020 14:11
In Android Play mp4 video as a background intro video in your app like latest freelancer app plays it on their intro page of android app.
package com.example.videointro;
import java.io.IOException;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.media.MediaPlayer;
import android.os.Build;
import android.util.AttributeSet;