This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.widget.Toast | |
import androidx.fragment.app.Fragment | |
inline fun Context.toast(message:()->String){ | |
Toast.makeText(this, message() , Toast.LENGTH_LONG).show() | |
} | |
inline fun Fragment.toast(message:()->String){ | |
Toast.makeText(this.context, message() , Toast.LENGTH_LONG).show() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2008 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.Socket; | |
public class Client { | |
public static void main(String[] args) throws IOException { | |
// need host and port, we want to connect to the ServerSocket at port 7777 | |
Socket socket = new Socket("localhost", 7777); | |
System.out.println("Connected!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressLint("Range") | |
private boolean downloadUpdate() { | |
boolean flag = false; | |
try { | |
final File apk_file_path = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), fileName); | |
if (apk_file_path.exists()) apk_file_path.delete(); | |
Log.v(TAG, "Downloading request on url :" + BaseUrl); | |
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(BaseUrl)); | |
request.setDescription("Update the App تحديث التطبيق"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.eldiosantos.testes.controller; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class EmailValidator { | |
private final String emailValidationPattern = "[a-z0-9!#$%&\'*+/=?^_\'{|}~-]+(?:.[a-z0-9!#$%&\'*+/=?^_\'{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"; | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.TargetApi | |
import android.content.BroadcastReceiver | |
import android.content.Context | |
import android.content.Intent | |
import android.content.IntentFilter | |
import android.net.* | |
import android.os.Build | |
import androidx.annotation.RequiresApi | |
import androidx.lifecycle.LiveData |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
//-----GLOBAL VARIABLES----- | |
final Color mainColor = Color(0xFFFF5656); | |
final List<MountModel> mountItems = [ | |
MountModel( | |
path: | |
'https://sa.kapamilya.com/absnews/abscbnnews/media/2021/afp/01/17/20210116-mt-semeru-indonesia-ash-afp-s.jpg', | |
name: 'Mount Semeru', |
NewerOlder