Friday, 25 April 2014

Android Code to set "Multiple Alarms"

Android Code to set "Multiple Alarms"

Screen Shots:


















Coding:

MainActivity.java

package com.example.multipleremainder;

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import android.net.Uri;
import android.os.Bundle;
import android.provider.CalendarContract;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {

Button alarm;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

alarm=(Button)findViewById(R.id.button1);

alarm.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Calendar cal = new GregorianCalendar();
cal.setTime(new Date());
cal.add(Calendar.MONTH, 0);
long time = cal.getTime().getTime();
Uri.Builder builder = CalendarContract.CONTENT_URI.buildUpon();
builder.appendPath("time");
builder.appendPath(Long.toString(time));
Intent intent = new Intent(Intent.ACTION_VIEW, builder.build());
startActivity(intent);
}
});



}
}


Layout:

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: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=".MainActivity" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="174dp"
        android:text="Set Alarm" />

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/button1"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="64dp"
        android:text="Set Multiple Alarms"
        android:textAppearance="?android:attr/textAppearanceMedium" />

</RelativeLayout>


AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.multipleremainder"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.multipleremainder.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Monday, 3 March 2014

Content Filter Application



       The content filtering software blocks unwanted websites from the end user. The filter is done based on phrase matching, URL filtering, black/white lists, bad words and based on categories such as news, sports, social, chats.


Features



1) Global Settings
        The global settings apply to all users, regardless of the content filter group being applied to the user browsing websites from the Local Area Network (LAN). In fact, the settings explicitly exempt or ban a device on the LAN from using the proxy/content filter service. A device is identified by its source IP address.
If you are using banned IP addresses, it is good practice to ensure these systems are assigned static IP addresses. 

       a) Exception IPs
                If the end user connected over the LAN network and you don’t want to ban his internet then
                add his ip address in Exception IPs list. So that he can access internet at any time.

        b)Banned IPs
                If you want to block the internet to a particular end users system then add his ip address to
                banned ip table. If end user’s system IP address is static then little bit easy to block.





2) Group policies

        When you first configure the content filter application, one group policy is already created - named “Default”. By default, this group policy applies to all users. If you want to create additional policies then content filter application supports up to 9 different group policies - each of which can be configured to the administrator’s preference.
        For Example- a school might have policies named for the types of individuals that might be accessing the Internet from the school - Support Staff, Teachers, Students, Parents, and Visitors etc.
  
3) Editing a group Policy


         Once you have added a group policy (or if you need to edit the default policy) it is time to edit/configure it. Click on the “Configure Policy” link next to the group policy you wish to edit. You will see a summary of parameters/categories to edit.
 For more details Watch the video:




General settings
1) Reporting Level             Several options are available to customize what a user sees when the filter blocks a page: 



  • Stealth Mode - Site is not blocked…User's IP and site is logged
  • Short Report - A short error message 'bubble' will be displayed like the one below
  • Access Denied - User's browser will receive an 'Access Denied' in place of the web page.  
  • Full Report - Same as above, but the weighted limit and actual value will be displaye.
  • Custom Report - Uses the customizable HTML template.

 2) Blacklists



            This option is enables if you have subscribed to that service. It is not comes in free package.


3) Phrase Lists



            The content filter system uses phrase lists to calculate a score for every web page. You can fine
            tune your content filter scoring by specifying which phrase lists to use.
  
4) MIME Types


           MIME types instruct a browser to utilize certain applications in order to display content encoding.
           Security exploits in the applications themselves can be used to infiltrate a computer. MIME types
           checked in the “Banned MIME Types” form will not be allowed to pass through the firewall and to
           the computer making the request on the LAN, providing a more secure environment.
  
5) File Extension
          Banning specific file extensions is a useful tool for limiting content available to users on the LAN. It can
          also greatly decrease the chances of users unwittingly downloading and running 'arbitrary' code
          downloaded from the Internet which could potentially contain viruses, spy ware of other malicious
          code.
  
6) Banned Sites
          Sites entered in the “Banned Site List” will be banned, regardless of the site's content, or whether
          the site is on one of the blacklists.
  


7) Gray Sites


         Sites entered in the “Grey Site List” will not be blocked by the blacklists but will still be checked for
         content. For example, you may have the news blacklist enabled to prevent people from wasting time
         during the business day. However, you may have also decided to allow just BBC news. If you add
         bbc.co.uk to the gray sites list, only this page will be allowed. 


8) Exception Sites


        Sites entered in the “Exception Site List” will be allowed.


For More details have a look on http://www.clearcenter.com/support/documentation/user_guide/content_filter




Share It

Followers