Browsed by
Category: Tutorials

Android google map : get current location (latitude,longitude)

Android google map : get current location (latitude,longitude)

Step 1 : Create Project with Google Map Activity  Create a project with google map activity . and paste your api key . If your are not familiar with google map then follow the doc        https://developers.google.com/maps/documentation/android-sdk/start DOWNLOAD CODE FROM GITHUB Step 2 : Add dependency in Gradle File  Add the following dependency in gradle(app) file   Step 3:  Change the map Activity class to the code bellow

Android room database : CRUD example tutorial

Android room database : CRUD example tutorial

Introduction:  Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite. Apps that handle non-trivial amounts of structured data can benefit greatly from persisting that data locally. The most common use case is to cache relevant pieces of data. That way, when the device cannot access the network, the user can still browse that content while they are offline. Any user-initiated content changes are then synced to the server after the…

Read More Read More

Node JS tutorial – Introduction and Environment setup.

Node JS tutorial – Introduction and Environment setup.

Introduction: Node.js is a very powerful JavaScript-based framework/platform. It’s all about backend development and rest API.For more details https://nodejs.org/en/. Installations:  Download NoteJS from https://nodejs.org/en/download/ . After downloading just install it.Open Command line tool and type node to test if it’s install correctly or not. Text Editor :  To work with node project you can download and install sublime text editor or atom text editor . That’s are good enough.        

Your app(s) are using a content provider that contains a SQL Injection vulnerability.

Your app(s) are using a content provider that contains a SQL Injection vulnerability.

Fixing a SQL Injection Vulnerability This information is intended for developers with app(s) that contain the SQL Injection Vulnerability. What’s happening One or more of your apps contain a SQL Injection vulnerability that must be fixed. Please refer to the notice on your Play Console for the deadline to fix this vulnerability. After this deadline, updates to affected apps will be blocked if the vulnerability is still present. Your published APK version will remain unaffected. Action required Implementations of query, update, and delete in exported ContentProviders can be…

Read More Read More

Android google admob implementation – Banner

Android google admob implementation – Banner

Before Follow this tutorial please first complete the project configuration about how to integrate admob in android .  GOOGLE ADMOB IMPLEMENTATION ON ANDROID PROJECT   Step 1- Set banner ads on layout : Set banner elements on layout file As like – Note the following required attributes: ads:adSize – Set this to the ad size you’d like to use. If you don’t want to use the standard size defined by the constant, you can set a custom size instead. See the banner…

Read More Read More

The ARCore dependency minimum version code com.google.ar.core.min_apk_version is missing from the AndroidManifest.xml file although the meta-data tag com.google.ar.core has been specified.

The ARCore dependency minimum version code com.google.ar.core.min_apk_version is missing from the AndroidManifest.xml file although the meta-data tag com.google.ar.core has been specified.

Problem : The ARCore dependency minimum version code com.google.ar.core.min_apk_version is missing from the AndroidManifest.xml file although the meta-data tag com.google.ar.core has been specified.   Solution : This is Unity ARCode dependency problem. just add this line in menifest   <meta-data android:name=”com.google.ar.core.min_apk_version” android:value=”24″ />

Android best libraries for android developers

Android best libraries for android developers

