Archive for the ‘How-to’ Category

How to solve java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/util/ByteArrayBuffer

To solve the this problem just put the following code below tag on the manifiest tag. For eg: <application android:icon="@drawable/icon" ...... android:theme="@style/AppTheme.NoActionBar"> <uses-library android:name="org.apache.http.legacy" android:required="false"/> This problem is caused by targeting target Android 9 and above versions ... Full story

How to solve “NotAllowedError: play() can only be initiated by a user gesture.” audio problem in javascript android webview?

While playing audio in javascript using webview in android platform we may encounter following problem NotAllowedError: play() can only be initiated by a user gesture.. This is due to security and good user experience issue. So to enable sound play we should use following code in android: Android SDK below 17 will not support this hack so we should use the condition. Please comment if ... Full story

Android Device not detecting on computer device or android studio? Solved

I had come across weird problem i.e my android device is not being detected on any of the computer device either Mac or windows. I went through several websites but none of them worked. Being depressed one day an idea busted. I thought to clean the port. Yes i cleaned every dirt on the phones charging port and it worked like a charm. Now the android phone ... Full story

How to convert Mysql Database to SQLite database?

I have found a simple way to convert the Mysql Database into SQLite database. Following are the steps: Open PhpMyadmin on your browser. (eg. http://localhost:8888/phpmyadmin) Select database and click on Export. Make sure SQL is selected as format and click go. Make a copy of the mysqlcode and store in a file db.txt. Download DB Browser for SQLite from . Create new Database and create table. Navigate to Execute SQL ... Full story

How to make Facebook comment box responsive?

Responsive sites are very important now a days. Because it ranks well in the search engines. Sometimes third party widgets like facebook like box and comment box can perform worst. In such case you need to write your own css to make facebook comment box responsive. Here is the css code to make facebook comment box responsive: CSS to make Facebook comment box responsive Please do ... Full story

How to perform case insensitive array search in php?

Searching is a usual and regular task in programming. Letters case sensitivity is a problematic in searching. Hence, both search string and array string should be converted into same case before searching. Otherwise searching would return the empty result. Here is how to do it: As shown above, search string is converted into lowercase and all the items of an array are converted to ... Full story

How to optimize if else statement in a smart way?

In this tutorial i am going to show how can we optimize the if else statement. This method can be used in any programming languages. I am going to show two different ways we can optimize the if else statement. lets see default if else statement: if( n % 2 == 0){ result = n + " is even number"; }else{ result ... Full story

How to transfer existing domain with another hosting in cpanel for godaddy hosting?

Suppose you have old Hosting H1 and domain D1. You have purchased new hosting H2 with cpanel. Now you want domain D1 to new hosting as a multiple hosted domain in H2. To do this follow following steps: Copy all files and databases related to domain D1 from Hosting H1 o new Hosting H2. Go to Domain Manager and select domain D1. Now click on DNS Zone File ... Full story

How to completely remove filezilla from macOS ?

Sometimes Filezilla creates problem connecting to server with FTP. The easiest solution is to check the connection from another computer. If it worked on another computer then there is something wrong in your computer's filezilla, in this case Filezilla should be uninstalled completely and reinstalled again. Is that all? Nope. You should delete the config files located in your .config folder. Here is what you ... Full story

javascript new date not working in iphone and android devices with NAN and Undefined error

Today i found a new problem, the date object working perfectly in desktop web browsers but not working in android browsers and iphone browsers. The problem is they issue NAN and Undefined errors. So what is the universal solution? There is a simple solution to the problem. You should declare date as following format: If you are processing date from php then the ... Full story
Copyright © 2020 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes