Skip to content

Instantly share code, notes, and snippets.

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

yudi karma yudikarma

🏠
Working from home
View GitHub Profile
package com.example.lideadwi.patuhoat.Activity;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
package com.example.alfattah.absensiproject.Fragment_Dashboard;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.support.annotation.NonNull;
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.alfattah.absensiproject">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@Override
public void onMapReady(final GoogleMap googleMap) {
// latitude and longitude
final double latitude = 17.385044;
final double longitude = 78.486671;
FirebaseDatabase.getInstance().getReference().addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
DataSnapshot dataSnapshot1 = dataSnapshot.child("Checkin");
Iterable<DataSnapshot> checkinchildren = dataSnapshot1.getChildren();
package com.example.alfattah.absensiproject.Fragment_Dashboard_Staff;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
package com.example.PT107.task107_imagesqilte;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
@yudikarma
yudikarma / get location android GPS and Network Provider
Last active July 10, 2023 10:58
how to get current location android gps and network provider
package com.example.yudikarma.androidcamera.Helper;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
private void captureStillPicture() {
try {
if (null == mCameraDevice ) {
return;
}
// This is the CaptureRequest.Builder that we use to take a picture.
final CaptureRequest.Builder captureBuilder =
mCameraDevice.createCaptureRequest(CameraDevice.TEMPLATE_STILL_CAPTURE);
captureBuilder.addTarget(mImageReader.getSurface());
package com.example.yudikarma.androidcamera.Helper;
import android.content.Context;
import android.util.AttributeSet;
import android.view.TextureView;
/**
* A {@link TextureView} that can be adjusted to a specified aspect ratio.
*/
public class AutoFitTextureView extends TextureView {
/**
* @return The largest supported picture size.
*/
public Size getDefaultPictureSize() {
StreamConfigurationMap configs = mCharacteristics.get(
CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
android.util.Size[] supportedSizes = configs.getOutputSizes(sCaptureImageFormat);
// Find the largest supported size.
android.util.Size largestSupportedSize = supportedSizes[0];