Fancy Toast: Coloring toast message. It’s looking good and user friendly. Fancy Toast is awesome library for developers.   Speed Dial Fab :  Android library providing an implementation of the Material Design Floating Action Button Speed Dial. Features  MinSdk 14  Highly customizable (label, icon, ripple, fab and label background colors, themes support)  Same animations as in Inbox by Gmail  Option to have different icons for open/close state  Optional overlay/touch guard layout  Support for bottom, left and right menu expansion (left and right…

Read More Read More

Google Admob implementation : Interstitial

Google Admob implementation : Interstitial

Before Follow this tutorial please first complete the project configuration about how to integrate admob in android .  GOOGLE ADMOB IMPLEMENTATION ON ANDROID PROJECT   Step 1 :Create an interstitial ad object Interstitial ads are requested and shown by InterstitialAd objects. The first step is instantiating InterstitialAd and setting its ad unit ID. This is done in the onCreate() method of an Activity: Step 2 : Always test with test ads When building and testing your apps, make sure you…

Read More Read More

Execution failed for task

Execution failed for task

‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’. > com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex Error:Execution failed for task Solution : Step 1 : Clean Step 2 : Rebuild if the you are facing the following problem update google service class path.

Error:Execution failed for task

Error:Execution failed for task

Error:Execution failed for task ‘:app:transformDexArchiveWithDexMergerForDebug’. > com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/measurement/zzws;   update the google-service plugin to: classpath ‘com.google.gms:google-services:3.3.0’

Error:Execution failed for task ‘:app:processDebugGoogleServices’. > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.

Error:Execution failed for task ‘:app:processDebugGoogleServices’. > Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.

Solution : Check all google version is same. If google play service is different then others then there may create conflict. Firebase and others google services should be in same version. Example :

Google Admob implementation on android project

Google Admob implementation on android project

All are described here here https://developers.google.com/admob/android/quick-start. I am only arrange step by step procedure- Step 1 : Example project-level build.gradle (excerpt) add this on build.gradle(global) in repositories brackets as like – Step 2 : Step 3 : Update your AndroidManifest.xml Add your AdMob App ID to your app’s AndroidManifest.xml file by adding the tag shown below. You can find your App ID in the AdMob UI. Step 4 : Before loading ads, have your app initialize the Mobile Ads SDK…

Read More Read More

Unity google admob implementation

Unity google admob implementation

Part 1 : Go to the git repository and download/clone it https://github.com/googleads/googleads-mobile-unity Part 2:  Download unity google admob latest plugin https://github.com/googleads/googleads-mobile-unity/releases Part 3 Create a Unity Project and import the plugin Part 4: Go to following directory of the repository you download of step 1 : google admob plugins\googleads-mobile-unity-master\googleads-mobile-unity-master\samples\HelloWorld\Assets\Scripts Part 5 : Copy the script to the assset folder Part 6 : Attach the script to MainCamera. Part 7: It should show default ads when you will build it for…

Read More Read More

Android app debug over wifi in real devices

Android app debug over wifi in real devices

Step 1 : Open android studio . Now go to File->Settings->Plugins->Browse Plugins->Android WiFi ADB . Step 2 : Install it and restart . Step 3 : Connect Android Phone/device with cable . Step 4 : Right side ADB Wifi ADB Will be visible . Connect device . Done Now disconnect cable and run project . It will work fine. N.B: It’s essential to connect with same network /WiFi both at PC and Android Phone.    

This Activity already has an action bar supplied by the window decor

This Activity already has an action bar supplied by the window decor

Add this two line in your style.xml file : <item name=”windowActionBar”>false</item> to your theme declaration inside of your app/src/main/res/values/styles.xml. Also, if you’re using AppCompatActivity support library of version 22.1 or greater, add this line: <item name=”windowNoTitle”>true</item> Your theme declaration may look like this after all these additions: <!– Base application theme. –> <style name=”AppTheme” parent=”Theme.AppCompat.Light.DarkActionBar”> <!– Customize your theme here. –> <item name=”colorPrimary”>@color/colorPrimary</item> <item name=”colorPrimaryDark”>@color/colorPrimaryDark</item> <item name=”colorAccent”>@color/colorAccent</item> <item name=”windowActionBar”>false</item> <item name=”windowNoTitle”>true</item> </style>

React Native installation on Mac

React Native installation on Mac

Step one : First Visit this one http://arifhasnat.com/2018/08/10/react-native-1-installation-and-project-create/ Step two : Then open terminal and run this command to get react native command line Step three: Create new project

React native – 1 : Installation and Project Create

React native – 1 : Installation and Project Create

Step 1 : Download node and install https://nodejs.org/en/download/ . Step 2 :  Open Command line for Windows as Administration mode and Terminal for mac/ linux. Sote ::  For mac and linux please add if the commands in bellow are not works. Step 3 : Install npm Step 4 : Initialize react native Step 5 :  Go to your any project directory and create new project named FirstProject. Step 6 :  Go to your newly created project directory. Step 7 :  Run Project. Step 8…

Read More Read More

How to split apk in android studio

How to split apk in android studio

Go to build.gradle(app) and paste the highlighted code . that’s all. apply plugin: ‘com.android.application’ android { compileSdkVersion 27 defaultConfig { applicationId “your Application ID” minSdkVersion 21 targetSdkVersion 27 versionCode 1 versionName “1.0” testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner” } splits { abi { enable true reset() include “x86_64″,”x86″,”armeabi”,”armeabi-v7a”,”arm64-v8a”,”mips” universalApk false } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ } } lintOptions { checkReleaseBuilds false } } ext.densityCodes = [‘armeabi’:1, ‘armeabi-v7a’:2, ‘arm64-v8a’:3,’mips’:4,’x86′:5,’x86_64′:6] import com.android.build.OutputFile android.applicationVariants.all { variant -> variant.outputs.each { output ->…

Read More Read More

Error:java.lang.OutOfMemoryError: Java heap space .

Error:java.lang.OutOfMemoryError: Java heap space .

Problem: Error:java.lang.OutOfMemoryError: Java heap space . Please assign more memory to Gradle in the project’s gradle.properties file. For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB: org.gradle.jvmargs=-Xmx1024m Read Gradle’s configuration guide Read about Java’s heap size   Solution:   Open gradle.properties file from your project tree add this line at the memory allocation line or or or or or Depending on the Memory of your computer. Then Invalidate Caches/Restart project from…

Read More Read More

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

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

Whether you’re looking for a game industry career or simply curious about the way game developers think, Extra Credits makes video game design approachable by exploring concepts like gamification, perfect imbalance, the skinner box, the uncanny valley, and more, since these games are really popular with kids now a days, since is one of the activities kids enjoy among others like jumper castles in children’s bday parties from http://www.jumpersjungle.com/riverside/ and more. Sometimes we also like to recommend a few games…

Read More Read More

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

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

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”, “”); String htmlConvertedText = html2text(descriptionFinalText); productDesc.setText(Html.fromHtml(String.valueOf(Html.fromHtml(htmlConvertedText)))); Done 🙂

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.

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.

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 false proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ } } } dependencies { implementation fileTree(dir: ‘libs’, include: [‘*.jar’]) implementation ‘com.android.support:appcompat-v7:26.1.0’ implementation ‘com.android.support.constraint:constraint-layout:1.1.0’ implementation ‘com.android.support:design:26.1.0’ testImplementation ‘junit:junit:4.12’ androidTestImplementation ‘com.android.support.test:runner:1.0.2’ androidTestImplementation ‘com.android.support.test.espresso:espresso-core:3.0.2’ compile ‘com.android.support:support-annotations:27.1.1’ compile ‘com.github.barteksc:android-pdf-viewer:2.8.2’ }

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

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

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:src=”@drawable/logo”–> <!–android:layout_width=”@dimen/count_60dp”–> <!–android:layout_height=”wrap_content” />–> </android.support.v7.widget.Toolbar> </LinearLayout> </android.support.design.widget.CollapsingToolbarLayout> <EditText android:id=”@+id/search_bar” android:background=”@drawable/corner_radious” android:layout_width=”match_parent” android:editable=”false” android:layout_height=”@dimen/count_40dp” android:paddingLeft=”@dimen/count_10dp” android:drawableLeft=”@drawable/search_gray_24″ android:hint=”Search for Products, Brands and More ” android:textSize=”@dimen/count_12dp” android:drawablePadding=”@dimen/count_10dp” android:textColorHint=”@color/dark_gray” android:textColor=”@color/dark_gray” android:layout_marginLeft=”@dimen/count_10dp” android:layout_marginRight=”@dimen/count_10dp” android:layout_marginBottom=”@dimen/count_5dp” /> </android.support.design.widget.AppBarLayout> <include layout=”@layout/content_home2″ /> </android.support.design.widget.CoordinatorLayout> 2. In content layout add…

