Bitcoin ATM on its way to Britain

20 Feb 2014 / Telegraph – British investors will be able to buy and sell bitcoins from a cash machine under plans announced by an American company.

The machine will be installed somewhere in London, although the company behind it, Las Vegas based Robocoin, could not say exactly when it would become operational.

The ATM will allow people to deposit cash to buy bitcoins, or sell bitcoins for cash, by transferring funds to or from a “virtual wallet” on a smartphone, which the user holds up to a scanner on the machine.

The bitcoin dispensers will also scan government-issued identification such as a driver’s licence or a passport to confirm users’ identities.

A spokesman for Robocoin told The Telegraph: “It [the bitcoin ATM for London] has already been purchased and the wheels are in motion.”

The company has already installed two machines in Canada and plans more in the US, Asia and Europe. Another company, General Bytes, installed a bitcoin dispenser in Prague this week. It said hoped to make as many as 500 of the machines a month and install them around the world….. Read more

Telegraph.co.uk

Consuming JSON services in Android apps

Unless you are writing a Hello World Android application, chances are your application would need to connect to the outside world to fetch some data, such as live currency exchange rates, weather information, records from databases, etc. One of the easiest ways for your application to connect to the outside world is to use web services.

For the past few years, XML web services have dominated the arena for web services, as XML was touted as the ubiquitous medium for data exchange. However, using XML as the medium for your data payload suffers from the following problems:

1. XML representation is inherently heavy. The use of opening and closing tags add a lot of unnecessary weight to the payload. In the world of mobile applications, shaving a few bytes off the payload will dramatically improve the performance of applications, not to mention the reduction of data transferred over the expensive 3G and LTE wireless networks. This translates into cost savings for both application developers (who need to subscribe to expensive networks for their web servers) and users (who has limited amount of bandwidth to use per subscription).
2. XML representation is difficult to parse. While on the desktop, the DOM (Document Object Model) and SAX (Simple APIs for XML) are the two commonly used method for parsing XML Documents; on the mobile platform using DOM and SAX are very expensive, both computationally and in terms of memory requirements.

In recent years, another data interchange format has been gaining in popularity – JSON, or JavaScript Object Notation. Like XML, JSON is a text-based open standard for representing data, and it uses characters such as brackets “[{]}”, colon “:” and comma “,”, to represent data. Data are represented using simple key/value pairs, and more complex data are represented as associative arrays.

In this article, I will walk you through on how to consume a JSON service in your Android application.

Creating the Project

For this project, I will be using Eclipse with the Android 4.1 SDK. To start off, create an Android application project and name it as shown in Figure 1.

consuming-json-services-in-android-apps
consuming-json-services-in-android-apps

In the res/layout folder, add in the following statements to the activity_main.xml file:

<LinearLayout
xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentBottom=”true”
android:layout_alignParentLeft=”true”
android:layout_alignParentRight=”true”
android:layout_alignParentTop=”true”
android:orientation=”vertical” >

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”Latitude” />

<EditText
android:id=”@+id/txtLat”
android:layout_width=”320dp”
android:layout_height=”wrap_content”
android:ems=”10″
android:inputType=”numberDecimal”
android:text=”37.77493″ />

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”Longitude” />

<EditText
android:id=”@+id/txtLong”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:ems=”10″
android:inputType=”numberDecimal”
android:text=”-122.419416″ />

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”Get Weather”
android:onClick=”btnGetWeather” />

<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”Postal Code” />

<EditText
android:id=”@+id/txtPostalCode”
android:layout_width=”320dp”
android:layout_height=”wrap_content”
android:ems=”10″
android:inputType=”number”
android:text=”89118″ />

<Button
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:text=”Get Places”
android:onClick=”btnGetPlaces” />

</LinearLayout>
This will create the UI as shown in Figure 2. As you can see, there are actually two parts to the UI:

1. The first part allows the user to enter a pair of latitude and longitude information. Click on the Get Weather button and you will be able to get information about the weather information for that particular location.
2. The second part allows the user to enter a postal code. Clicking the Get Places button will search for all the towns and cities in the world with this postal code.

