Get Events List – ADNROID APP

Getting event list form calender using getContentResolver().query(…). App src is here 🙂 .

Screenshot_2013-05-21-18-02-07

Advertisements

MY ADNROID APP

Today I tried a simple app in android, to control ringing mode.
here it is
src file : mainactivity.java
package com.example.helloworld;
import java.util.Date;

import android.media.AudioManager;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.text.format.DateFormat;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final TextView tv = (TextView)findViewById(R.id.tv1);
final EditText et= (EditText)findViewById(R.id.et1);
final Button button1 = (Button)findViewById(R.id.btn1);

button1.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
tv.setText("You typed : "+et.getText());
et.setText("");

}
});

}

public void getdate(View view) {
TextView tv = (TextView)findViewById(R.id.tv1);
Date d = new Date();
CharSequence s = DateFormat.format("EEEE, MMMM d, yyyy ", d.getTime());
tv.setText("Date : "+s);
}
public void putsilent(View view) {
Button bt = (Button)findViewById(R.id.btn3);
AudioManager audio = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
if(bt.getText()=="SET RING MODE VIBRATE")
{
bt.setText("SET RING MODE SILENT");
audio.setRingerMode(audio.RINGER_MODE_VIBRATE);
//audio.setRingerMode(1);
}
else if(bt.getText()=="SET RING MODE SILENT")
{
bt.setText("SET RING MODE NORMAL");
audio.setRingerMode(audio.RINGER_MODE_SILENT);
//audio.setRingerMode(0);
}
else
{
bt.setText("SET RING MODE VIBRATE");
audio.setRingerMode(audio.RINGER_MODE_NORMAL);
//audio.setRingerMode(2);
}
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}

}

layout file : activity_main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".MainActivity" >
<EditText android:id="@+id/et1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:hint="Type here"/>
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/tv1"/>
<Button android:text="GET TEXT ABOVE"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn1"></Button>
<Button android:text="GET DATE"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn2"
android:onClick="getdate"></Button>
<Button android:text="SET RING MODE SILENT"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btn3"
android:onClick="putsilent"></Button>
</LinearLayout>

Missing some admin menus after PHPBB3 migration

We came across a problem while migrating phpbb3 to another server.Some admin tab(like styles) are missing, even when we try to access by direct URL, its saying unable to module.
The we get this forum and followed the following steps.

Down load stk from here.
Copy the stk folder to you phpbb root folder.
Update your admin user in phpbb_users table, change user_type = 3.
Access stk by http://domain.com/forum/stk and do Purge the cache.

Now check you admin panel , it should be fixed. 🙂