Skip to content

Instantly share code, notes, and snippets.

View the-dagger's full-sized avatar
🚀
To Boldly Go Where No Man Has Gone Before

Harshit Dwivedi the-dagger

🚀
To Boldly Go Where No Man Has Gone Before
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.otaliastudios.cameraview.CameraView
android:id="@+id/cameraView"
android:layout_width="match_parent"
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Fritz.configure(this)
cameraView.addFrameProcessor { frame ->
//This returns a frame, which cann be used to retrieve the preview
}

GSoC 2016 Work Product, Harshit Dwivedi - FOSSASIA

This summer, I worked on FOSSASIA's Open Event Android App Generator for generating a customized android app for any event and enhanced the already existing Android app by adding a schedule in it and various UI/UX enhancements.
The app-generator server is hosted on a VPS server and runs on ubuntu

It takes in the data entered by the user on the generator website and then using that data and our app's source code generates an app customized to their need and emails it to them.
User can either upload an API endpoint or a zip containing json files on the generator where the data to be displayed in the app will be fetched from

A test setup of our project can be accessed here

bazel build --cxxopt='--std=c++11' -c opt \
--fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a \
//tensorflow/lite/java:tensorflow-lite
...
#include "tensorflow/lite/java/src/main/native/normalize.h"
#include "tensorflow/lite/java/src/main/native/predict.h"
#include "tensorflow/lite/java/src/main/native/extract_feature.h"
namespace tflite {
...
import 'package:flutter/material.dart';
import 'package:http/http.dart' show post;
import 'package:login_stateful/src/mixins/validation_mixin.dart';
class LoginScreen extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return LoginScreenState();
}
}
class MainActivity : AppCompatActivity() {
private lateinit var renderScript: RenderScript
private lateinit var yuvToRGB: ScriptIntrinsicYuvToRGB
private var yuvDataLength: Int = 0
private lateinit var allocationIn: Allocation
private lateinit var allocationOut: Allocation
private lateinit var bitmapOut: Bitmap
private val itemMap by lazy {
class MainActivity : AppCompatActivity() {
//Map that will contain a key-value combination of detected items
private val itemMap by lazy {
hashMapOf<String, Int>()
}
override fun onCreate(savedInstanceState: Bundle?) {
val objectPredictor = FritzVisionObjectPredictor.getInstance(this)
var fritzVisionImage: FritzVisionImage
cameraView.addFrameProcessor { frame ->
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
val objectPredictor = FritzVisionObjectPredictor.getInstance(this)
var fritzVisionImage: FritzVisionImage
cameraView.addFrameProcessor { frame ->
if (yuvDataLength == 0) {
//Run this only once
initializeData()
}
class MainActivity : AppCompatActivity() {
private lateinit var renderScript: RenderScript
private lateinit var yuvToRGB: ScriptIntrinsicYuvToRGB
private var yuvDataLength: Int = 0
private lateinit var allocationIn: Allocation
private lateinit var allocationOut: Allocation
private lateinit var bitmapOut: Bitmap
//Rest of the code