In both cases, the data would be retrieved from web services hosted by GeoNames Web Services (http://www.geonames.org/export/web-services.html).

consuming-json-services-in-android-apps
consuming-json-services-in-android-apps

Creating the Helper Method

To connect to a web service, your application needs to first of all connect to the server using HTTP. You need to also determine if you will be using HTTP GET or HTTP POST. Once that is determined, you will fetch the data from the server and get ready for the next step, which is parsing. For this article, the GeoNames Web Services that you will be using uses HTTP GET, and hence, you will first of all create the helper method readJSONFeed() in the MainActivity.java file:

package net.learn2develop.json;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

public class MainActivity extends Activity {

public String readJSONFeed(String URL) {
StringBuilder stringBuilder = new StringBuilder();
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(URL);
try {
HttpResponse response = httpClient.execute(httpGet);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == 200) {
HttpEntity entity = response.getEntity();
InputStream inputStream = entity.getContent();
BufferedReader reader = new BufferedReader(
new InputStreamReader(inputStream));
String line;
while ((line = reader.readLine()) != null) {
stringBuilder.append(line);
}
inputStream.close();
} else {
Log.d(“JSON”, “Failed to download file”);
}
} catch (Exception e) {
Log.d(“readJSONFeed”, e.getLocalizedMessage());
}
return stringBuilder.toString();
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

}
The readJSONFeed() method takes in a string representing the URL of the web service and then connects to the server using HTTP GET. You make use of the HttpClient class to connect to the server, the HttpGet class to specify the URL of the server, and the HttpResponse class to get the connection status from the server. Once the connection is established successfully, you all use the BufferedReader and InputStreamReader classes to download the result (which is a JSON string in this example) from the server. The readJSONFeed() method then returns the JSON string.

As you need Internet access for this project to work, remember to add the INTERNET permission in the AndroidManifest.xml file:

<manifest xmlns:android=”http://schemas.android.com/apk/res/android”
package=”net.learn2develop.json”
android:versionCode=”1″
android:versionName=”1.0″ >

<uses-sdk
android:minSdkVersion=”8″
android:targetSdkVersion=”15″ />
<uses-permission android:name=”android.permission.INTERNET”/>

<application
android:icon=”@drawable/ic_launcher”
android:label=”@string/app_name”
android:theme=”@style/AppTheme” >
<activity
android:name=”.MainActivity”
android:label=”@string/title_activity_main” >
<intent-filter>
<action android:name=”android.intent.action.MAIN” />

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

</manifest>

Getting Weather Information

Now that you can connect to the server to download the JSON result, it is now time to connect to the GeoNames Web Services to get weather information. In particular, to get the weather information of a particular location, you will use the following URL (replace the and with the actual latitude and longitude):

http://ws.geonames.org/findNearByWeatherJSON?lat=&lng=

A sample result from the server looks like this:

{
“weatherObservation”: {
“clouds”:”scattered clouds”,
“weatherCondition”:”n/a”,
“observation”:”KCFV 090852Z AUTO 06005KT
10SM SCT090 SCT110 24/20 A3000 RMK AO2
SLP148 T02390200 53002″,
“windDirection”:60,
“ICAO”:”KCFV”,
“seaLevelPressure”:1014.8,
“elevation”:225,
“countryCode”:”US”,
“lng”:-95.56666666666666,
“temperature”:”23.9″,
“dewPoint”:”20″,
“windSpeed”:”05″,
“humidity”:78,
“stationName”:”Coffeyville, Coffeyville
Municipal Airport”,
“datetime”:”2012-07-09 08:52:00″,
“lat”:37.083333333333336
}
}
If you observe, you have a primary key – weatherObservation. Its value is a collection of key/value pairs, such as clouds, weatherCondition, etc.

In order to use the readJSONFeed() method, you need to call it asynchronously as beginning with Android 3.0 you can no longer call network operations from within your UI thread (such as within an activity). The easiest way to do this is to wrap it using an AsyncTask class. Hence, add the following statements to the MainActivity class:

package net.learn2develop.json;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONObject;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

public class MainActivity extends Activity {

public String readJSONFeed(String URL) {
StringBuilder stringBuilder = new StringBuilder();
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(URL);
try {
HttpResponse response = httpClient.execute(httpGet);
StatusLine statusLine = response.getStatusLine();
int statusCode = statusLine.getStatusCode();
if (statusCode == 200) {
HttpEntity entity = response.getEntity();
InputStream inputStream = entity.getContent();
BufferedReader reader = new BufferedReader(
new InputStreamReader(inputStream));
String line;
while ((line = reader.readLine()) != null) {
stringBuilder.append(line);
}
inputStream.close();
} else {
Log.d(“JSON”, “Failed to download file”);
}
} catch (Exception e) {
Log.d(“readJSONFeed”, e.getLocalizedMessage());
}
return stringBuilder.toString();
}

private class ReadWeatherJSONFeedTask extends AsyncTask
<String, Void, String> {
protected String doInBackground(String… urls) {
return readJSONFeed(urls[0]);
}

protected void onPostExecute(String result) {
try {
JSONObject jsonObject = new JSONObject(result);
JSONObject weatherObservationItems =
new JSONObject(jsonObject.getString(“weatherObservation”));

Toast.makeText(getBaseContext(),
weatherObservationItems.getString(“clouds”) +
” – ” + weatherObservationItems.getString(“stationName”),
Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Log.d(“ReadWeatherJSONFeedTask”, e.getLocalizedMessage());
}
}
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
In the ReadWeatherJSONFeedTask class, you have two methods:

1. The doInBackGround() method is executed asynchronously. Here, you call the readJSONFeed() method to get the weather information. When the result is obtained, it is returned to the onPostExecute() method.
2. The onPostExecute() method takes the JSON result and parses it.
a. First, the JSON string is passed as the argument to the constructor of the JSONObject class. This creates a new JSONObject object (jsonObject) with key/value mappings from the JSON string.
b. You then get the value of the weatherObservation key by using the getString() method of jsonObject. The values are then passed as the constructor of the JSONObject class, creating another JSONObject – weatherObservationItems.
c. Finally, you extract the value of the clouds and stationName keys by calling the getString() method of weatherObservationItems.

To wire up the event handler for the Get Weather button in your UI, add the btnGetWeather() method to MainActivity.java:

package net.learn2develop.json;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONObject;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {

public String readJSONFeed(String URL) {

}

private class ReadWeatherJSONFeedTask extends AsyncTask
<String, Void, String> {

}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void btnGetWeather(View view) {
EditText txtLat = (EditText) findViewById(R.id.txtLat);
EditText txtLong = (EditText) findViewById(R.id.txtLong);

new ReadWeatherJSONFeedTask().execute(
“http://ws.geonames.org/findNearByWeatherJSON?lat=” +
txtLat.getEditableText().toString() + “&lng=” +
txtLong.getText().toString());
}

}
You can now test the application on an Android emulator. Figure 3 shows the result.

consuming-json-services-in-android-apps
consuming-json-services-in-android-apps

Getting Places using Postal Code

Now that you have managed to consume the first JSON service, let’s take a look at the second example. This time, you will consume a service that returns a list of city names using a given postal code. You can get the result from the following URL (replace the with the actual postal code):

http://api.geonames.org/postalCodeSearchJSON?postalcode=&maxRows=10&username=demo

A sample result from the server looks like this:

{
“postalCodes”: [
{
“adminCode3″:”3203”,
“adminName2″:”Wahlkreis St. Gallen”,
“adminName3″:”St. Gallen”,
“adminCode2″:”1721”,
“adminCode1″:”SG”,
“postalCode”:”9011″,
“countryCode”:”CH”,
“lng”:9.399858534040646,
“placeName”:”St. Gallen”,
“lat”:47.414775328611945,
“adminName1″:”Kanton St. Gallen”
},
{
“adminCode1″:”GS”,
“postalCode”:”9011″,
“countryCode”:”HU”,
“lng”:17.781944437499998,
“placeName”:”Gyor”,
“lat”:47.607638900000005,
“adminName1″:”Gyor-Moson-Sopron”
},
{
“adminName2″:”Tromsø”,
“adminCode2″:”1902”,
“adminCode1″:”19”,
“postalCode”:”9011″,
“countryCode”:”NO”,
“lng”:18.95508,
“placeName”:”Tromsø”,
“lat”:69.6489,
“adminName1″:”Troms”
},
{


}
]
}
If you observe, you have a primary key – postalCodes. Its value is an array of objects, with each object containing a collection of key/value pairs, such as adminCode1, lat, lng, etc.

Like the previous example, you will add a ReadPlacesFeedTask class to connect to the server asynchronously:

package net.learn2develop.json;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONArray;
import org.json.JSONObject;

import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {

public String readJSONFeed(String URL) {

}

private class ReadWeatherJSONFeedTask extends AsyncTask
<String, Void, String> {

}

private class ReadPlacesFeedTask extends AsyncTask
<String, Void, String> {
protected String doInBackground(String… urls) {
return readJSONFeed(urls[0]);
}

protected void onPostExecute(String result) {
try {
JSONObject jsonObject = new JSONObject(result);
JSONArray postalCodesItems = new
JSONArray(jsonObject.getString(“postalCodes”));

//—print out the content of the json feed—
for (int i = 0; i < postalCodesItems.length(); i++) {
JSONObject postalCodesItem =
postalCodesItems.getJSONObject(i);
Toast.makeText(getBaseContext(),
postalCodesItem.getString(“postalCode”) + ” – ” +
postalCodesItem.getString(“placeName”) + “, ” +
postalCodesItem.getString(“countryCode”),
Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
Log.d(“ReadPlacesFeedTask”, e.getLocalizedMessage());
}
}
}

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

public void btnGetWeather(View view) {

}
}
As in the previous example, the result is first converted into a JSONObject. The values of the postalCode key is then converted into a JSONArray object – postalCodesItems, which contains an array of JSONObject objects. You then iterate through the array and extracted each object and print out the values of the postalCode, placeName, and countryCode keys.

Finally, wire the event handler for the Get Places button with the btnGetPlaces() method in the MainActivity.java file:

public void btnGetWeather(View view) {

}

public void btnGetPlaces(View view) {
EditText txtPostalCode = (EditText) findViewById(R.id.txtPostalCode);
new ReadPlacesFeedTask().execute(
“http://api.geonames.org/postalCodeSearchJSON?postalcode=” +
txtPostalCode.getEditableText().toString() +
“&maxRows=10&username=demo”);
}
Figure 4 shows the sample result.

consuming-json-services-in-android-apps
consuming-json-services-in-android-apps

Summary

In this article, you have seen how to consume a JSON service from within your Android application. You have seen two examples on how to parse a JSON string using the JSONObject and JSONArray classes available in the org.json package.

Structured settlement

A structured settlement is a financial or insurance arrangement whereby a claimant agrees to resolve a personal injury tort claim by receiving periodic payments on an agreed schedule rather than as a lump sum. Structured settlements were first utilized in Canada after a settlement for children affected by Thalidomide. Structured settlements are widely used in product liability or injury cases (such as the birth defects from Thalidomide). A structured settlement can be implemented to reduce legal and other costs by avoiding trial. Structured settlement cases became more popular in the United States during the 1970s as an alternative to lump sum settlements. The increased popularity was due to several rulings by the IRS, an increase in personal injury awards, and higher interest rates. The IRS rulings changed policies such that if certain requirements were met then claimants could have federal income tax waived. Higher interest rates result in lower present values, hence annuity premiums, for deferred payments versus a lump sum.

Structured settlements have become part of the statutory tort law of several common law countries including Australia, Canada, England and the United States. Structured settlements may include income tax and spendthrift requirements as well as benefits and are considered to be an asset-backed security. Often the periodic payment will be created through the purchase of one or more annuities, which guarantee the future payments. Structured settlement payments are sometimes called periodic payments and when incorporated into a trial judgment is called a “periodic payment judgment.”

 

In the United States

The United States has enacted structured settlement laws and regulations at both the federal and state levels. Federal structured settlement laws include sections of the (federal) Internal Revenue Code. State structured settlement laws include structured settlement protection statutes and periodic payment of judgment statutes. Forty-seven of the states have structured settlement protection acts created using a model promulgated by the National Conference of Insurance Legislators (“NCOIL”). Of the 47 states, 37 are based in whole or in part on the NCOIL model act. Medicaid and Medicare laws and regulations affect structured settlements. To preserve a claimant’s Medicare and Medicaid benefits, structured settlement payments may be incorporated into “Medicare Set Aside Arrangements” “Special Needs Trusts.”

Structured settlements have been endorsed by many of the nation’s largest disability rights organizations, including the American Association of People with Disabilities and the National Organization on Disability.

Tips and Tricks for Developing PhoneGap Apps for Windows Phone 8

One of the biggest perceived advantages of developing a mobile app with PhoneGap is writing once and generating binaries that run natively on nearly every mobile platform. For those of us who have tried to simply migrate an iOS PhoneGap app to Android (or vice versa), we know that sometimes it’s easier said than done. And as the landscape continues to evolve, we are being confronted with what is becoming a relatively strong third option in the mobile realm – Microsoft’s Windows Phone 8. So how do we, as PhoneGap developers, write our apps from day one to make them easier to port to new platforms? What mistakes can we avoid before we write a single line of code? In this article I hope to outline some of the top tips and tricks to use whether you are porting an existing iOS or Android PhoneGap app to Windows Phone 8 or starting a new app from scratch.

Windows Phone? Really?

“Why should I care about Windows Phone 8?” I can hear the groans and complaints already! Yes, I realize it’s yet another platform to deal with. Yes, I realize it doesn’t use a WebKit-based rendering engine. Yes, I realize it’s Microsoft with their questionable track record on mobile. The numbers don’t lie though. As of the end of 2013, usage of Windows Phone 8 (WP8) is increasing everywhere with almost 4% of global market share and 10% of the European market. It’s also important to note that Microsoft is listening to developers and has made WP8 a legitimate mobile platform – including making Internet Explorer 10, with its standards compliant and performant engine, the default browser.

As of today, the battle for third place is essentially over, and Microsoft has a firm grip on the bronze medal. And for those of you who want to capture that last 4-10% of the smartphone market, it’s time to start listening!

Let’s first talk about how we initiate a WP8 PhoneGap project – whether it is by starting from scratch (using the PhoneGap CLI or Visual Studio) or by expanding an existing PhoneGap project.

Please note that you will need to download and install the Windows Phone 8 SDK before you can build a WP8 app locally.

If you are not on a Windows PC, Icenium will be adding full support for Windows Phone 8 in an upcoming release. You can also create a WP8 app using PhoneGap Build.

Getting Started with a New PhoneGap Project (Using the PhoneGap CLI)

The release of version 3.0 of PhoneGap brought with it a strong push to utilize the command line interface (CLI). The promise of the PhoneGap CLI brings with it the start of consistency of syntax and implementation across all PhoneGap platforms. It takes a little bit of initial configuration to get your CLI environment set up with Windows. Unfortunately the PhoneGap docs lag behind a little as far as Windows Phone 8 goes, but if you use the following instructions all will be well:

If you don’t have it already, download and install node.js.
Node will add some PATH variables, therefore if you have a command prompt open, you will need to restart it. Sorry.
Run the command npm install -g phonegap. There will be a lot of downloading and installing that happens next, Matrix-style.
Once the PhoneGap installation is complete, you’ll want to take a look at where everything was just installed. For me it is in: C:UsersrdlauerAppDataRoamingnpm
Run cd [path from previous step] to navigate inside of that directory. Finally, run the phonegap command by itself to verify that everything is working as it should.
Now I’m guessing you don’t want to have to remember that directory whenever you want to execute a phonegap command, so you should probably add the path to execute the command as a new PATH variable (if it’s not already in there):

Hold the Win key and press Pause (or right-click on My Computer and choose Properties).
Click on Advanced System Settings.
Click on Environment Variables….
Append (don’t replace!) ;C:UsersrdlauerAppDataRoamingnpm (using the appropriate path from Step 4 above) to the PATH variable.
Restart your command prompt.
That was the difficult part – and luckily you only have to do it once!

To actually create a new WP8 PhoneGap project, all you have to do is navigate to a new directory where you want to store your project and execute the following command:

phonegap create hello com.example.hello HelloWorld
This creates a new PhoneGap project with hello being the name of the directory, com.example.hello the optional app identifier, and HelloWorld the optional display name of your app.

Now, run the cd hello command to navigate inside of your newly created project to execute the next set of commands.

Gotcha: There is a minor issue that will surely be fixed in a future version of PhoneGap (I am on 3.3). Before you try to build your WP8 app, you’ll probably need to change the name of your .csproj file to match the display name of your app (if you’ve specified one). Navigate to the platformswp8 directory inside of your PhoneGap project.

In that directory, in my case, I had to change CordovaWP8AppProj.csproj to HelloWorld.csproj.

Now that we have that little workaround out of the way, we can build our WP8 app using the following command:

phonegap -V local build wp8
If all has gone correctly, at the bottom of your command prompt you should see the following message:

successfully compiled Windows Phone 8 app
Next up you’ll probably want to fire up the handy Windows Phone 8 emulator that came with your SDK installation:

phonegap run wp8
Again, if all has gone correctly, you should see the following in your emulator:

tips-and-tricks-for-developing-phonegap-apps-for-windows-phone-8
tips-and-tricks-for-developing-phonegap-apps-for-windows-phone-8

Great success!

Getting Started with a New PhoneGap Project (Using Visual Studio)

Now what if you are a hardcore Visual Studio user and don’t necessarily take to these fancy-pants command line tools? There is nothing wrong with that at all and luckily for you it’s pretty darn easy to get started using only Visual Studio. The Cordova distribution actually comes with Visual Studio project templates, so if that is your cup of tea, you can start a new project within Visual Studio and choose a Windows Phone 8 Cordova template.

And yes, I did say “Cordova”. For the purposes of this article, you can consider “PhoneGap” and “Cordova” one and the same. If you would like to know more about the difference, I suggest you read this post on “Demystifying Apache Cordova and PhoneGap”.

Disclaimer: I have only tested the following method with Visual Studio 2012 and 2013. If you are using an older version of Visual Studio your mileage may vary!

The first thing we are going to do is download the full Cordova distribution. Got the zip archive? Great. Go ahead and unzip that beast.

Within this archive, there are a series of individual archives for each supported platform. You are going to want the cordova-wp8.zip archive, as that is what contains our Visual Studio templates for Windows Phone. Extract that archive and discard the rest.

Now within this archive, you will find a batch file with the name of createTemplates.bat. Go ahead and double-click to execute this batch process. This will, no surprise, create your Visual Studio templates. If you ran it, you should now see two new archives: CordovaWP7_3_3_0.zip and CordovaWP8_3_3_0.zip (depending on the version of Cordova that you downloaded of course).

These are our Visual Studio templates! Depending on whether you expect to do either Windows Phone 7 or 8 development, you’ll want to put one or both of those templates into your Visual Studio template folder. Mine was located here:

C:UsersrdlauerDocumentsVisual Studio 2013TemplatesProjectTemplates
That’s it! Start (or restart) Visual Studio, go to File -> New Project, and under the Visual C# tab, you should be presented with the following template option:

tips-and-tricks-for-developing-phonegap-apps-for-windows-phone-8
tips-and-tricks-for-developing-phonegap-apps-for-windows-phone-8

Enter a name for your project and you are ready to begin!

Once inside Visual Studio, you can use the Run menu option to test your app inside of the Windows Phone emulator. You should see the exact same result as if you had run it from the CLI (see emulator image above).

Getting Started with an Existing PhoneGap Project

If you’ve been a hybrid mobile developer for long and have already set up a PhoneGap 3.0+ project, you’ll surely appreciate the simplicity of running the following command inside of your existing project to add a new platform:

phonegap platform add wp8
Note that you still need to download and install the Windows Phone 8 SDK for this method as well.

Likewise to build and run your newly-added platform in the emulator, you’ll want to run:

phonegap build wp8
…and then use the run command to view your output in the Windows Phone 8 emulator:

phonegap run wp8
The beauty of this method is that you can share your web assets across multiple platforms. One PhoneGap project can hold all of the HTML, JavaScript, and CSS assets for all of your platforms, making it much easier to make updates to each supported platform.

But, Now What?

We have created a new PhoneGap project, either by using the CLI or Visual Studio. But now what do we do with it? This is where the beauty of the PhoneGap platform excels. Create your mobile application using HTML, JavaScript, and CSS. Use any JavaScript framework you like, or roll your own. The amazing thing is that you can create a performant mobile app using the skills and technologies you’ve already spent years honing as a web developer!

If you want a boost, might I suggest a few places to get started?

Kendo UI Mobile is a great JavaScript framework that provides out of the box support for a variety of mobile operating systems (including Windows Phone 8). The latest version includes a flat UI as well if you want to provide a consistent look across platforms. Kendo UI Mobile is also very much focused on performance (and is based on jQuery which makes it easy to get started).
jQuery Mobile is another wildly popular mobile JavaScript framework. While it doesn’t provide a native look or feel, it is free and has a strong community backing.
ChocolateChip-UI is a mobile framework that has been gaining momentum lately. Slightly risky in that it is a relatively untested option, it is a framework that may be worth looking into if you want a free and performant alternative.

The Part Where You Say, “There Had to Be a Catch”

If you are a seasoned PhoneGap developer, you probably know that moving from the WebKit-based web view of iOS and Android to the IE10-based web view of Windows Phone 8 could not be as simple as copying your web assets over. While IE10 is an amazing improvement, it still lags behind in some areas of HTML5 support, and the mobile offering does sacrifice a certain amount of functionality for performance.

What I’m including here are some of the biggest “gotchas” that iOS/Android PhoneGap developers will probably encounter when migrating an app to Windows Phone 8 (also useful if you’re starting a WP8 project from scratch).

Custom Fonts

Due to a limitation (whether it was purposeful or not) you are unable to include a font file with your app and reference it for use via CSS. This of course applies to font-based icon providers, such as the popular Font Awesome. 🙁

The workaround is to fallback on your standard web fonts (such as Verdana, Arial, Helvetica, etc) and to use image sprites for your icons. There are also hacky solutions available but your mileage may vary!

Remove the -webkit Prefix

This should be an obvious one, but if you are migrating an existing app and use the -webkit prefix in your CSS, those rules will not be applied to your WP8 app. The good news is that since IE10 is a much more standards-compliant browser, you can most likely ditch that prefix altogether.

Device Pixel Ratio

WebKit introduced the “device pixel ratio” to help developers detect the resolution of the device in use. Developers have been using window.devicePixelRatio to help set the size of the viewport and to determine what resolution of images to display in the app. WebKit also utilizes the device pixel ratio to set the correct page size when the viewport width is set to device-width (which helps to set the width on both high density and normal devices in order for the page to look the same on both devices).

The sad truth is that device pixel ratio isn’t supported at all in IE10 on Windows Phone 8. Fortunately we can get a close approximation by using the screen.width and a simple calculation:

screen.width / 320 = 1.5 (our approximate device pixel ratio!)
For example, the Lumia 920 with a 768 x 1280 4.5” screen provides us with:

screen.width / 320 = 2.4
Once we calculate this ratio, what can we do with it? We simply use relative font sizes. Since IE10 supports the em and rem units, these are what we will use to specify our font sizes. Go ahead and set the font-size of the document element to the ratio in em, then base all of the sizes in your application to em or rem units and they will re-size accordingly. For example:

html { font-size: 1.5em; } /* example for simulated device pixel ratio of 1.5 */
Special thanks to Burke Holland and Kamen Bundev for their help with investigating these mobile IE10 issues.

The Word from Microsoft

One of the most useful posts from the Windows Phone blog (at least for a PhoneGap developer like myself) is an article on Adapting your WebKit-optimized site for Internet Explorer 10. There are all kinds of tips and tricks included in this post like:

CSS prefix changes (similar to what we already covered)
Touch and Pointer events
Handling non-standard behaviors like IE link highlighting and disabling some native styling
Read through that post as well and you’ll be well on your way to developing an app that rolls from one platform to the next with fewer inconsistencies.

Conclusion

Hopefully this post has brought to light how easy it can be to add that third platform to your PhoneGap app. By exploring the Windows Phone 8 platform you are not only broadening the reach of your app, but you are also helping to legitimize PhoneGap itself by showing off one of the primary reasons it exists – true cross-platform mobile app development.

Using Background Fetch in iOS

In iOS, except for some special cases, an application is not allowed to run in the background. While certainly a serious restriction for some types of application, this feature is designed to conserve battery power. Imagine apps continuing to run in the background without reins, and it is easy to see how the entire system might slow down and deplete the battery within a few hours.

Apple takes a measured approach to background processing. In the early days of the iPhone, after complaints from developers about the inability to run apps in the background, Apple introduced the Apple Push Notification service (APNS). APNs allows apps which are not already running to receive background push notifications, thereby allowing apps to be notified when some important events need their attention.

In iOS 7, Apple has introduced another feature to allow apps to run (more or less) in the background – Background Fetch. Background Fetch allows your app to continuously fetch data from the network when it is in the background. As an example, consider the Facebook app. When the Facebook app is in the background, it can continually fetch the latest news feed so that when the user switches the app to the foreground, the latest news feed is already ready for viewing.

In this article we’ll take a look to see how background fetch can be used to connect to a Web service, the Open Weather Map API, so that your app can continue to update itself in the background.

Background Fetch Frequency

How frequent your application can perform a background fetch is determined by the system. It depends on factors such as:

Whether network connectivity is available at that particular time
Whether the device is awake
How much data and time your application has taken in its previous attempt to perform a background fetch
In other words, your application is entirely at the mercy of the system to schedule background fetch for you. In addition, each time your application uses background fetch, it has at most 30 seconds to complete the process.

Implementing Background Fetch

Let’s now see how Background Fetch works. First, using Xcode, create a Single View application and name it as shown in Figure 1.

using-background-fetch-in-ios
using-background-fetch-in-ios

Once the project is created, select the project name and click on the Capabilities tab on the right (see Figure 2). Turn on the Background Modes capability and expand it. Check the Background fetch item.

using-background-fetch-in-ios
using-background-fetch-in-ios

In the BGAppRefreshAppDelegate.m file, add in the following statements:

#import “BGAppRefreshAppDelegate.h”

@implementation BGAppRefreshAppDelegate

-(void) application:(UIApplication *)application
performFetchWithCompletionHandler:
(void (^)(UIBackgroundFetchResult))completionHandler {

NSLog(@”Background fetch started…”);

//—do background fetch here—
// You have up to 30 seconds to perform the fetch

BOOL downloadSuccessful = YES;

if (downloadSuccessful) {
//—set the flag that data is successfully downloaded—
completionHandler(UIBackgroundFetchResultNewData);
} else {
//—set the flag that download is not successful—
completionHandler(UIBackgroundFetchResultFailed);
}

NSLog(@”Background fetch completed…”);
}

– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[UIApplication sharedApplication]
setMinimumBackgroundFetchInterval:
UIApplicationBackgroundFetchIntervalMinimum];

// Override point for customization after application launch.
return YES;
}
In the application:didFinishLaunchingWithOptions: method, you indicate to the system that your app wishes to perform background fetch by calling the setMinimumBackgroundFetchInterval: method of the UIApplication object. This method takes in a double value indicating the minimum number of seconds to wait between background fetches. This value that you specify is only indicative and have no real effects on the scheduling frequency (remember, the system determines that for your application). You set this using the UIApplicationBackgroundFetchIntervalMinimum constant, which is the shortest fetch interval supported by the system. If you want to stop background fetch, use the UIApplicationBackgroundFetchIntervalNever constant.

You also implemented the application:performFetchWithCompletionHandler: method, which is called whenever your app performs a background fetch. At this moment, the method is not doing anything useful, and we will see in the next section how to perform a network connection. For now, you need to know that you have up to 30 seconds to perform your background fetch operation, and that you need to call the completionHandler block as soon as your application has finished downloading data. Doing so allows the system to collect usage statistics such as data cost and power consumption, and all these data are used to give your app some opportunity to perform background fetch in the future.

To test if background fetch really works, you need some help from Xcode. First, deploy the application onto the iPhone Simulator. Because you don’t really know when the system will schedule your app for background fetch, you need to select the Debug > Simulate Background Fetch menu item in Xcode (see Figure 3). Your application on the iPhone Simulator will now go into the background.

using-background-fetch-in-ios
using-background-fetch-in-ios

Once you have used Xcode to simulate a background fetch for your app, look at the Output window (press Cmd-Shift-C if you don’t see it). You should see the printout as shown in Figure 4. The two statements printed confirm that the background fetch method has been called.

Performing a Network Operation

Let’s now learn how to perform a network operation during a background fetch. For this example, you shall connect to a Web service that returns the weather information for a specific location. The weather Web service that will be used is the OpenWeatherMap API. Once the weather information is obtained, you shall display it in the main View Controller of the application.

First, add a Label view to the View window in the Main.Storyboard file (see Figure 5). Make sure that it can display multiple lines (at least 3).

using-background-fetch-in-ios
using-background-fetch-in-ios

Create an outlet for the Label view and name it as lblStatus in the BGAppRefreshViewController.h file:

#import <UIKit/UIKit.h>

@interface BGAppRefreshViewController : UIViewController

@property (weak, nonatomic) IBOutlet UILabel *lblStatus;

@end
Add the following statements to the BGAppRefreshAppDelegate.m file:

#import “BGAppRefreshAppDelegate.h”
#import “BGAppRefreshViewController.h”

@interface BGAppRefreshAppDelegate ()

@property (nonatomic, strong) NSString *temperature;

@end

@implementation BGAppRefreshAppDelegate

-(void) application:(UIApplication *)application
performFetchWithCompletionHandler:
(void (^)(UIBackgroundFetchResult))completionHandler {

//—do background fetch here—
// You have up to 30 seconds to perform the fetch

/*
BOOL downloadSuccessful = YES;

if (downloadSuccessful) {
//—set the flag that data is successfully downloaded—
completionHandler(UIBackgroundFetchResultNewData);
} else {
//—set the flag that download is not successful—
completionHandler(UIBackgroundFetchResultFailed);
}
*/

NSLog(@”Background fetch started…”);
NSString *urlString = [NSString stringWithFormat:
@”http://api.openweathermap.org/data/2.5/weather?q=%@”,
@”Singapore”];

NSURLSession *session = [NSURLSession sharedSession];
[[session dataTaskWithURL:[NSURL URLWithString:urlString]
completionHandler:^(NSData *data,
NSURLResponse *response,
NSError *error) {
NSHTTPURLResponse *httpResp = (NSHTTPURLResponse*) response;
if (!error && httpResp.statusCode == 200) {
//—print out the result obtained—
NSString *result =
[[NSString alloc] initWithBytes:[data bytes]
length:[data length]
encoding:NSUTF8StringEncoding];
NSLog(@”%@”, result);

//—parse the JSON result—
[self parseJSONData:data];

//—update the UIViewController—
BGAppRefreshViewController *vc =
(BGAppRefreshViewController *)
[[[UIApplication sharedApplication] keyWindow]
rootViewController];
dispatch_sync(dispatch_get_main_queue(), ^{
vc.lblStatus.text = self.temperature;
});

completionHandler(UIBackgroundFetchResultNewData);
NSLog(@”Background fetch completed…”);
} else {
NSLog(@”%@”, error.description);
completionHandler(UIBackgroundFetchResultFailed);
NSLog(@”Background fetch Failed…”);
}
}
] resume
];
}

– (void)parseJSONData:(NSData *)data {
NSError *error;
NSDictionary *parsedJSONData =
[NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&error];
NSDictionary *main = [parsedJSONData objectForKey:@”main”];

//—temperature in Kelvin—
NSString *temp = [main valueForKey:@”temp”];

//—convert temperature to Celcius—
float temperature = [temp floatValue] – 273;

//—get current time—
NSDate *date = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@”HH:mm:ss”];

NSString *timeString = [formatter stringFromDate:date];

self.temperature = [NSString stringWithFormat:
@”%f degrees Celsius, fetched at %@”,
temperature, timeString];
}
The temperature property is used to store the temperature returned by the Web service.

Note that we specify Web service API that we are using is http://api.openweathermap.org/data/2.5/weather?q=Singapore, and this specifies Singapore as the geographical area that we are interested in. You can copy this URL into your browser to see first-hand what the API’s JSON response looks like. You can also change the location by specifying q=city,country in the URL.

To connect to the Web service, you will use the new NSURLSession class introduced in iOS 7 (I will have a more detailed discussion of this in another article) to asynchronously connect to the Web service. When the Web service returns the data, you will then call the parseJSONData: method to extract the temperature readings from the JSON string and then save it using the application preferences. A sample JSON data looks like this:

{
“coord” : {
“lon”:-0.13,
“lat”:51.51
},
“sys” : {
“message”:0.0069,
“country”:”GB”,
“sunrise”:1384413482,
“sunset”:1384445522
},
“weather”:[
{
“id”:802,
“main”:”Clouds”,
“description”:”scattered clouds”,
“icon”:”03d”
}
],
“base”:”gdps stations”,
“main” : {
“temp”:282.57,
“pressure”:1022,
“humidity”:61,
“temp_min”:282.15,
“temp_max”:283.15
},
“wind” : {
“speed”:7.7,
“deg”:310
},
“rain” : {
“3h”:0
},
“clouds” : {
“all”:40
},
“dt”:1384429800,
“id”:2643743,
“name”:”London”,
“cod”:200
}
When the Web service has returned the data, you will get a reference to the main View Controller in your application and update the Label view to display the weather information that you have obtained:

//—update the UIViewController—
BGAppRefreshViewController *vc =
(BGAppRefreshViewController *)
[[[UIApplication sharedApplication] keyWindow]
rootViewController];
dispatch_sync(dispatch_get_main_queue(), ^{
vc.lblStatus.text = self.temperature;
});

completionHandler(UIBackgroundFetchResultNewData);
NSLog(@”Background fetch completed…”);
You call the completionHandler block with the UIBackgroundFetchResultNewData constant to inform the system that you have fetched new data. One side effect of this is that the system will take a snap shot of the UI of your application so that when the user switches back to your application your updated UI is displayed immediately. Interestingly, your UI will be updated even though it is invisible and in the background.

The system will save the snapshot in the Library/Caches/Snapshots/<application_name>/Main/ folder of the application sandbox. On the Simulator, you can verify this by going to the folder:

“~/Library/Application Support/iPhone Simulator/<iOS_version_no>/Applications/<application_sandbox>/Library/Caches/Snapshots/<application_name>/Main/”
You will find a captured snapshot of your application in this folder.

To test the application, run the application on the iPhone Simulator. When the app is first launched, you will see an empty Label view as shown in Figure 6.

using-background-fetch-in-ios
using-background-fetch-in-ios

Back in Xcode, select the Debug > Simulate Background Fetch menu item to simulate a background fetch for the application. The output window should display something like this:

2014-01-18 21:22:52.861 BGAppRefresh[60167:70b] Background fetch started…
2014-01-18 21:22:53.498 BGAppRefresh[60167:2a0f] {“coord”:{“lon”:103.85,”lat”:1.29},”sys”:{“message”:0.097,”country”:”SG”,
“sunrise”:1390000400,”sunset”:1390043807},”weather”:[{“id”:803,”main”:
“Clouds”,”description”:”broken clouds”,”icon”:”04n”}],”base”:
“cmc stations”,”main”:{“temp”:299.696,”temp_min”:299.696,”temp_max”:299.696,
“pressure”:1025.97,”sea_level”:1026.44,”grnd_level”:1025.97,
“humidity”:100},”wind”:{“speed”:8.58,”deg”:20.5002},”clouds”:{“all”:76},
“dt”:1390051107,”id”:1880252,”name”:”Singapore”,”cod”:200}
2014-01-18 21:22:53.503 BGAppRefresh[60167:2a0f] Background fetch completed…
If you double-click on the Home button on the iPhone Simulator to reveal the multitasking bar, you should now see that the UI has been updated (see Figure 7), proving that the system has taken the snapshot of your application.

using-background-fetch-in-ios
using-background-fetch-in-ios

When you switch back to your application, you will see the weather information that you have obtained during the background fetch (see Figure 8).

using-background-fetch-in-ios
using-background-fetch-in-ios

Summary

In this article, you have seen the use of the Background Fetch feature that is new in iOS 7. Using this feature, you can schedule regular updates of your application even if your application is in the background. Remember that the system controls the frequency of your background fetch, and that you should always call the completionHandler block after you are done performing the download (regardless of whether you have managed to download new data or not) so that you can be a good citizen on the device.

How to Fix Google+ hfeed or hCard Warnings

I have successfully implemented Google+ Authorship on this website last week. My photo finally showed on SERPs not until this morning. So, i checked Google Structured Data Testing Tool and it turns out that the tool is unable to extract information Google+ needed from my webpage and it showed the following error/warnings:

Warning: At least one field must be set for HatomEntry
Warning: Missing required field “entry-title”.
Warning: Missing required field “updated”.
Warning: Missing required hCard “author”.
Warning: At least one field must be set for Hcard.
Warning: Missing required field “name (fn)”.
Before i tweak my single.php file (again) i posted a question about this issue in one of the Google+ Authorship Community that i am in and according to Rand Wilson “Those errors refer to Hcard structured data and do not affect Authorship. Unless you use hcard data, I think you can ignore these errors.”

In my opinion, in order for your site to be able to be crawled properly by Google, all data and information they require should be provided. Rand Wilson might be correct but i won’t take any chances. And besides, that is what the Google Structured Data Testing Tool is for yes? to find and fix errors and warnings.

You need to tweak your WordPress theme’s single.php file. On your WordPress dashboard, go to Appearance > Editor > Single.php

Fix Missing required field “entry-title”

Your title code should have the “entry-title” class. Normally yow would see

<h1 class=”title single-title”><?php the_title(); ?></h1>

you cannot remove or replace the “title single-title” attribute. Removing it would break your single.php page title’s CSS. What you can do is add the word “entry-title” and your code should look like

<h1 class=”title single-title entry-title”><?php the_title(); ?></h1>

Fix Missing required field “updated”

look for the code below on your WordPress theme’s single.php file.

<span class=”post_date”><?php the_time(‘j F,Y’); ?></span>

then add “date updated” attribute to it. Your code should look like

<span class=”post_date date updated”><?php the_time(‘j F,Y’); ?></span>

Fix Warning: Missing required hCard “author” and Missing required field “name (fn)”

This will fix these 2 warnings. On your WordPress theme’s single.php file, look for

<span class=”theauthor”><?php the_author_posts_link(); ?></span>

or

<span class=”theauthor”><?php the_author(); ?></span>

replace it with

<span class=”vcard author”>

<span class=”fn”><?php the_author_posts_link(); ?></span>

</span>

or

<span class=”vcard author”>

<span class=”fn”><?php the_author(); ?></span>

</span>

Here’s how your extracted structure data should look like :

how-to-fix-google-hfeed-or-hcard-warnings
how-to-fix-google-hfeed-or-hcard-warnings

Not all WordPress themes have the same template hierarchy. In most cases, If a theme has no “single.php” file, then WordPress uses the “index.php” file to display the single entry material. Trust me, those lines are not missing. They’re all there somewhere. They can be all in 1 file or scattered. This article will help explain the hierarchy of template pages: http://codex.wordpress.org/Template_Hierarchy

Structured Settlements

If you currently receive monthly payments from a legal settlement, litigation, or job related accident, you may be eligible to use a structured settlement company to receive a lump sum of cash right now. These companies essentially pay you a large amount of money for the rights to your future monthly payments. The terms of the structured settlement amount require court approval and should be understood thoroughly before a settlement is executed.
A structured settlement company is responsible for creating the agreement, obtaining court approval, and establishing a relationship with the payer. A quality structured settlement company that is well experienced will help get you through the process quickly and with the highest payout.
However, not all structured settlement companies are able to deliver as promised. When choosing a structured settlement company you should consider several factors first:
Company Strength. How long has the structured settlement company been in business? What is the Better Business Bureau rating for that company?
Customer Service. Since you’ll be working with them closely, how helpful is the structured settlement company? Are they responsive, courteous and well-informed?
Website functionality. When you’re entering into a structured settlement buyout, you’ll want a company that provides an informative, professional website to assist you through the process.
Awecars.net has reviewed and ranked the best structured settlement companies available today. We hope these reviews help you find the best structured settlement program that meets your needs!

In the United States

The United States has enacted structured settlement laws and regulations at both the federal and state levels. Federal structured settlement laws include sections of the (federal) Internal Revenue Code. State structured settlement laws include structured settlement protection statutes and periodic payment of judgment statutes. Forty-seven of the states have structured settlement protection acts created using a model promulgated by the National Conference of Insurance Legislators (“NCOIL”). Of the 47 states, 37 are based in whole or in part on the NCOIL model act. Medicaid and Medicare laws and regulations affect structured settlements. To preserve a claimant’s Medicare and Medicaid benefits, structured settlement payments may be incorporated into “Medicare Set Aside Arrangements” “Special Needs Trusts.”

Structured settlements have been endorsed by many of the nation’s largest disability rights organizations, including the American Association of People with Disabilities  and the National Organization on Disability.

– structured settlement quote
– selling structured settlements
– cash for structured settlement
– how to sell annuities
– cash out annuity
– structured settlement quotes
– best structured settlement companies
– structural settlement
– structured settlement sales
– structured settlement buyouts
– selling annuity payments
– i have a structured settlement
– sell my structured settlement
– structured settlement lump sum
– buying structured settlements
– how to get a structured settlement
– cash for structured settlements
– annuity cash out
– selling a structured settlement annuity
– sell my structured settlement payment
– sell structured settlement
– structured settlement buyout
– cash for annuity payments
– selling structured settlement payments
– structured settlement annuity
– selling annuities
– structured settlement companies
– sell annuity settlement
– structured settlement cash out
– structured settlement brokers
– sell settlement
– structured settlement payment
– structured settlement
– sell your structured settlement
– buy structured settlement
– structure settlements
– sell annuity
– annuity buyers

Exynos ModAP is Samsung’s first chip with on-die LTE integration

Just yesterday Samsung’s Exynos division teased that it had something “exciting” in store for us. While we hoped this meant we’d see the official unveiling of the Note 4’s rumored Exynos 5433 CPU, it turns out that the company has instead outed a new quad-core SoC with integrated LTE.

Dubbed ModAP, the SoC is the first from the company to offer on-die LTE integration, and is built on a 28nm HKMG process. The ModAP offers Cat-4 LTE and a built-in image signal provider capable of supporting an 8MP sensor with 1080p video recording at 30fps.

While it’s obvious based on the specs that the ModAP is might more for budget and mid-range devices than flagships like the upcoming Note 4, on-die LTE integration is still a noteworthy accomplishment for Samsung and could help put it on a more even playing field with Qualcomm in the future.

OnePlus Two tipped by @evleaks, codename is… Lettuce?

After a recent @evleaks tip involving a “OnePlus One Tab” was later revealed to be nothing more than a hoax, we’re sure many of you are going to take this latest leak with an extra helping of salt. We know some of you are still eagerly awaiting your chance to pick up this year’s OnePlus One, but it appears the Chinese startup is already planning for its sequel.

It’s not much to go on, but @evleaks revealed an alleged codename for the upcoming OnePlus Two: Lettuce. According to @evleaks, the first was going by the codename Bacon and while we don’t have any information regarding specs or anything of that sort, we’re struggling to find ways OnePlus can upgrade the already stellar “flagship killer.”

Be that as it may, smartphones launches take many months of planning so it really shouldn’t come as much of a surprise that OnePlus could already be working on a sequel. It just seems odd given the current shape the OnePlus One is facing in terms of availability.

[Source: Phandroid]

10 Tips for the Best Sleep Ever

Experts say many people unknowingly establish “bad sleep habits” as part of their daily routine…and some of these practices could be keeping sleep away. A lot of things can come between you and a good night’s sleep. You can, however, start establishing better habits so you can consistently get quality sleep.

1. Find your sleep number

First, figure out how many hours of sleep a night will make you feel rested in the morning. You know you’re getting enough sleep if you don’t feel sleepy during the day. Most adults need about 7 to 8 hours of sleep each night.

2. Don’t try to make it up

If you aren’t getting enough sleep, you can’t “make it up” by sleeping late on the weekends, for instance. Once it’s gone, it’s gone. Sleeping longer on certain nights or frequent napping will only inhibit your ability to get a good night’s rest the following night. By trying to make up sleep, you are sabotaging your chances of consistently getting a good night’s sleep.

3. Get on a schedule…and stick to it

Staying up later on the weekends is equally as damaging as trying to make up sleep on the weekends. Our bodies need a schedule…a consistent routine. Try to go to bed and get up at about the same time every day, allowing for the amount of rest you calculated, even on weekends. If your bedtime is 10 p.m. during the week, stick to that same time on the weekends.

4. Get your parent on a schedule…and stick to it

Just like your body needs a routine, so does your elderly parent’s. Set a schedule that you can stay close to every day. We set a routine and schedule for our kids as they were growing up, so try to do the same for elders. For kids and elders, a routine is comforting, predictable and encourages feelings of safety and relaxation. Make breakfast at about the same time every day. Schedule dinner, bath time, a relaxing pre-bed activity and bedtime for the same time every day.

5. Don’t misuse your bed

Use your bed for two purposes only: sleep and sex. If you continually use the bed for activities that are not conducive to sleep, like reading, watching television or eating, you may be tempted to pick up a book or reach for the remote when you should be settling down for sleep.

6. Turn off your mind

Worrying and constant stress are often the culprit of a sleepless night. Sometimes, your thoughts race and it seems impossible to “turn off your mind” long enough to fall asleep. Relaxation techniques, practiced on a regular basis, can help. Get in the habit of relaxing before you head to bed. Some techniques to try: a hot bath, gentle music, meditation or prayer.

7. Create a comfortable environment

Being comfortable is a key to good sleep. Light, interruptions and sound can interfere with slumber. Keep your bedroom dark during sleeping hours (room darkening curtains work wonder.) Reduce noise levels as much as possible. If traffic or noisy neighbors are a problem, to cancel out distracting and jarring sounds, try a bedtime alarm that has “white noise’ settings: waves, rain, bird sounds or whatever background noise you find soothing. Sound Machines allow you to ease into sleep with white noise. Keep your room at a temperature that’s not too hot, and not too cold. Get a comfortable mattress and bedding. (Soundproofing for a Better Night’s Sleep)

8. Avoid caffeine

Coffee, soft drinks, tea and anything with caffeine should be avoided from the late afternoon on through bedtime. Caffeine may be a great energy booster for you during the day, but in the evening, it can keep you awake or make your sleep restless.

9. Cut out alcohol and nicotine

A glass of wine may make you sleepy and help you get to sleep faster, but alcohol often wakes you up after a only a couple of hours of sleep. The same goes for smoking. Though smokers often feel like it calms them down, nicotine is a stimulant.

10. Don’t eat or drink before bedtime

Our bodies use drinks and food as sources of energy, so consuming them when you should be winding down for the night can interrupt sleep. In particular, spicy foods, tomato products and high-sugar snacks are known to cause sleep problems.