What is Unterminated quoted string?

by sasan_f2...@fouladirad.com » Tue, 08 Mar 2011 05:41:19 GMT


Sponsored Links
 his is my simple code for an app that I'm making but when I try to
run it with the emulator this error shows up:

ActivityManager: am: 1: Syntax error: Unterminated quoted string


my code:
package com.android.SoccerAndroidProject;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;


public class MainActivity extends Activity implements OnClickListener
{
private static final String TAG = "Game";

//creating the names of the parts
Button onepointButton,twopointsButton,
threepointsButton,resetButton,
onepointButton2, twopointsButton2, threepointsButton2;

EditText homeButton,awayButton;

TextView textScoreHome,textScoreAway,textScoreBetween;
int score1 = 0;
int score2 = 0;

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

Log.d(TAG, "onCreate started");

// I now have all my UI in the Java memory
onepointButton = (Button)findViewById(R.id.onepointButton);
onepointButton2 = (Button)findViewById(R.id.onepointButton2);
twopointsButton = (Button)findViewById(R.id.twopointsButton);
twopointsButton2 = (Button)findViewById(R.id.twopointsButton2);
threepointsButton = (Button)findViewById(R.id.threepointsButton);
threepointsButton2 = (Button)findViewById(R.id.threepointsButton2);
resetButton = (Button)findViewById(R.id.resetButton);

homeButton = (EditText)findViewById(R.id.homeButton);
awayButton = (EditText)findViewById(R.id.awayButton);

textScoreHome = (TextView)findViewById(R.id.textScoreHome);
textScoreAway = (TextView)findViewById(R.id.textScoreAway);
textScoreBetween = (TextView)findViewById(R.id.textScoreBetween);

// Initialize text views
textScoreHome.setText(String.valueOf(score1));

textScoreAway.setText(String.valueOf(score2));

textScoreBetween.setText("");

// Define button listeners
resetButton.setOnClickListener(this);
onepointButton.setOnClickListener(this);
onepointButton2.setOnClickListener(this);
twopointsButton.setOnClickListener(this);
twopointsButton2.setOnClickListener(this);
threepointsButton.setOnClickListener(this);
threepointsButton2.setOnClickListener(this);

Log.d(TAG, "onCreate done");

}

public void onClick(View src) {
switch(src.getId()) {
case R.id.resetButton:
score1=0;
score2=0;
textScoreHome.setText(String.valueOf(score1));
textScoreAway.setText(String.valueOf(score2));
break;
case R.id.onepointButton:
score1++;
textScoreHome.setText(String.valueOf(score1));
break;
case R.id.onepointButton2:
score2++;
textScoreAway.setText(String.valueOf(score2));



Re: What is Unterminated quoted string?

by Daniel Mack » Fri, 20 May 2011 09:30:37 GMT


 Hey,

On 4 Mrz., 02:14, "sasan_f2...@fouladirad.com"



I'm facing exactly the same problem under OS X 10.6, using Eclipse and
the Android SDK for 2.3.3 (version 10).

Did you find any solution for this issue yet? It seems to be entirely
unrelated to the actual code, though. Everything is freshly installed
and up-to-date.


Daniel

-- 


Sponsored Links


Other Threads

1. Change Text in Text View

I'm trying to change the text in the text view section of a custom
layout.
I Just get a null pointer exception for some reason. Here is my code:

package com.example.easychef;

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


public class Infomation extends Activity {
    /** Called when the activity is first created.
     * @param database */
        private TextView mInfo;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //String []recipe=getIntent().getExtras().getStringArray
("db");
        Log.i("EasyChef","Info: Ito info");
        setContentView(R.layout.layout_i);
       mInfo = ((TextView) findViewById(R.string.infomation));
        try{
        mInfo.setText("12345");
        }
        catch (Exception e)
        {Log.e("EasyChef","error2: ",e);}
    }
}

The error is in the catch there and is given as
java.lang.NullPointerException

This is my Layout file

<?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" android:gravity="right">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:layout_weight="1">

        <TextView
            android:gravity="center_horizontal"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="1" android:textScaleX="1"
android:text="@string/infomation"/>
    </LinearLayout>

    <LinearLayout
        android:orientation="vertical"
        android:layout_height="fill_parent"
        android:layout_width="wrap_content"
android:layout_weight="9">
    <Button android:id="@+id/Button01"
android:layout_height="wrap_content"
android:layout_width="fill_parent" android:text="Prepare"></Button>
</LinearLayout>

</LinearLayout>

Any help would be great
Thank you

--~--~---------~--~----~------------~-------~--~----~

2. IP subnet mask

We've got a problem to open a TCP connection between 2 android phones
using GPRS network.
After a deep troubleshooting we found out that due to subnet mask /30
any user won't be able to communicate with a user who has an IP that
correspond to his broadcast IP.
let me explain by this following sample:

user A got IP@ 10.200.46.2 from GGSN
user B got IP@ 10.200.46.3 from GGSN

The android phone set a subnet mask 10.200.46.0/30 for both of them
which means
Network   10.200.46.0
host         10.200.46.1
host         10.200.46.2
broadcast 10.200.46.3

Routing stack info on the phone:
10.200.46.0/30 dev rmnet0  src 10.200.46.2
default via 10.200.46.1 dev rmnet0
 rmnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
qlen 1000
    link/ether b6:dc:ae:0e:f4:90 brd ff:ff:ff:ff:ff:ff
    inet 10.200.46.2/30 brd 10.200.46.3 scope global rmnet0

since user A has 10.200.46.3 as broadcast TCP connection won't be open
towards user B.
Same problem will happen for these following IPs (4,5,6) with 7 and
(8,9,10) with 11 and so on.
By changing the subnet mask to /32 resolved the problem
we came up to this routing info:

default via 10.200.46.2 dev rmnet0
 rmnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
qlen 1000
    link/ether b6:dc:ae:0e:f4:90 brd ff:ff:ff:ff:ff:ff
    inet 10.200.46.2/32 scope global rmnet0

2 questions:
How Android phone is setting these subnet masks, what is the Algorithm
and and where is it?
Why Android phone doesn't set the subnet mask to /32  in case of GPRS
network ?
that should be the case because during a PDP context create procedure,
the GGSN provides an IP address for the device via the End User
Address Information Element (EUA IE) in the 3GPP specifications and
optionally DNS server addresses via the Protocol Configuration Options
Information Element (PCO IE). However, you can notice the network
subnet is not provided by the GGSN. This is standard procedure.

--~--~---------~--~----~------------~-------~--~----~

3. Need developer for a SoCal Youth Soccer League app!

4. Singleton Objects and Android

5. for loop gives NullPointer Exception

6. Our app force closes on 1.6, Is SDK or image available yet?

7. Is it safe to queue KeyEvents and MotionEvents for deferred processing?