Category Archives : Tutorials

Home  >>  Tutorials

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…

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; } }

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…

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;…

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…

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      

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…

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…

Script php artisan clear-compiled handling the pre-update-cmd event returned with error code 255

4
Oct,2017

0

In laravel there may be shown the following error when working with bellow laravel 5.3 projects . Cause composer structure has been changed .   So how to solve it : Its easy way to just replace the code in…

How to install and fix all errors after clone laravel project from github ?

4
Oct,2017

1

Installation Follow the instructions below to install the project Clone the repository using git clone composer install npm install Create .env by copying the env.example file php artisan key:generate php artisan migrate Set administrator info in UserTableSeeder.php // Optional php…

Print page and specific section with JavaScript

2
Oct,2017

0

Whole Page :   If we want to print complete to print . we can do it with JavaScript Print() mehtod.   <!DOCTYPE html> <html> <body> <p>Click the button to print the current page.</p> <button onclick=”myFunction()”>Print this page</button> <script> function myFunction()…

Laravel : Specified key was too long error

18
Sep,2017

0

Laravel 5.4 or later  made a change to the default database character set, and it’s now utf8mb4 which includes support for storing emojis. This only affects new applications and as long as you are running MySQL v5.7.7 and higher you do not…

Recyclerview OnTouchListener Easy way

17
Jan,2017

0

blogCategoryRecycler.addOnItemTouchListener(new RecyclerTouchListener(this, blogCategoryRecycler, new RecyclerTouchListener.ClickListener() { @Override public void onClick(View view, int position) { } @Override public void onLongClick(View view, int position) { } }));

IOS 10 : TableView tutorial with Swift 3 – most easy way

30
Dec,2016

0

import UIKit class ViewController: UIViewController , UITableViewDelegate , UITableViewDataSource{ var names = [“arif”,”hasnat”,”ios”,”developer”] @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {…

Android Multi-dex Enable

3
Dec,2016

0

aSometimes it needed to enable multidex in out add and its can throw error also . But memory limit 64 k problem may be a painful problem to solve for who faces this problem newly . But we can easily…

iOS 10 tutorial : Working with collection view

24
Nov,2016

0

Collection view is very good component of IOS . Its similar with table but have some basic difference . Here I will discuss with ios Collection view with easy way 🙂 So let start , Part 1 : Create a…

Working With ionic and cordova : Part-1 Installation

21
Nov,2016

0

Ionic is a good platform for hybrid mobile apps development , both for android and ios . There has some good stuffs and good functionality . We can make app only with HTML , CSS , And java Script framework…

Insertion Sort Algorithm

11
Oct,2016

0

Insertion Sort: Insertion sort is a simple sorting algorithm that is relatively efficient for small lists and mostly sorted lists, and is often used as part of more sophisticated algorithms. It works by taking elements from the list one by…