SMS!Alert Android

Minha mais nova aplicação Android!
SMS!Alert permite você criar alertas personalizados baseado em mensagens SMS, informe o número e/ou uma palavra-chave para filtro, quando alguém enviar um SMS com a palavra ou se o número especifico mandar uma mensagem SMS, o telefone exibirá um alerta visual e sonoro.

SMS!Alert também permite usar seu Android como um pager de emergência, perfeito para profissionais de TI, médicos, professores ou qualquer pessoa que precise de um pager, funciona perfeitamente para garantir que você não perca mensagens importantes, como um SMS urgente de seu chefe ou de sua mulher grávida.

Mais informações: https://jansouza.com/smsalert

 

 

 

 

 

Instale pelo Google Play!
Android app on Google Play

http://play.google.com/store/apps/details?id=com.smsalert

Instale pelo QR Code

Advertisements

SMS!Alert

My new Android Application …


SMS!Alert allow you to create custom alerts based on SMS messages, enter a incoming phone number and/or keyword filter, when someone sends a SMS with the keyword filter text or if incoming phone number matches, phone will display sound alert.

SMS!Alert also lets your phone act like an emergency pager, perfect for IT person, on-call doctor, professor or anyone carrying a pager, works great to make sure I don’t miss certain critical messages, like a urgent SMS message from your Boss or your pregnant wife.

More information: https://jansouza.com/smsalert/

 

 

 

 

Install from Google Play Now!
Android app on Google Play

http://play.google.com/store/apps/details?id=com.smsalert

Install with the QR Code

Avatar vs Modern Warfare 2

O mercado de jogos eletrônicos cresceu muito nos últimos anos, principalmente pela expansão de seu público-alvo. Segundo dados do NPD Group, órgão de pesquisa de mercado dos Estados Unidos, de 1999 a 2009 a indústria de jogos eletrônicos teve aumento de vendas superior a 400%. Para se ter ideia, no mesmo período, a indústria cinematográfica cresceu 32%.

A revista online Business Management divulgou uma comparação entre o filme Avatar e o jogo Modern Warfare 2.
Até agora, o filme, a segunda bilheteria da história, já faturou mais de US$ 1,37 bilhão (quase R$ 2,5 bilhões), enquanto o jogo conseguiu US$ 1 bilhão (cerca de R$ 1,7 bilhão). O maior faturamento da indústria dos games é do Guitar Hero III, que atingiu a marca de US$ 2 bilhões (R$ 3,5 bilhões).

Avatar vs Modern Warfare

Games Top 10 Junho/2010

O NPD Group liberou os rankings de venda de consoles e jogos nos EUA, com base em pesquisas realizadas em todas as distribuidoras do país durante todo o mês de junho.

Consoles

1. Nintendo DS / Lite / DSi / XL – 510.700
2. Xbox 360 – 451.700
3. Wii – 422.500
4. PlayStation 3 – 304.800
5. PSP / Go – 121.000

Jogos

1. [360]Red Dead Redemption – 582.600
2. [Wii]Super Mario Galaxy 2 – 548.400
3. [PS3]Red Red Redemption – 380.300
4. [Wii]New Super Mario Bros. Wii – 200.900
5. [Wii]Just Dance – 174.800
6. [Wii]Wii Fit Plus
7. [DS]Toy Story 3 (DS)
8. [360]UFC 2010: Undisputed
9. [Wii]LEGO Harry Potter: Years 1-4
10. [PS3]UFC 2010: Undisputed

Fonte: NPD Group

Android – Tab Layout Scroll

I created an extension of Tab Layout to allow add many elements in TabHost.

1. First Create TabScrollHost Object

Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost1 = getTabHost(); // The activity TabHost
TabHost.TabSpec spec;  // Resusable TabSpec for each tab
Intent intent;  // Reusable Intent for each tab

ImageView tab_next = (ImageView) findViewById(R.id.tab_next); //Next Image
ImageView tab_previous = (ImageView) findViewById(R.id.tab_previous); //Previous Image
TabScrollHost tabHost = new TabScrollHost(tabHost1,tab_next,tab_previous); //my Class

