Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!

This error is annoying and seemingly hard to find a way to fix it.

I got it will Eclipse Luna (4.4.1) and the latest SDK and ADT.

After much messing around – I found the way to fix is to remove Android SDK Tools. SDK Platform-tools and Build-Tools (you might not need to remove al three but I tried platform-tools by itself and it didn’t work)tools

 

and then re-installed them. Restart Eclipse and the error should be gone!

Huawei’s Support or lack of it (updated)

On Oct 30th I contacted Huawei UK re an Ascend P1 that was not powering on. I posted the phone back to them on the same day (Oct 30th 2013).

I rang on the 12th November to get an update from Huawei about the status of the repair as I had not heard from them. The Huawei tech support team said that the item had been posted out to me 4 days previously so I assumed the phone would arrive to me the next day. I am in the Rep of Ireland and I had sent the phone to the UK to get repaired. So if the phone had been posted on the 8th of November then usually I would have received it on or before the 15th November.

On the 20th November I rang Huawei to again check the status of the phone repair as I still had not received the phone. Dan the Huawei customer support rep gave me a Royal Mail tracking number – when I checked this number later that day it turned out the phone had been delivered – but in Norwich and had been signed for. So it turns out my phone had been sent but somehow was in Norwich in the UK….not Tralee in the Rep of Ireland.

So on the 22nd November (phone call no 4) I rang Huawei again and was talking to Christine. She was not very helpful and couldn’t even say where my phone was. She said I should ring Royal Mail, but as I could see Royal Mail had already delivered the phone to an address in Norwich there was not much point in me ringing them. Also as I hadn’t sent the package I was not the customer of Royal Mail…Huawei were. She eventually said the phone was in the repair centre and would be sent out as soon as possible. As I was quite frustrated at this point I said I would like the phone by 29/November/2013 or a full refund. Which would have allowed them time to post it to me or to courier it. I also said if there was any issue/problem with returning the phone I would appreciate being contacted by email or phone.

So….on the 29th November I rang Huawei Tech Support again….5th call. I was talking to Sam (who again was not very helpful). He at first got me to explain the situation even though he should have the information in front of him. He then stated that I should ring the Repair Centre – I explained to him that as a Huawei representative shouldn’t it be his job to find out where my phone was. I then asked to talk to his superior and he put me on hold. When he returned he said his manager was unavailable to talk to me but he had magically contacted the repair centre and my phone was still there. So 20 days after my phone was sent to me it was somehow still in their repair centre. I then asked could he escalate this issue and he said as they are a contracted company to Huawei that he couldn’t. I asked him could he escalate it to someone in the repair company and he couldn’t. I asked him about contacting Huawei directly and he said they had no real presence in the UK. He said that the phone would be posted today….(not sure how I am meant to believe that) and that he could not help me any further re a refund or escalating the issue. I have contacted Huawei previously through email & twitter where I got responseson the 26th November by never received any update from them after that.

So I am now looking at taking legal advice re the next steps as I have no other way to contact them and having already wasted over €20 ringing them I am put off wasting more money and time without any real progress.

On Tuesday Dec 3rd after being in touch with Huawei through Twitter and sending an email through their contact form I was eventually rang by a Huawei representative to check my address. My address was correct on their systems. The repair company claim to have sent out the phone on two occasions but both times it got returned to them. The Huawei representative told me he would find out the status and get back to me with a tracking number.

On the 5th December I contacted the Huawei representative re the tracking number and status of the phone delivery. He did reply with a tracking number but as far as I can tell that tracking number was only set up on the 5th December so the phone was only sent that day – on the previous Friday 29th November the repair company rep had promised me the phone would be sent that day. Surprisingly Huawei sent out the phone by post (not by courier to speed up the process) so the tracking number is useless after leaving the UK so I am presuming the phone is in Ireland but hasn’t been delivered to me as yet.

I am now without this phone for 41 days – my understanding of the legal requirement is that a repair under warranty should be carried out within 30 days. I have contacted Huawei today in relation to this.

 

 

Huawei UK’s support or lack of it

On Oct 30th I contacted Huawei UK re an Ascend P1 that was not powering on. I posted the phone back to them on the same day (Oct 30th 2013).

