Skip to content

Instantly share code, notes, and snippets.

package com.wmbest.iphone4;
import android.app.Activity;
import android.os.Bundle;
import android.content.Intent;
import android.widget.Button;
import android.view.View;
import com.admob.android.ads.AdView;
public class iPhone4Launcher extends Activity {
package com.wmbest.pivotal;
import android.app.IntentService;
import android.content.Intent;
public class PivotalIntentService extends IntentService {
public void onHandleIntent(Intent aIntent) {
switch(aIntent.getAction()) {
default:
private void insertListings() {
ArrayList<Listing> listings = createListings();
for(Listing listing : listings) {
Log.d(TAG, listing.getChannelNumber());
ContentValues params = new ContentValues();
params.put(Listings.CHANNEL_NUMBER, listing.getChannelNumber());
private ArrayList<Listing> createListings() {
ArrayList<Listing> result = new ArrayList<Listing>();
Listing listing = new Listing();
listing.setChannelNumber("1");
listing.setFullTitle("TMZ");
listing.setCategory("news");
listing.setStartTime(11111);
listing.setEndTime(10101);
listing.setDuration("1800");
String[] whereArgs = new String[] {
Long.toString(aStart),
Long.toString(aStart)
};
String where = Listings.START_TIME + " <= ? AND " + Listings.END_TIME + " >= ?";
Cursor query = aContext.getContentResolver().query(Listings.CONTENT_URI, projectionMap,
where, whereArgs, null);
ImageDownloader imageDownloader = new ImageDownloader();
imageDownloader.download(cursor.getString(url_column), channelLogo);
channel_num.setText(cursor.getString(channel_column));
title.setText(cursor.getString(title_column));
12-15 21:22:45.302: INFO/NetworkUtils(19961): {"viResponse":{"viResponseCode":200, "viResponseMessage":{"item":[{"type":"current","last_update":"6:51pm, 12/15/2010","unit":"F","current_temp":"29","uv":"NA","weather_desc":"Wintry Mix","dewpoint":"22","relative_humidity":"70%","sky_url":"http://images.charter.net/weathercom/small/7.gif","visibility":"8 miles","barometric_pressure":"29.82 in","barometric_trend":"Steady","wind_dir_text":"ESE","wind_speed":"10 mph","windchill":"20"},{"type":"forecast","status":"valid","day":"0","date":"Wednesday, Dec. 15","unit":"F","high_temp":"--","low_temp":"28","weather_desc_day":"*","weather_desc_night":"Ice Early","sky_url_day":"NA","sky_url_night":"http://images.charter.net/weathercom/small/10.gif","precip_day":"NA","precip_night":"30%"},{"type":"forecast","status":"valid","day":"1","date":"Thursday, Dec. 16","unit":"F","high_temp":"32","low_temp":"21","weather_desc_day":"Cloudy","weather_desc_night":"Cloudy","sky_url_day":"http://images.charter.net/weathercom/small/26.gif"
ArrayList<Listing> shows = new ArrayList<Listing>();
String channelId = listings.get(0).getChannelId();
for( Listing listing : listings ) {
if(!channelId.equals(listing.getChannelId())) {
mBlock.add(shows);
shows = new ArrayList<Listing>();
}
shows.add(listing);
}
if(manhuntInputValidation.isProviderAvailable() && Code.LONGITUDE!=0.0 && Code.LATITUDE!=0.0){
mHashMap.put(TAG_GETGPSMEN_LON,""+Code.LONGITUDE );
mHashMap.put(TAG_GETGPSMEN_LAT, ""+Code.LATITUDE);
}
else
{
Toast.makeText(ManhuntNearbyGuys.this,"Your location cannot be located!", Toast.LENGTH_SHORT).show();
}
manhuntHttpBinder = new ManhuntHttpBinder(mHashMap,Code._GETGPSMEN,ManhuntNearbyGuys.this,manhuntInputValidation);
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wmbest.countdown"
android:versionCode="1"
android:versionName="1.0">
<application android:label="TEST WIDGET" android:icon="@drawable/icon">
<receiver android:name="CountdownWidget"
android:label="Jill's Widget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />