Skip to content

Instantly share code, notes, and snippets.

🏢
Jr. Java Developer in Speridian

Badar Khan ツ badarshahzad

🏢
Jr. Java Developer in Speridian
  • Trainee Consultant at Speridian Technologies. #ReactNative #React #Android and lover of <3 JavaScript #ReactNative #React #Android and lover of <3 JavaScript
  • Mianwali, Punjab, Pakistan
Block or report user

Report or block badarshahzad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View GetCountriesNameGet.java
//Get the all countries name
public static ArrayList<String> getCountriesName() {
ArrayList<String> list = new ArrayList<String>();
String[] locales = Locale.getISOCountries();
for (String countryCode : locales) {
Locale obj = new Locale("", countryCode);
@badarshahzad
badarshahzad / README.md
Created Oct 26, 2018
BucketListApp Activities
View README.md

Faced Error:

A problem occurred evaluating root project 'BucketListApp'.

Could not find method google() for arguments [] on repository container.

@badarshahzad
badarshahzad / commands.js
Created Oct 11, 2018
Here is the couple commands for the Android & React Native
View commands.js
/*******************
* Android
*******************/
Where is the emuator in your directory:
/root/Android/Sdk/emulator
$> ./emulator -list-avds
@badarshahzad
badarshahzad / TextviewButton.js
Created Jul 12, 2018
How does map((word) => word && '🇵🇰').join(' ') actually working ? well I know how the map works but why 'word && '🇵🇰' is needed. Because if I remove the word with && then the flag already appeared before any text. While if this same code sample execute then only flag will be appeared only if the word is typed in the Textview. Can you enlighten m…
View TextviewButton.js
import React from 'react';
import { StyleSheet, Text, View, TextInput, Alert, Button, FlatList, Image } from 'react-native';
import { ViewPagerAndroid } from 'react-native-gesture-handler';
let dumiDataArray = [{ key: 'Badar' },
{ key: 'Khan' },
{ key: 'Badri' },
{ key: 'Sudo' },
{ key: 'Kaka' },
{ key: 'Khan' },
@badarshahzad
badarshahzad / basicJavaScriptLookUp.js
Created Jun 27, 2018
Basic JavaScript: Profile Lookup We have an array of objects representing different people in our contacts lists. A lookUpProfile function that takes name and a property (prop) as arguments has been pre-written for you. The function should check if name is an actual contact's firstName and the given property (prop) is a property of that contact.…
View basicJavaScriptLookUp.js
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
@badarshahzad
badarshahzad / DashboardFragment.java
Created Apr 19, 2018
The Gpio pin work as a static fine but to work as normal like creation of gpio pin as a private or public variable at class level or in life cycle of fragment didn't work.
View DashboardFragment.java
package com.badarshahzad54.pcbs.presentation.fragments;
import android.app.Fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
@badarshahzad
badarshahzad / MainActivity.java
Last active Apr 17, 2018
The static variable for Gpio pin work but withou static its not working.
View MainActivity.java
/**
* A simple {@link Fragment} subclass.
*/
public class DashboardFragment extends Fragment implements DeviceRecyclerAdapter.ListItemClickListeners,
OnBoomListener, SelectIconInterface {
private static final String TAG = DashboardFragment.class.getSimpleName();
private static final String APPLIANCES_KEY = "appliances_key";
@badarshahzad
badarshahzad / MCP3008.java
Last active Apr 3, 2018
Android Things MCP3008 example
View MCP3008.java
package com.badarshahzad54.pcbs.mcp3008;
import com.google.android.things.pio.Gpio;
import com.google.android.things.pio.PeripheralManagerService;
import java.io.IOException;
/*
Paul Trebilcox-Ruiz
@badarshahzad
badarshahzad / background.xml
Created Mar 15, 2018
Add background xml view
View background.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/colorDark" />
<size android:width="42dp"
android:height="42dp"/>
</shape>
@badarshahzad
badarshahzad / Error Log
Created Jan 21, 2018
Things application Error Log
View Error Log
01-21 21:08:36.577 1810-1859/com.badarshahzad54.pcbs E/FA: Discarding data. Failed to send app launch
01-21 21:08:36.578 1810-1859/com.badarshahzad54.pcbs E/FA: Failed to get app instance id
01-21 21:08:36.579 1810-1859/com.badarshahzad54.pcbs E/FA: Failed to send current screen to service
01-21 21:08:36.580 1810-1859/com.badarshahzad54.pcbs E/FA: Discarding data. Failed to send event to service
01-21 21:09:01.279 1810-1859/com.badarshahzad54.pcbs E/FA: Failed to send current screen to service
01-21 21:09:01.279 1810-1859/com.badarshahzad54.pcbs E/FA: Discarding data. Failed to send event to service
You can’t perform that action at this time.