I rang on the 12th November to get an update from Huawei about the status of the repair as I had not heard from them. The Huawei tech support team said that the item had been posted out to me 4 days previously so I assumed the phone would arrive to me the next day. I am in the Rep of Ireland and I had sent the phone to the UK to get repaired. So if the phone had been posted on the 8th of November then usually I would have received it on or before the 15th November.

On the 20th November I rang Huawei to again check the status of the phone repair as I still had not received the phone. Dan the Huawei customer support rep gave me a Royal Mail tracking number – when I checked this number later that day it turned out the phone had been delivered – but in Norwich and had been signed for. So it turns out my phone had been sent but somehow was in Norwich in the UK….not Tralee in the Rep of Ireland.

So on the 22nd November (phone call no 4) I rang Huawei again and was talking to Christine. She was not very helpful and couldn’t even say where my phone was. She said I should ring Royal Mail, but as I could see Royal Mail had already delivered the phone to an address in Norwich there was not much point in me ringing them. Also as I hadn’t sent the package I was not the customer of Royal Mail…Huawei were. She eventually said the phone was in the repair centre and would be sent out as soon as possible. As I was quite frustrated at this point I said I would like the phone by 29/November/2013 or a full refund. Which would have allowed them time to post it to me or to courier it. I also said if there was any issue/problem with returning the phone I would appreciate being contacted by email or phone.

So….on the 29th November I rang Huawei Tech Support again….5th call. I was talking to Sam (who again was not very helpful). He at first got me to explain the situation even though he should have the information in front of him. He then stated that I should ring the Repair Centre – I explained to him that as a Huawei representative shouldn’t it be his job to find out where my phone was. I then asked to talk to his superior and he put me on hold. When he returned he said his manager was unavailable to talk to me but he had magically contacted the repair centre and my phone was still there. So 20 days after my phone was sent to me it was somehow still in their repair centre. I then asked could he escalate this issue and he said as they are a contracted company to Huawei that he couldn’t. I asked him could he escalate it to someone in the repair company and he couldn’t. I asked him about contacting Huawei directly and he said they had no real presence in the UK. He said that the phone would be posted today….(not sure how I am meant to believe that) and that he could not help me any further re a refund or escalating the issue. I have contacted Huawei previously through email & twitter where I got responseson the 26th November by never received any update from them after that.

So I am now looking at taking legal advice re the next steps as I have no other way to contact them and having already wasted over €20 ringing them I am put off wasting more money and time without any real progress.

 

 

 

Collecting Tweets Using a Geolocation Bounding Box Using Java (Twitter4j)

This code collects Tweets in an area around Galway, Ireland. The one thing to notice here (and something that baffled me for a while) is that while it returns (latitude, longitude), the bounding box is defined as {{longitude1,latitude1},{longitude2,latitude2}} as answered here

This is using Twitter4j 3.0.3 Core and Stream.

package me.davidcrowley.deri.geotweets;

import java.util.Date;

import twitter4j.FilterQuery;
import twitter4j.GeoLocation;
import twitter4j.Place;
import twitter4j.StallWarning;
import twitter4j.Status;
import twitter4j.StatusDeletionNotice;
import twitter4j.StatusListener;
import twitter4j.TwitterStream;
import twitter4j.TwitterStreamFactory;
import twitter4j.User;
import twitter4j.conf.ConfigurationBuilder;

