Skip to content

Instantly share code, notes, and snippets.

Jr. Software Engineer

Badar Khan ツ badarshahzad

Jr. Software Engineer
  • Junior Full Stack Develper at Speridian Technologies. #ReactNative #React #Android and lover of <3 JavaScript #ReactNative #React #Android and lover of <3 JavaScript
  • Lahore, Punjab, Pakistan
View GitHub Profile
//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 /
Created Oct 26, 2018
BucketListApp Activities

Faced Error:

A problem occurred evaluating root project 'BucketListApp'.

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

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:
$> ./emulator -list-avds
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 / 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
var contacts = [
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
"firstName": "Harry",
badarshahzad /
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.
package com.badarshahzad54.pcbs.presentation.fragments;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
badarshahzad /
Last active Apr 17, 2018
The static variable for Gpio pin work but withou static its not working.
* 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 /
Last active Apr 3, 2018
Android Things MCP3008 example
package com.badarshahzad54.pcbs.mcp3008;
Paul Trebilcox-Ruiz
badarshahzad / background.xml
Created Mar 15, 2018
Add background xml view
View background.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android=""
<solid android:color="@color/colorDark" />
<size android:width="42dp"
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.