Friday 6 October 2017

Privacy Policy

Sonia John K built the BSNL MissedCall Alert app as an Ad Supported app. This SERVICE is provided by Sonia John K at no cost and is intended for use as is.
This page is used to inform website visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at BSNL MissedCall Alert unless otherwise defined in this Privacy Policy.
Information Collection and Use
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to Contacts. The information that I request is retained on your device and is not collected by me in any way
The app does use third party services that may collect information used to identify you.
Link to privacy policy of third party service providers used by the app
Log Data
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
Cookies
Cookies are files with small amount of data that is commonly used an anonymous unique identifier. These are sent to your browser from the website that you visit and are stored on your device internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third party code and libraries that use “cookies” to collection information and to improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
Service Providers
I may employ third-party companies and individuals due to the following reasons:
  • To facilitate our Service;
  • To provide the Service on our behalf;
  • To perform Service-related services; or
  • To assist us in analyzing how our Service is used.
I want to inform users of this Service that these third parties have access to your Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
Security
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
Links to Other Sites
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
Children’s Privacy
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do necessary actions.
Changes to This Privacy Policy
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.
Contact Us
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me.
This privacy policy page was created at privacypolicytemplate.net and modified/generated by App Privacy Policy Generator

Friday 20 March 2015

Custom GridView

GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using an Adapter.

Here we are going to create an app with grid view.

  • Start a new project
  • Open activity_main and add gridview widget
 <GridView      
     android:id="@+id/gridview"   
     android:layout_width="fill_parent"   
     android:layout_height="fill_parent"   
     android:columnWidth="90dp"  
     android:gravity="center"   
     android:horizontalSpacing="10dp"   
     android:numColumns="auto_fit"   
     android:stretchMode="columnWidth"  
     android:verticalSpacing="10dp" />  
  • Since we are creating custom gridview, design a layout for single item in the grid.
  • Here in my app I am creating single item with an Icon and a label.
 <?xml version="1.0" encoding="utf-8"?>  
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
   android:layout_width="match_parent"  
   android:layout_height="match_parent"  
   android:gravity="center"  
   android:orientation="vertical" >  
   <ImageView  
     android:id="@+id/iv_icon"  
     android:layout_width="wrap_content"  
     android:layout_height="wrap_content"  
     android:src="@drawable/ic_launcher" />  
   <TextView  
     android:id="@+id/tv_label"  
     android:layout_width="wrap_content"  
     android:layout_height="wrap_content"  
     android:text="Large Text"  
     android:textAppearance="?android:attr/textAppearanceLarge" />  
 </LinearLayout>  
  • Open MainActivity.java and insert the following code for the onCreate() method:
 GridView gridview = (GridView) findViewById(R.id.gridview);  
   gridview.setAdapter(new GridAdapter(this));  
   gridview.setOnItemClickListener(new OnItemClickListener() {  
    public void onItemClick(AdapterView<?> parent, View v,  
      int position, long id) {  
     Toast.makeText(getApplicationContext(), "Position " + position,  
       Toast.LENGTH_SHORT).show();  
    }  
   });  
  •  create an GridAdapter that extends BaseAdapter
 package com.sjk.gridviewsample;  
 import android.content.Context;  
 import android.view.LayoutInflater;  
 import android.view.View;  
 import android.view.ViewGroup;  
 import android.widget.BaseAdapter;  
 import android.widget.ImageView;  
 import android.widget.TextView;  
 public class GridAdapter extends BaseAdapter {  
  static final String[ ] GRID_DATA = new String[] {  
   "One" ,  
   "Two",  
   "Three" ,  
   "Four",  
   "Five" ,  
   "Six",  
   "Seven",  
   "Eight",     
   "Nine" ,  
   "Ten"  
  };  
  Context context;  
  public GridAdapter(Context context) {  
   super();  
   this.context = context;  
  }  
  @Override  
  public int getCount() {  
   // TODO Auto-generated method stub  
   return GRID_DATA.length;  
  }  
  @Override  
  public Object getItem(int position) {  
   // TODO Auto-generated method stub  
   return null;  
  }  
  @Override  
  public long getItemId(int position) {  
   // TODO Auto-generated method stub  
   return 0;  
  }  
  @Override  
  public View getView(int position, View convertView, ViewGroup parent) {  
   // TODO Auto-generated method stub  
   View grid;  
   LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);  
   if(convertView==null){  
    grid=new View(context);  
    grid=inflater.inflate(R.layout.single_tile, null);  
    ImageView imageview=(ImageView)grid.findViewById(R.id.iv_icon);  
    TextView textview=(TextView)grid.findViewById(R.id.tv_label);  
    imageview.setBackgroundResource(R.drawable.ic_launcher);  
    textview.setText(GRID_DATA[position]);  
   }  
   else {  
    grid = (View) convertView;  
   }  
   return grid;  
  }  
 }  
  • Run the application.
  • Screenshot
You can download application from here

Wednesday 18 March 2015

Start a new Activity

Create a new android application

Class Files
MainActivity.java
public class MainActivity extends Activity {
    Button b_newPage;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        b_newPage=(Button)findViewById(R.id.button_newpage);

        b_newPage.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent myIntent = new Intent(MainActivity.this, NewPageActivity.class);
                myIntent.putExtra("key", "Key Value"); //Optional parameters
                startActivity(myIntent);
            }
        });
    } 
}
 NewPageActivity.java

