Posts

Showing posts from April, 2016

Android Development : Aksing user to turn on the GPS

Image
  Dialog box :  Turn on the GPS      Recently, in one of my android project work, I needed GPS location of the user device. I wanted it to look like the dialog box which appears in the Google Maps when we turn in on. This is how Google asks user permission for GPS access: So, after referring the Google's official documentation and some more modifications following code worked like a charm. I had integrated the map and the code somewhat goes like this: First you have to add manifest permissions: <uses-permission android:name = "android.permission.READ_PHONE_STATE" /> <uses-permission android:name = "android.permission.INTERNET" /> <uses-permission android:name = "android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name = "android.permission.ACCESS_COARSE_LOCATION" /> Then edit your MainActivity like this : public class MainActivity extends AppCompatActivity implements

Excel to MySQL bridge

     Excel - MySQL Bridge Hello! This post contains simple python code written by me to transfer all Excel file table data to MySQL database running on your local machine and vice-versa. How to do this? There are two scenarios  1. Transferring the Excel table to MySQL database  2. Transferring the MySQL table to the excel sheet. 1. Excel to MySQL: Prerequisites to do this are you need to have a CSV file of the data. (Comma Separated Values) Also, first row should contain the column names and data from the second row onward. Turn on the XAMPP or WAMPP server so that code can access your local server. Create a database by any name. In the code it's phpgang . Run the Python code. (You need to have Python installed in your computer, you can download it from official Python site) This will transfer all the data from you CSV file to the MySQL database.  Note:   This script considers String as a default data type of the fields.