Author Archives : arifhasnat

Home  >>  Author : arifhasnat

SSLcommerz payment gateway integration (Sandbox)

25
Apr,2018

0

Step 1 : Go to this link https://developer.sslcommerz.com/registration/ and register . Step 2 : Login account with https://sandbox.sslcommerz.com/manage/ Step 3 : Go to console and click developer tab . you can now download android sdk file . You will find .aar file…

EOFException: End of input at line 1 column 1 path $ 

23
Apr,2018

0

EOFException: End of input at line 1 column 1 path $  or Retofit2 error java.io.EOFException: End of input at line 1 column 1 Reasons: This error message indicates a completely empty response, not the one you have indicated. If it’s an error…

Retrofit take List data as POST request body in android rest api call

18
Apr,2018

0

Step 1 :  create a request model that will take request body data package com.adn.api.order; import com.adn.Model.DBModel.AddToCartProductModel; import com.google.gson.annotations.SerializedName; import java.util.ArrayList; public class Order { @SerializedName(“customer_id”) String customer_id; @SerializedName(“firstname”) String firstname; @SerializedName(“lastname”) String lastname; @SerializedName(“email”) String email; @SerializedName(“products”) ArrayList<AddToCartProductModel> products;…

How to remote git repository from xCode project completely and create new repository

15
Apr,2018

0

Git keeps all of its files in the .git directory. Just remove that one and init again. If you can’t find it, it’s because it is hidden. In Windows 7, you need to go to your folder, click on Organize on the top left,…

Rest api development with lumen – part 1 : Environment setup

13
Apr,2018

0

Step 1 : Open command line tool or terminal for mac/ linux  and run this command for lumen installer . If you have not composer installed then download and install it from here ; https://getcomposer.org/ composer global require “laravel/lumen-installer” Step 2 :   Create a lumen project with following command …

Lumen Commands

22
Mar,2018

0

Database Migration : php artisan migrate

Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

20
Mar,2018

0

Sometimes application may be big in execution or heavy that time multidex should be enabled . Here is the full process to enable multidex in android

Android relative layout position

5
Mar,2018

0

Bottom :  android:layout_alignParentBottom=”true” Center :    android:layout_centerInParent=”true”

Android create border radius for Button , Views , EditText and others

4
Mar,2018

0

Step – 1: Create xml layout in drawable folder <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android” > <item android:state_pressed=”true” > <shape android:shape=”rectangle” > <corners android:radius=”3dip” /> <stroke android:width=”1dip” android:color=”#5e7974″ /> <gradient android:angle=”-90″ android:startColor=”#345953″ android:endColor=”#689a92″ /> </shape> </item> <item android:state_focused=”true”> <shape android:shape=”rectangle” >…

Android Fragment basic code structure

4
Mar,2018

0

public class BasicFragment extends Fragment { @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.basic_fragment_layout, container, false); return view; } }

IOS best network image download library – SDWebImage , Swift 3/4

2
Mar,2018

0

Sometimes network image doest not download and for that app may crash . To avoid this you can use SDWebImage library as like Picasso android library which will show a default placeholder image until file downloaded . To implement SDWebImage…

Android back pressed to exit the app dialog and exit app

1
Mar,2018

0

@Override public void onBackPressed() { super.onBackPressed(); AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this); alertDialogBuilder.setMessage(“Are you sure you want to exit the app?”); alertDialogBuilder.setPositiveButton(“yes”, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_HOME); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP |…

Android custom date picker

1
Mar,2018

0

Step -1 : Create a custom fragment import android.annotation.SuppressLint; import android.app.DatePickerDialog; import android.app.Dialog; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.view.View; import android.widget.DatePicker; import android.widget.EditText; import java.text.SimpleDateFormat; import java.util.Calendar; @SuppressLint(“ValidFragment”) public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { public static final String…

IOS Swift 3/4 show alert for specific time duration

1
Mar,2018

0

   let alert = UIAlertController(title: “”, message: “alert disappears after 30 seconds”, preferredStyle: .alert)             self.present(alert, animated: true, completion: nil)             // change to desired number of seconds (in this case3…

Android Beautiful Spinner view without Custom adapter

27
Feb,2018

0

To make this just bind spinner with cardview . and make it like the code bellow . now it will looks beautiful .   <android.support.v7.widget.CardView android:layout_width=”match_parent” android:layout_height=”@dimen/count_40dp” android:layout_marginLeft=”@dimen/count_5dp” android:layout_marginRight=”@dimen/count_5dp” android:layout_marginTop=”@dimen/count_10dp”> <Spinner android:id=”@+id/gender” android:layout_width=”match_parent” android:layout_height=”match_parent” /> </android.support.v7.widget.CardView>

Android Custom spinner .

27
Feb,2018

0

Step -1 : Create new Adapter . public class CustomSpinnerAdapter extends BaseAdapter implements SpinnerAdapter { private final Context context; private ArrayList<String> asr; public CustomSpinnerAdapter(Context context1, ArrayList<String> asr) { this.context = context1; this.asr=asr; } public int getCount() { return asr.size(); }…

Android remove underline of EditText

26
Feb,2018

0

android:background=”@android:color/transparent”

Firebase: A config file was found, but it indicates a project ID “priokotha-92c0e” that you dont appear to have access to. Request access or delete the file in order to proceed with the connection process.

19
Feb,2018

0

This error will occur if you are signed in to Android Studio and the Firebase Console with different accounts. In Android Studio, click on the small profile icon in the upper right corner to see your sign-in account. Do the…

ERROR:’keytool’ is not recognized as an internal or external command, operable program or batch file

18
Feb,2018

0

Step 1 : Download JDK : http://www.oracle.com/technetwork/java/javase/downloads/index.html and install it . Step 2 : Set the path on environment path . To do this My Computer – > Properties -> System variable -> Edit Path , click new and past…

Android firebase Phone verification authentication – OTP

18
Feb,2018

0

Step 1 : Go to firebase console . Go SIGN-IN METHOD and enable phone authentication option .   Step 2 : Open your build.gradle (app) and paste this firebase ui gradle and sync . Check firebase version code . It…

Error:Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’. > java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

18
Feb,2018

0

It may causes for several reasons – I have found 2 reason and solution .  Problem 1 : If you use firebase service and it’s gradle version are older version . Or google play service , gms service are not…

IOS short code – exit

18
Feb,2018

0

exit(0);

unable to boot device due to insufficient system resources. xcode

17
Feb,2018

0

Problem : unable to boot device due to insufficient system resources. xcode Please see Simulator Help for information on adjusting system settings to allow more simulated devices to boot at once. maxUserProcs: 709, runningUserProcs: 614, enforcedProcBuffer: 144 Solution : Open…

Firebase for android – Insert value as a list data

17
Feb,2018

0

Part : one – Go to firebase console and click database . If you want to insert database without authentication then go to database->rules tab and { “rules”: { “.read”: “auth == null”, “.write”: “auth == null” } } Part…

শেষ হাসি

16
Feb,2018

0

কে জানে কোন হাসি আমার শেষ হাসিটা ছিল , কোন সীমানায় দৃষ্টি আমার সপ্নে ভূলেছিল ।

ফেরা

15
Feb,2018

0

সব পাখি দিন শেষে নীড়ে আসে ফিরে ঘরময় ভালোবাসা রয়েছে যে ঘিরে । কিছু পাখি দল ছেড়ে দূরে চলে যায় জানেনি কেউ অবেলায় কেন এ বিদায় ।

Binary Search Algorithm – Deep thinking with Java

14
Feb,2018

0

import java.util.Scanner;   class BinarySearch { public static void main(String args[]) { int c, first, last, middle, n, search, array[];   Scanner in = new Scanner(System.in); System.out.println(“Enter number of elements”); n = in.nextInt(); array = new int[n];   System.out.println(“Enter “…

Android beautiful dialog and alert libraries

14
Feb,2018

0

1 . Lovely dialog is a nice dialog third party android library . There has some good functionality that makes it awesome .   2 . Sweet alert   is also a nice dialog and alert library . It’s also have animation that…

IOS – Main Thread Checker: UI API called on a background thread: -[UIApplication delegate] PID: 902, TID: 13120, Thread name: (none), Queue name: NSOperationQueue 0x604000037a20 (QOS: UNSPECIFIED), QoS: 0 Backtrace:

14
Feb,2018

0

Solution : use DispatchQueue.main.async { // Correct }     Updating UI from a Completion Handler Long-running tasks such as networking are often executed in the background, and provide a completion handler to signal completion. Attempting to read or update…

Firebase for android : Read list of data from database and show on recyclerview

13
Feb,2018

0

Part -1 : Take that we have some data field on child node named “user” . We will first retrieve all data and then we will show it on recyclerview. , public class UserListActivity extends AppCompatActivity { private DatabaseReference mDatabase;…

Java how to split from . (dot) or other character

13
Feb,2018

0

String textfile = “ReadMe.txt”;  String filename = textfile.split(“.”)[0];  String extension = textfile.split(“.”)[1];

Firebase for android : Part One – Project setup

13
Feb,2018

0

First of all you can get total setup manual from here . https://firebase.google.com/docs/android/setup I am describing here step by step : Part 1 : First create an android project . If already have then no need . We need project…

IOS application development with swift : Part-1 download xCode and environment setup

12
Feb,2018

0

It’s easy if you have a Mac book . But before to be a iOS application developer you need to have mac and iPhone for debug application but you can also use simulator for debug purpose . Let’s start for…

How to solve android debug .apk is corrupted , can not be installed .

12
Feb,2018

0

1 . Clean project . Go  Build -> Clean 2 . Go to Build-> Build Apk(s). After creating apk you will see a dialog as below.     That’s it . From stackoverflow      

Trick : How to upgrade android gradle version from lower to higher or vice-versa

12
Feb,2018

0

1 . It’s easy just create an new dummy app as like test_app . 2. Go the build.gradle and copy and replace the following code   apply plugin: ‘com.android.application’ android { compileSdkVersion 26 defaultConfig { applicationId “com.adndigitalbd.test” minSdkVersion 16 targetSdkVersion…

Git commands

9
Feb,2018

0

1 . Know remote repository name git config –get remote.origin.url 2 . Remote Branch current git branch 3 . Remote branch all git branch –all 4 . Git initialization git init (you need to do it first to run any…

PhoneGap or Cordova iOS build and import to Xcode

9
Feb,2018

0

Open Terminal and go to project folder like cd: Desktop/newProject run the command on terminal cordova platform add ios  and run the command cordova build  It will create  a platform folder in the project directory and inside project directory you…

!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`. You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

8
Feb,2018

0

Open Terminal and run this command that will add the source on master branch on cocoapod repos .   $ cd ~/.cocoapods/repos $ git clone https://github.com/CocoaPods/Specs.git master     if again issuing already has master branch and it’s not empty and completely…

How to uninstall cocoapod completely and install new

8
Feb,2018

0

1. Uninstall CocoaPods (choose to uninstall all versions): 1 sudo gem uninstall cocoapods 2. Remove old master repo: 1 sudo rm -fr ~/.cocoapods/repos/master 3. Install CocoaPods with sudo: 1 sudo gem install cocoapods 4. Setup CocoaPods and Master repo: 1…

আসবে সকাল

30
Jan,2018

0

কে জানে কোন হাসির ছলে ব্যাথার রেখা ধরে , কোন মোহনায় তপ্ত রোদে থাকবে মরে পরে ।   কেউ দেখেনি ওই জড়তায় কত স্বপন লুকানো এই ষ্টাগলের উল্টো পিঠে কত যে ভয় জড়ানো ।   কোন বাকা পথ – পথ…

Android Encryption and Decryption String with AES/DES .

17
Jan,2018

0

Base Class :  import android.util.Base64; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.GeneralSecurityException; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; /** * Created by ADN Digital on 1/17/2018. */ public class…

Android Studio get SHA 1 key in release mode .

29
Dec,2017

0

keytool -list -v -keystore F:\Android\Priokothanew\Priokotha\priokotha.jks -alias arifhasnat

Android Studio – Get SHA1 Key

26
Dec,2017

0

Android notify users when app version is updated on play store .

29
Nov,2017

0

1 . First get current play store version. int currentVersion,updateVersion; VersionChecker versionChecker = new VersionChecker(); try { String latestVersion = versionChecker.execute().get(); updateVersion = Integer.parseInt(latestVersion.substring(latestVersion.length()-1)); Toast.makeText(HomeActivity.this, latestVersion.toString(), Toast.LENGTH_SHORT).show(); } catch (InterruptedException e) { e.printStackTrace(); } catch (ExecutionException e) { e.printStackTrace(); }…

Swift 3 / 4 get current location with location manager .

3
Nov,2017

0

Step – 1 :  First define LocationManager . And Current location of CLLocaion .   var manager = CLLocationManager() var currentLocation: CLLocation! Step 2 : In ViewDidController get Current location with location manager . That’s it .   manager.requestWhenInUseAuthorization()   …

Swift 3 /4 take photo from camera or gallery and show it .

1
Nov,2017

0

Step One : First create a project and take imageView and a button to capture image . Connect it to ViewController . Step Two : Copy this code and run . hope it will be done . 😀    class ImageCapture: UIViewController…

Laravel 5.5 : include css , js and image for boostrap theme .

10
Oct,2017

0

Put your assets in the public folder public/css public/images public/fonts public/js And then called it using Laravel   {{ URL::asset(‘js/scrollTo.js’); }} // Generates the path to public directory public/js/scrollTo.js {{ URL::asset(‘css/css.css’); }} // Generates the path to public directory public/css/css.css…

Laravel – Please provide a valid cache path

4
Oct,2017

0

In laravel sometime cache not valid problem shows . What’s the reason ? Reason is there had no cache path in the storage directory . To solve this problem , try this : create these folders under storage/framework: sessions views cache…