public class NewPageActivity extends Activity {
    TextView tvkey;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_new_page);
        //Retrieve extended data from the intent.
        String key=getIntent().getStringExtra("key");
        tvkey=(TextView)findViewById(R.id.tv_key);
        //Append the specified text to the TextView's display buffer
        tvkey.append(key);
    }
}

Layouts 

activity_main.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Open New Page"
        android:id="@+id/button_newpage"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />

</RelativeLayout>


activity_new_page.xml




<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.relationwithandroid.intentssample.NewPageActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Congrats!!!!"
        android:textSize="30sp"
        android:layout_gravity="center"/>

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="You opened Second Activity"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textSize="25sp"
        android:layout_gravity="center"/>

    <TextView
        android:id="@+id/tv_key"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Key is " />

</LinearLayout>

Add new Activity to manifest file

<activity
            android:name="com.sjk.testapp.NewPageActivity"
            android:label="@string/app_name" >
        </activity>

GitHub link
 

Thursday 26 February 2015

Creating App with Android Studio

File→New Project




Fill the details in opened window



Application Name:
Name of your application and also the name of package folder.
Company Domain:
The company domain name is used to uniquely identify your app. Thus, even if two different companies create Android apps with the same name, you can still see which is which because their company domain names will be different.
Project Location:
The project location is a directory on your hard drive where you want to put all files related to this Android Studio project.
Then click next



Here we can select the target device in which we are going to run our application.
There is also provision to choose minimum sdk version.it means that our application will run from the selected api level.
Click next




Here we can choose the activity.
Click next



In the next window there is provisions to add Activity name,Layout name,Title and menu Resource name.
Then click finish.

Android Folder Structure


Any Android project contains things such as application source code and resource files. Some are generated for you by default, while others should be created if required. Lets have a look at android eclipse project directory structure:

src
User specified java source code files will be available here.
gen
The gen directory in an Android project contains auto generated files. You can see R.java inside this folder which is a generated class , contains references to certain resources of the project. R.java is automatically created by the Eclipse IDE and any manual changes are not necessary
res
Android supports resources like images and certain XML configuration files, these can be keep separate from the source code. All these resources should be placed inside the res folder. This res folder will be having sub-folders to keep the resources based on its type.

/res/values
Used to define strings , colors, dimensions, styles and static arrays of strings or integers. By convention each type is stored in a separate file, e.g. strings are defined in the res/values/strings.xml file.
·                     /res/values-v11 is the values of the API version 11,
·                      /res/values-v14 is the values of the API version 14
/res/animator

This folder contains animations in XML for the property animation API which allows to animate arbitrary properties of objects over time

/res/layout
This folder contains the layouts to be used in the application.A layout resource defines the architecture for the UI in an Activity or a component of a UI. These are resource directories in an application that provides different layout designs for different screen sizes
·                     /res/layout - layout for normal screen size or default
·                     /res/layout-small - layout for small screen size
·                     /res/layout-large - layout for large screen size
·                     /res/layout-xlarge -layout for extra-large screen size
·                     /res/layout-xlarge-land - layout for extra-large in landscape orientation
·                     /res/layout-sw600dp - layout for tablets or layout for 7” tablets (600dp wide and bigger)
·                     /res/layout-sw720dp - layout for 10” tablets (720dp wide and bigger)
·                     /res/layout-w600dp - layout for Multi-pane (any screen with 600dp available width or more)
/res/menu
This folder contains menu resources to be used in the application (Options Menu, Context Menu, or submenu)

/res/raw
This folder contains raw resources that can be looked up by their resource IDs. These resources can be referenced from other resources all of the same way we do with other resources.

/res/drawable
Drawable folders are resource directories in an application that provides different l bitmap drawables for medium, high, and extra high density screens.
·                     /res/drawable-mdpi - bitmap for medium density
·                     /res/drawable-hdpi - bitmap for high density
·                     /res/drawable-xhdpi - bitmap for extra high density
·                     /res/drawable-nodpi - bitmap with no pre-scaling
libs
External library files will be placed in this folder. If you want to any external library in your project place the library jar inside this folder and it will be added to the classpath automatically.

assets
This folder contains raw hierarchy of files and directories, with no other capabilities. It is just an unstructured hierarchy of files, allowing you to put anything you want there and later retrieve as raw
byte streams.

bin
Bin folder is the area used by the compiler to prepare the files to be finally packaged to the application’s APK file. This includes
·                     Compiling your Java code into class files
·                     Putting your resources (including images) into a structure to be zipped into the APK
This is the output directory of the build. This is where you can find the final .apk file and other compiled resources.

AndroidManifest.xml
All the android applications will have an AndroidManifest.xml file in the root directory. This file will contain essential information about the application to the Android system, information the system must have before it can run any of the application's code. This control file describes the nature of the application and each of its components

ic_launcher-web.png
This is an icon to be used in Google play. Applications on Google Play require a high fidelity version of the application icon. It is not used in your actual app or the launcher, so it is not packaged in the APK.. The specifications for the high-resolution icon are:
32-bit PNG with an alpha channel
512 x 512 pixels
Maximum size of 1024KB

proguard-project.txt
Everything in the proguard-project.txt file will be in commented out state, because in general most people don't have any project specific needs, just to run ProGuard tool with standard settings.
The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer.

project.properties
project.properties is the main project’s properties file containing information such as the build platform target and the library dependencies has been renamed from default.properties in older SDK versions. This file is integral to the project.
 
That is all about Android eclipse project directory structure...