public class GeoTweets {
	public static void main(String[] args) {
		ConfigurationBuilder cb = new ConfigurationBuilder();
		cb.setDebugEnabled(true);
		cb.setOAuthConsumerKey("xxxxxx");
		cb.setOAuthConsumerSecret("xxxxx");
		cb.setOAuthAccessToken("xxxxx");
		cb.setOAuthAccessTokenSecret("xxxxx");

		TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();

		StatusListener listener = new StatusListener() {

			@Override
			public void onException(Exception arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onDeletionNotice(StatusDeletionNotice arg0) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onScrubGeo(long arg0, long arg1) {
				// TODO Auto-generated method stub

			}

			@Override
			public void onStatus(Status status) {
				User user = status.getUser();

				// gets Username
				String username = status.getUser().getScreenName();
				System.out.println(username);
				String profileLocation = user.getLocation();
				System.out.println(profileLocation);
				long tweetId = status.getId(); 
				System.out.println(tweetId);
				String content = status.getText();
				System.out.println(content);
				GeoLocation geolocation = status.getGeoLocation();
				double tweetLatitude = geolocation.getLatitude();
				double tweetLongitude = geolocation.getLongitude();

				String application = status.getSource();
				System.out.println(application);

				Place placenameJSON = status.getPlace();
				System.out.println(placenameJSON);
				String placename = placenameJSON.getFullName();
				System.out.println(placename);
				Date time = status.getCreatedAt();
				System.out.println(time);

				System.out.println(tweetLatitude + "," + tweetLongitude +"\n");
			}

			@Override
			public void onTrackLimitationNotice(int arg0) {
				// TODO Auto-generated method stub
				System.out.println("onTrackLimitationNotice" +"\n");

			}

			@Override
			public void onStallWarning(StallWarning arg0) {
				// TODO Auto-generated method stub
				System.out.println("onStallWarning" +"\n");

			}

		};
		FilterQuery fq = new FilterQuery();
		double lat = 53.270141;
		double longitude = -9.055488;
		double lat1 = lat - .25;
		double longitude1 = longitude - .25;
		double lat2 = lat + .25;
		double longitude2 = longitude + .25;
		twitterStream.addListener(listener);
		double[][] bb= {{longitude1, lat1}, {longitude2, lat2}};

		fq.locations(bb);

		twitterStream.filter(fq);  

	}
}

Email to Ireland’s Joint Committee on Transport and Communications

I am confused by the lack of knowledge shown in discussion in regard to the Joint Committee on Transport and Communications. It is fairly obvious that they people talking have little or no knowledge of the Web as a whole. It is a major concern in a country that pushes the idea of being a “Knowledge Economy” that these people might make decisions in relation to access to the Web.

As a researcher in this area and with SFI announcing just recently into the importance of research in the area of Big Data – which by most definitions includes online data it worries me the mixed signal Irish politicians send out regarding this. They are in favour of it when it seems like something that will get them noticed in the papers/TV, when it is a positive jobs creation story but against when it relates to bullying or copyright issues.

I really hope that this committee actually gets advice from industry leaders and academia members especially when Ireland is known for its web/computer science research (look at groups like Clarity, DERI, LERO, 4C in UCC, and smaller groups).

Blanket bans and someone suggesting passports to get online sounds like something from non-democratic countries like North Korea! If we as a country want to keep our best talent and attract the best talent to our research labs and universities we need to legislate to bring people who commit crimes to justice not grasp at crazy ideas because we do no understand the underlying technologies involved in the Web,

Regards,

David

Simple Tweets collection using Twitter’s Stream API and Java using Twitter4j

Fairly simple tweet collection (you will need to add to file/database/other storage) using Twitter’s stream API and Twitter4j

You need to add the Twitter4j core and stream Jars to your java application & you need to add in your own Twitter application tokens and user tokens (you should change this to not hardcode in the user tokens)

package com.crowley.simplestream;

import twitter4j.FilterQuery;
import twitter4j.Status;
import twitter4j.StatusDeletionNotice;
import twitter4j.StatusListener;
import twitter4j.TwitterStream;
import twitter4j.TwitterStreamFactory;
import twitter4j.User;
import twitter4j.conf.ConfigurationBuilder;

public class SimpleStream {
    public static void main(String[] args) {
        ConfigurationBuilder cb = new ConfigurationBuilder();
        cb.setDebugEnabled(true);
        cb.setOAuthConsumerKey("*************");
        cb.setOAuthConsumerSecret("*************");
        cb.setOAuthAccessToken("*************");
        cb.setOAuthAccessTokenSecret("*************");

        TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();

        StatusListener listener = new StatusListener() {

            @Override
            public void onException(Exception arg0) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onDeletionNotice(StatusDeletionNotice arg0) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onScrubGeo(long arg0, long arg1) {
                // TODO Auto-generated method stub

            }

            @Override
            public void onStatus(Status status) {
                User user = status.getUser();
                
                // gets Username
                String username = status.getUser().getScreenName();
                System.out.println(username);
                String profileLocation = user.getLocation();
                System.out.println(profileLocation);
                long tweetId = status.getId(); 
                System.out.println(tweetId);
                String content = status.getText();
                System.out.println(content +"\n");

            }

            @Override
            public void onTrackLimitationNotice(int arg0) {
                // TODO Auto-generated method stub

            }

        };
        FilterQuery fq = new FilterQuery();
    
        String keywords[] = {"ireland"};

        fq.track(keywords);

        twitterStream.addListener(listener);
        twitterStream.filter(fq);  

    }
}

Android Twitter oAuth with Twitter4j (without signpost)

Basic Code for Twitter oAuth for Android works with any version of Android I have tested it against – will crash if no Internet access but adding a check for this is relevantly simple (wanted to keep the code just about the oAuth process – the core idea and code comes from this blogpost

AndroidBasicOAuthActivity Code

package me.crowleydavid.android.basicoauth;

import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
import twitter4j.conf.Configuration;
import twitter4j.conf.ConfigurationBuilder;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class AndroidBasicOAuthActivity extends Activity {
    private int TWITTER_AUTH;
    private Twitter mTwitter;
    private RequestToken mRequestToken;

    private String accessToken;
    private String accessTokenSecret;

    private boolean haveConnectedWifi;
    private boolean haveConnectedMobile;
    private double x;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
        accessToken = settings.getString( "twitter_access_token", null );
        accessTokenSecret = settings.getString( "twitter_access_token_secret", null );
        Button tweetB = (Button) findViewById(R.id.tweet_button);
        tweetB.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                updateStatus();

            }
        });

    }
    private boolean haveNetworkConnection() {
        haveConnectedWifi = false;
        haveConnectedMobile = false;

        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo[] netInfo = cm.getAllNetworkInfo();
        for (NetworkInfo ni : netInfo) {
            if (ni.getTypeName().equalsIgnoreCase("WIFI"))
                if (ni.isConnected())
                    haveConnectedWifi = true;
            if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
                if (ni.isConnected())
                    haveConnectedMobile = true;
        }
        return haveConnectedWifi || haveConnectedMobile;
    }