Read More Read More

Android show collapsing toolbar layout title only when collapsed

Android show collapsing toolbar layout title only when collapsed

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 (scrollRange + verticalOffset == 0) { collapsingToolbarLayout.setTitle(“Title”); isShow = true; } else if(isShow) { collapsingToolbarLayout.setTitle(” “); //carefull there should a space between double quote otherwise it wont work isShow = false; } } }); Source : stackoverflow

itunesconnect supported screenshoot sizes

itunesconnect supported screenshoot sizes

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 screenshot in this resolution, the phone scales them down to 1080 x 1920 iPhone X 1125 x 2436 iPad (Air and Mini Retina) 1536 x 2048 iPad Pro (12.9 Inch) 2048 x 2732 Apple Watch 312 x 390 pixels (only…

Read More Read More

Android navigation/ toolbar back

Android navigation/ toolbar back

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 @Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent = new Intent(fromActivity.this, toActivity.class); startActivity(intent); return super.onOptionsItemSelected(item); } @Override public void onBackPressed() { super.onBackPressed(); Intent intent = new Intent(fromActivity.this, toActivity.class); startActivity(intent); }

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.”

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.”

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 and Paste the App Store icon to the desktop. Open the image. Click File Menu->Duplicate. Save it by unticking the Alpha channel. Replace the current App Store icon with this one. Validate and upload. Source : https://stackoverflow.com/questions/46585809/error-itms-90717-invalid-app-store-icon