2. Now just add all elements on TabScrollHost

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab1”).setIndicator(“Tab1”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab2”).setIndicator(“Tab2”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

….

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab10”).setIndicator(“Tab10”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

3. Done. TabScrollHost will controller, to change the number of elements:

private static final int TAB_MAX = 4;

Enjoy!!!

main.xml

<?xml version=”1.0″ encoding=”utf-8″?>
<TabHost xmlns:android=”http://schemas.android.com/apk/res/android&#8221;
android:id=”@android:id/tabhost”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”>
<LinearLayout
android:orientation=”vertical”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”
android:padding=”5dp”>

<TabWidget
android:id=”@android:id/tabs”
android:layout_width=”fill_parent”
android:layout_height=”wrap_content”
android:layout_marginRight=”2pt”
android:layout_marginLeft=”2pt” />

<ImageView
android:id=”@+id/tab_previous”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_gravity=”left|top”
android:src=”@drawable/previous”
android:layout_marginTop=”-18px”
android:layout_marginLeft=”-2px”/>

<ImageView
android:id=”@+id/tab_next”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_gravity=”right|top”
android:src=”@drawable/next”
android:layout_marginTop=”-22px”
android:layout_marginRight=”-2px”/>

<FrameLayout
android:id=”@android:id/tabcontent”
android:layout_width=”fill_parent”
android:layout_height=”fill_parent”/>
android:padding=”5dp” />
</LinearLayout>
</TabHost>

Java Code:

public class TabScrollHost {
private TabHost tabHost;

private static final int TAB_MAX = 4;
private List<TabHost.TabSpec> listTab;
private int currentPage = 0;

private ImageView tab_next;
private ImageView tab_previous;

public TabScrollHost(TabHost tabHost,ImageView tab_next,ImageView tab_previous) {
this.listTab = new ArrayList<TabHost.TabSpec>();
this.currentPage = 0;
this.tabHost = tabHost;
this.tab_previous = tab_previous;
this.tab_next = tab_next;

this.tab_previous.setVisibility(View.INVISIBLE);
this.tab_next.setVisibility(View.INVISIBLE);

this.tab_next.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
onClickNext();
}
});

this.tab_previous.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
onClickPrevious();
}
});
}

public void onClickNext() {
currentPage++;
this.tabHost.setCurrentTab(0);
this.tabHost.clearAllTabs();
int start = currentPage * TAB_MAX;
int end = start + TAB_MAX;
if(end >= listTab.size()){
end = listTab.size();
this.tab_next.setVisibility(View.INVISIBLE);
}
Log.v(“TabScrollHost”, “start:”+start+” end:”+end);
Log.v(“TabScrollHost”, “listTab:”+listTab);

List<TabHost.TabSpec> subList = listTab.subList(start, end);
for (TabHost.TabSpec spec : subList) {
this.tabHost.addTab(spec);
}

//this.tabHost.setCurrentTab(0);
this.tab_previous.setVisibility(View.VISIBLE);
}

public void onClickPrevious() {
currentPage–;
this.tabHost.setCurrentTab(0);
this.tabHost.clearAllTabs();

int start = currentPage * TAB_MAX;
int end = start + TAB_MAX;

Log.v(“TabScrollHost”, “start:”+start+” end:”+end);
Log.v(“TabScrollHost”, “listTab:”+listTab);

List<TabHost.TabSpec> subList = listTab.subList(start, end);
for (TabHost.TabSpec spec : subList) {
this.tabHost.addTab(spec);
}

//this.tabHost.setCurrentTab(0);
if(currentPage <=0)
this.tab_previous.setVisibility(View.INVISIBLE);

this.tab_next.setVisibility(View.VISIBLE);
}

public void addTab(TabHost.TabSpec tabSpec) {
Log.v(“TabScrollHost”, “addTab”);
listTab.add(tabSpec);

if (listTab.size() <= TAB_MAX) {
this.tabHost.addTab(tabSpec);
}else{
this.tab_next.setVisibility(View.VISIBLE);
}
}

public void setCurrentTab(int index){
this.tabHost.setCurrentTab(index);
}

}

public class MainActivity extends TabActivity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Resources res = getResources(); // Resource object to get Drawables
TabHost tabHost1 = getTabHost(); // The activity TabHost
TabHost.TabSpec spec;  // Resusable TabSpec for each tab
Intent intent;  // Reusable Intent for each tab

ImageView tab_next = (ImageView) findViewById(R.id.tab_next);
ImageView tab_previous = (ImageView) findViewById(R.id.tab_previous);
TabScrollHost tabHost = new TabScrollHost(tabHost1,tab_next,tab_previous);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab1”).setIndicator(“Tab1”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab2”).setIndicator(“Tab2”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab3”).setIndicator(“Tab3”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab4”).setIndicator(“Tab4”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab5”).setIndicator(“Tab5”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab6”).setIndicator(“Tab6”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab7”).setIndicator(“Tab7”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab8”).setIndicator(“Tab8”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab9”).setIndicator(“Tab9”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this,Tab1Activity.class);
spec = tabHost1.newTabSpec(“tab10”).setIndicator(“Tab10”,
res.getDrawable(R.drawable.icon)).setContent(intent);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);
}
}

public class Tab1Activity extends Activity {

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

TextView textview = new TextView(this);
textview.setText(“This is the Artists tab”);
setContentView(textview);
}

}

Android Https Connection

I got this error on Android SDK 1.1 on HTTPS connections.

java.io.IOException: Hostname <www.verisign.com> was not verified

To Fix it, just include this code bellow:

URL aURL = new URL(url);

HttpsURLConnection conn = (HttpsURLConnection) aURL.openConnection();
conn.setHostnameVerifier( new HostnameVerifier() {
public boolean verify( String hostname, SSLSession session ) {
return true;
}
});

conn.connect();

Enjoy!!