// private void updateStatusLoggedIn() {
// SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
// accessToken = settings.getString( "twitter_access_token", null );
// accessTokenSecret = settings.getString( "twitter_access_token_secret", null );
//
// // String s2 = String.valueOf(i);
// // Toast.makeText(this, s2, 10000).show();
// ConfigurationBuilder builder = new ConfigurationBuilder();
// builder.setOAuthConsumerKey(Constants.CONSUMER_KEY);
// builder.setOAuthConsumerSecret(Constants.CONSUMER_SECRET);
// builder.setOAuthAccessToken(accessToken);
// builder.setOAuthAccessTokenSecret(accessTokenSecret);
// Configuration conf = builder.build();
// Twitter t = new TwitterFactory(conf).getInstance();
// i++;
// try {
// if(i<10){
// t.updateStatus( "Loggedin" + i);
// }
// }
// catch (TwitterException e) {
// e.printStackTrace();
// }
//
// }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // TODO Auto-generated method stub

        if (requestCode == TWITTER_AUTH)
        {

            if (resultCode == Activity.RESULT_OK)
            {
                Toast.makeText(this, "Hey Ho", 300).show();
                String oauthVerifier = (String) data.getExtras().get("oauth_verifier");

                AccessToken at = null;

                try
                {
                    // Pair up our request with the response
                    at = mTwitter.getOAuthAccessToken(oauthVerifier);
                    String theToken = at.getToken();
                    // Toast.makeText(this, theToken, 10000).show();
                    String theTokenSecret = at.getTokenSecret();
                    // Toast.makeText(this, theTokenSecret, 10000).show();
                    SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
                    settings = PreferenceManager.getDefaultSharedPreferences(this);
                    SharedPreferences.Editor editor = settings.edit();
                    editor.putString("twitter_access_token",theToken);
                    editor.putString("twitter_access_token_secret", theTokenSecret);
                    editor.commit();

                    // his method
                    // settings.edit()
                    // .putString( "twitter_access_token", at.getToken() )
                    // .putString( "twitter_access_token_secret", at.getTokenSecret() )
                    // .commit();
                    // Intent i = new Intent(this, someclass.class);
                    // startActivity(i);

                    updateStatus();
                }
                catch (TwitterException e)
                {
                    e.printStackTrace();
                }
            }
        }
        else
        {
            Toast.makeText(this, "uh oh, Spaghetti Os", 300).show();
        }

    }
    private void updateStatus() {
        // TODO Auto-generated method stub
        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
        accessToken = settings.getString( "twitter_access_token", null );
        accessTokenSecret = settings.getString( "twitter_access_token_secret", null );
        // Toast.makeText(this, accessToken, 10000).show();
        // Toast.makeText(this, accessTokenSecret, 10000).show();
        haveNetworkConnection();
        if ((haveConnectedWifi)|| (haveConnectedMobile)){
            ConfigurationBuilder builder = new ConfigurationBuilder();
            builder.setOAuthConsumerKey(Constants.CONSUMER_KEY);
            builder.setOAuthConsumerSecret(Constants.CONSUMER_SECRET);
            builder.setOAuthAccessToken(accessToken);
            builder.setOAuthAccessTokenSecret(accessTokenSecret);
            Configuration conf = builder.build();
            Twitter t = new TwitterFactory(conf).getInstance();

            try {
                x = Math.random();
                t.updateStatus( "Yo ho ho and a bottle of rum " + x);

            }
            catch (TwitterException e) {
                e.printStackTrace();
            }
        }
        else{
            Toast.makeText(this, "No access to Internet..please try again", 3000).show();
        }
    }
    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);

        accessToken = settings.getString( "twitter_access_token", null );
        accessTokenSecret = settings.getString( "twitter_access_token_secret", null );
        haveNetworkConnection();
        if ((haveConnectedWifi)|| (haveConnectedMobile)){
            // Toast.makeText(this, "Internet is go!", 3000).show();
            // Intent i = new Intent(this, AndroidBasicOAuthActivity.class);
            // startActivity(i);

            if ((accessToken==null)||(accessTokenSecret==null)){
                mTwitter = new TwitterFactory().getInstance();
                mRequestToken = null;
                mTwitter.setOAuthConsumer(Constants.CONSUMER_KEY,Constants.CONSUMER_SECRET );
                String callbackURL = getResources().getString(R.string.twitter_callback);
                try
                {
                    mRequestToken = mTwitter.getOAuthRequestToken(callbackURL);
                }
                catch (TwitterException e)
                {
                    e.printStackTrace();
                }
                Intent i = new Intent(this, TwitterWebviewActivity.class);
                i.putExtra("URL", mRequestToken.getAuthenticationURL());
                startActivityForResult(i, TWITTER_AUTH);
            }
            else{
                Toast.makeText(this, "Token found..logged in", 3000).show();
                // updateStatusLoggedIn();
            }
        }
        else{
            Toast.makeText(this, "No access to Internet..please try again", 3000).show();
            Intent i = new Intent(this, CheckNetAccess.class);
            startActivity(i);
        }
    }
}

