Author Archives : arifhasnat

Home  >>  Author : arifhasnat

How to replace string of whole project in android studio

12
Jul,2018

0

Unity 3d – Script Collection

11
Jul,2018

0

Player Follow the Camera Script Player Move/Transform (Left)

Unity 3d game development tutorial : part 1 – Introduction and Installation.

11
Jul,2018

0

Unable to list target platforms. Please make sure the android sdk path is correct.

8
Jul,2018

0

Delete android sdk “tools” folder : [Your Android SDK root]/tools -> tools Download SDK Tools: http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip Extract that to Android SDK root Build your project

APK was defined multiple times” , app fails to install with Android Studio

25
Jun,2018

0

Try to clean & then Rebuild the project again. To do so please go to Build menu, both the tools are present their. If issue not solved with that than try to invalidate caches & restart Android Studio from File…

IOS swift 3/4 google map clustering show actual number of marker in cluster

3
Jun,2018

0

We can manage it by changing one method of GMUDefaultClusterIconGenerator class. In GMUDefaultClusterIconGenerator.m replace below method, with What i have done is, I have just change else portion and set text as exact number instead of string with +!

FATAL EXCEPTION: main Process: com.sohozmarket, PID: 1046 java.lang.RuntimeException: Canvas: trying to draw too large(132710400bytes) bitmap.

30
May,2018

0

Move your image in the (hi-res) drawable to drawable-xxhdpi.

Error:Cause: services.gradle.org Consult IDE log for more details (Help | Show Log)

29
May,2018

0

Problem : Gradle failed to build . Solution : You need to do build your gradle file . For that first check your internet connection is available . Then re sync gradle  file . Done 🙂

Android how to remove new line and spaces and all html tags from String

29
May,2018

0

Step 1:  compile ‘org.jsoup:jsoup:1.11.3’ add jsonup gradle and sync. Step 2 : create a method public static String html2text(String html) { return Jsoup.parse(html).text(); } Step 3 : implement this String descriptionRawText = “raw text”; String descriptionFinalText = descriptionRawText.replace(“\n”, “”).replaceAll(“\\<[^>]*>”,””).replace(“\r”, “”);…

Android Google map clustering – how to show actual marker in cluster

27
May,2018

0

1 . Create Custom Cluster renderer package com.findbitcoinatm.android.utils; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; import android.util.SparseArray; import android.view.ViewGroup; import com.findbitcoinatm.android.models.cluster.ATMClusterItems; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.model.BitmapDescriptor; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.MarkerOptions; import com.google.maps.android.clustering.Cluster; import com.google.maps.android.clustering.ClusterManager; import com.google.maps.android.clustering.view.DefaultClusterRenderer;…

Error:Execution failed for task ‘:app:preDebugAndroidTestBuild’. > Conflict with dependency ‘com.android.support:support-annotations’ in project ‘:app’. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

19
May,2018

0

Solution : compile ‘com.android.support:support-annotations:27.1.1’ to gradle(app) and sync . Solved 🙂 Example : apply plugin: ‘com.android.application’ android { compileSdkVersion 26 defaultConfig { applicationId “com.arifhasnat.islamicbooks” minSdkVersion 16 targetSdkVersion 26 versionCode 1 versionName “1.0” testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner” } buildTypes { release { minifyEnabled…

IOS ScrollView Tutorial – Easy way

17
May,2018

0

 Download Full Project 

Android how to add collapsing toolbar with layout body touch collapse and expand

15
May,2018

0

1 . <?xml version=”1.0″ encoding=”utf-8″?> <android.support.design.widget.CoordinatorLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”com.adn.activities.root.HomeActivity”> <android.support.design.widget.AppBarLayout android:id=”@+id/appbar_layout” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:theme=”@style/AppTheme.AppBarOverlay” > <android.support.design.widget.CollapsingToolbarLayout android:id=”@+id/collapsing_toolbar” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_scrollFlags=”scroll|exitUntilCollapsed” app:contentScrim=”?attr/colorPrimary” app:expandedTitleMarginStart=”48dp” app:expandedTitleMarginEnd=”64dp” android:fitsSystemWindows=”true” > <LinearLayout android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”wrap_content”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?actionBarSize” android:background=”?attr/colorPrimary” app:popupTheme=”@style/AppTheme.PopupOverlay” > <!–<ImageView–>…

Android show collapsing toolbar layout title only when collapsed

10
May,2018

0

final CollapsingToolbarLayout collapsingToolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.collapsingToolbarLayout); AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appBarLayout); appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() { boolean isShow = true; int scrollRange = -1; @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { if (scrollRange == -1) { scrollRange = appBarLayout.getTotalScrollRange(); } if…

itunesconnect supported screenshoot sizes

8
May,2018

0

The following resolutions are acceptable to iTunes connect: iPhone 3+4 (3.5 Inch) 640 x 960 iPhone 5 (4 Inch) 640 x 1136 iPhone 6 (4.7 Inch) 750 x 1334 iPhone 6 Plus (5.5 Inch) 1242 x 2208 You need the…

Android navigation/ toolbar back

7
May,2018

0

Step one : put these in oncreate method getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true);     @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_details); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayShowHomeEnabled(true); } Step two : Give action to go specific page or actions…

ERROR ITMS-90717: “Invalid App Store Icon. The App Store Icon in the asset catalog in ‘CoinAtmFinder.app’ can’t be transparent nor contain an alpha channel.”

6
May,2018

0

It may be causes for 2 reasons – If image is transparent or if alpha channel  .   Solution for transparent :  Simply remove transparent or convert .png image to .jpg/.jpeg format . Solution for alpha channel :   Copy…

Convert String to NSURL is return nil in swift 3/4 – Solution

4
May,2018

0

let url : NSString = “url string here” let urlStr : NSString = url.addingPercentEscapes(using: String.Encoding.utf8.rawValue)! as NSString let actualURL : NSURL = NSURL(string: urlStr as String)! print(actualURL)

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   Enable Multidesk

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