Constants Code you need to enter your own Twitter Developer keys here

package me.crowleydavid.android.basicoauth;

public class Constants {

    public static final String CONSUMER_KEY = "************";
    public static final String CONSUMER_SECRET= "**************";

TwitterWebviewActivity Code
package me.crowleydavid.android.basicoauth;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class TwitterWebviewActivity extends Activity {
    private Intent mIntent;
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.twitter_webview);
        mIntent = getIntent();
        String url = (String)mIntent.getExtras().get("URL");
        WebView webView = (WebView) findViewById(R.id.webview);
        webView.setWebViewClient( new WebViewClient()
        {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url)
            {
                if( url.contains(getResources().getString( R.string.twitter_callback )))
                {
                    Uri uri = Uri.parse( url );
                    String oauthVerifier = uri.getQueryParameter( "oauth_verifier" );
                    mIntent.putExtra( "oauth_verifier", oauthVerifier );
                    setResult( RESULT_OK, mIntent );
                    finish();
                    return true;
                }
                return false;
            }
        });
        webView.loadUrl(url);
    }
}

}

CheckNetAccess Code

package me.crowleydavid.android.basicoauth;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class CheckNetAccess extends Activity {
    private boolean haveConnectedWifi;
    private boolean haveConnectedMobile;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.checknet);
        Button netB = (Button) findViewById(R.id.netbutton);
        netB.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                haveNetworkConnection();
                if ((haveConnectedWifi)|| (haveConnectedMobile)){
                    Toast.makeText(CheckNetAccess.this, "Internet is go!", 3000).show();
                    Intent i = new Intent(CheckNetAccess.this, AndroidBasicOAuthActivity.class);
                    startActivity(i);
                }
                else{
                    Toast.makeText(CheckNetAccess.this, "No access to Internet..please try again", 3000).show();
                }
            }
        });

    }

    private boolean haveNetworkConnection() {
        haveConnectedWifi = false;
        haveConnectedMobile = false;

        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo[] netInfo = cm.getAllNetworkInfo();
        for (NetworkInfo ni : netInfo) {
            if (ni.getTypeName().equalsIgnoreCase("WIFI"))
                if (ni.isConnected())
                    haveConnectedWifi = true;
            if (ni.getTypeName().equalsIgnoreCase("MOBILE"))
                if (ni.isConnected())
                    haveConnectedMobile = true;
        }
        return haveConnectedWifi || haveConnectedMobile;
    }
    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
    }

}

Android Manifest needs these permissions

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

AndroidBasicOAuth

Crowdsourcing, citizen sensing and sensor web technologies for public and environmental health surveillance and crisis management: trends, OGC standards and application examples

Abstract
’Wikification of GIS by the masses’ is a phrase-term first coined by Kamel Boulos in 2005, two years earlier than Goodchild’s term ‘Volunteered Geographic Information’. Six years later (2005-2011), OpenStreetMap and Google Earth (GE) are now full-fledged, crowdsourced ‘Wikipedias of the Earth’ par excellence, with millions of users contributing their own layers to GE, attaching photos, videos, notes and even 3-D (three dimensional) models to locations in GE. From using Twitter in participatory sensing and bicycle-mounted sensors in pervasive environmental sensing, to creating a 100,000-sensor geo-mashup using Semantic Web technology, to the 3-D visualisation of indoor and outdoor surveillance data in real-time and the development of next-generation,
collaborative natural user interfaces that will power the spatially-enabled public health and emergency situation rooms of the future, where sensor data and citizen reports can be triaged and acted upon in real-time by distributed teams of professionals, this paper offers a comprehensive state-of-the-art review of the overlapping domains of the Sensor Web, citizen sensing and ‘human-in-the-loop sensing’ in the era of the Mobile and Social
Web, and the roles these domains can play in environmental and public health surveillance and crisis/disaster informatics. We provide an in-depth review of the key issues and trends in these areas, the challenges faced when reasoning and making decisions with real-time crowdsourced data (such as issues of information overload, “noise”, misinformation, bias and trust), the core technologies and Open Geospatial Consortium (OGC) standards involved (Sensor Web Enablement and Open GeoSMS), as well as a few outstanding project implementation examples from around the world.

http://www.ij-healthgeographics.com/content/pdf/1476-072X-10-67.pdf

Rotation Vector Sensor Android – Gyroscope

After messing around with sensors for a while and tried to see what TYPE_ROTATION_VECTOR actually returned as values. The docs seemed pretty sparse to me!

But whenever I tried to run a simple program to display the sensor output the activity crashed….due to a null pointer exception. Read a few posts and none was very clear….some mentioned that a gyroscope was needed…

Found this post which implies the device needs a gyroscope to implement a Rotation Vector Sensor.

Not 100% but as much information as I can find online!

Displaying a list of Sensors available on an Android device (Gingerbread) 2.3.3 used

Code below displays all available sensors (hardware and virtual)

import java.util.List;
import android.app.Activity;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.widget.TextView;

public class SensorListActivity extends Activity implements SensorEventListener {
	private SensorManager mSensorManager;
	private TextView mTextView;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
		mTextView = (TextView) findViewById(R.id.text_view);

		List<Sensor> mList
        = mSensorManager.getSensorList(Sensor.TYPE_ALL);
		for (int i = 1; i < mList.size(); i++) {
			mTextView.append("\n" + mList.get(i).getName());
			}
	}

	@Override
	public void onAccuracyChanged(Sensor arg0, int arg1) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onSensorChanged(SensorEvent event) {
		// TODO Auto-generated method stub 

	}
	protected void onPause(){
		super.onStop();
	}
	protected void onStop() {
		super.onStop();
	}
	protected void onResume()
	{
		super.onResume();
	}

}

main.xml (just a textview to show the list of sensors)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView
	android:id="@+id/text_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 

    />
</LinearLayout>
Sensors list displayed on Nexus One
Sensors list displayed on Nexus One