Android :: Getting Run Time Error
Jun 21, 2010
i am getting error that the app has stopped unexpectedly as soon as i lauch the following programme on the emulator:package com.example.TextSpeaker2;
import java.util.Locale;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.speech.tts.TextToSpeech.OnInitListener;
import android.widget.Button;
import android.widget.Toast;
public class TextSpeaker2 extends Activity implements OnInitListener{
public static final Uri SMS_CONTENT_URI = Uri.parse("content://sms");
public static final Uri SMS_INBOX_CONTENT_URI = Uri.withAppendedPath(SMS_CONTENT_URI, "inbox");
int MY_DATA_CHECK_CODE = 0;
public static TextToSpeech mtts;
public static String body="";
Button speak;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent myintent = new Intent();
myintent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(myintent, MY_DATA_CHECK_CODE);
getSmsDetails(this, 0, false);
}Public static void getSmsDetails(Context context, long ignoreThreadId, boolean unreadOnly) {
String SMS_READ_COLUMN = "read";
String WHERE_CONDITION = unreadOnly ? SMS_READ_COLUMN + " = 0" : null;
String SORT_ORDER = "date DESC";
int count = 0;
if (ignoreThreadId > 0) {
WHERE_CONDITION += " AND thread_id != " + ignoreThreadId;
}Cursor cursor = context.getContentResolver().query(SMS_INBOX_CONTENT_URI,
new String[] { "_id", "thread_id", "address", "person", "date", "body" }, WHERE_CONDITION, null, SORT_ORDER);
if (cursor != null) {
count = cursor.getCount();
cursor.moveToFirst();
} else {
return;
} long messageId = cursor.getLong(0);
long threadId = cursor.getLong(1);
String address = cursor.getString(2);
long contactId = cursor.getLong(3);
String contactId_string = String.valueOf(contactId);
long timestamp = cursor.getLong(4);
body = cursor.getString(5);
StringBuffer smsMessage = new StringBuffer();
smsMessage.append("MessageID: " + messageId + "/" + count + "
"); smsMessage.append("ThreadID: " + threadId + "
"); smsMessage.append("address: " + address + "
"); smsMessage.append("contactID: " + contactId + "
"); smsMessage.append("contactID_string: " + contactId_string + "
"); smsMessage.append("timestamp: " + timestamp + "
"); smsMessage.append("body: " + body + "
"); Toast.makeText(context, smsMessage.toString(), Toast.LENGTH_LONG).show();
View 2 Replies
Feb 23, 2009
Now, I am trying to verify the JNI in Android Java platform. I am using HTC G1 phone. I write a simple .c file to make a hello.so and a simple hello.java file to load the library. My story is like below:
1. create hellolib.c file and compiled to a hellolib.so create a folder in create a hellolib.c file hellolib.c, it really nothing just a function return;
*#include <jni.h>*
*#define .LOG_TAG "TestLib"*
*#undef LOG*
*#include <utils/Log.h>*
*JNIEXPORT void JNICALL java_com_testHelloLib_PrintHello(JNIEnv
* env, jobject jobj)*
*{* *LOGD("hello android LIB");* *}*
I compiled the hellolib.c to .so by changing the android.mk:
*LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS)*
*LOCAL_SRC_FILES := hellolib.c*
*LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)*
*LOCAL_SHARED_LIBRARIES := libutils
LOCAL_PRELINK_MODULE := false*
*LOCAL_MODULE := libhello *
*include $(BUILD_SHARED_LIBRARY)
* push the libhello.so to /system/lib
2. create a .java file.
*public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
native_test.add_xx(1, 2) ;* * }* * }
View 8 Replies
View Related
Mar 13, 2010
I developed and published a game about two months ago. Since then, I've received several negative comments about input lag in the game. Before releasing the game, I already took several measures to hopefully prevent lag from occurring: 1) Game is almost entirely written in native code 2) After initialization, my process never invokes the GC during gameplay (no GC executions from my process show up in the log) 3) Average FPS is generally > 30 fps 4) I tested the game on both a Motorola Milestone and an HTC Magic and I don't experience any noticeable input lag (except perhaps when the GC is executed by other processes) My guess is that the lag that users are experiencing is a result of the GC being invoked by another process. Has anyone been able to address this issue? Specifically, have any game developers been able to achieve a completely lag-free game and thus avoid negative ratings that drag down your app? The only other suspicious thing I've noticed is the following lines showing up in my log any time a SoundPool clip is played: D/AudioHard wareMot ( 1054): AudioMgr:AudioStreamOutMot::standby called D/AudioHardwareMot( 1054): AudioMgr:Output 0xb538 entering standby D/AudioHardwareMot( 1054): AudioMgr:Closing stereo device D/AudioHardwareMot( 1054): AudioMgr:Output 0xb538 exiting standby
View 1 Replies
View Related
Apr 27, 2010
I wrote a basic soundboard app, and it runs fine there's nothing wrong with it. I want to upload it to the Market, but every time I try I get an error message:
Market requires the minSdkVersion to be set to a positive 32-bit integer in AndroidManifest.xml
That is already in there, I'm using 1.5 so I have my minSdkVersion set at 3. I don't understand what the problem is, and I've asked a lot of devs that never know what to tell me. I don't want to use a different platform because my phone currently uses 1.5. Others have suggested putting the <uses-sdk> line under the <manifest> line, but that hasn't helped at all.
Here is what my manifest looks like:
code:....................
View 5 Replies
View Related
Nov 15, 2013
My Desire V started reseting itself for no apparent reason that I can think of. Uninstalled the few apps I installed for the last few weeks. The crash logs show this in the bottom (and other I/O Errors all over the log file as well):
mmc0: Command timeout
mmc0: DMA channel flushed
end_request: I/O Error, dev mmcblk0, sector 814992
init: cannot execve('/system/bin/dbus-daemon'): I/O Error
Restarting Linux version bla bla bla
msm_pm_restart : Do HW_RESET By APP not by RADIO
No Errors detected
(mmcblk0 is the internal memory card)
Is my flash card broken? HTC Desire V
View 2 Replies
View Related
Apr 21, 2009
I have made a game with just one activity.. I just replace the views when I want to change screen. The game runs fine for a really long time inspite of what ever I do within the game.
But once I close the main game, by calling finish on the only activity in the application, and then when I start again, within the next 30 secs it crashes telling VM budget exceeded..
When I don't have a dispose() or a delete method in JAVA.. how the, am I supposed to remove the objects used in memory.. moreover I have android:launchMode="singleInstance" in my manifest
View 4 Replies
View Related
Sep 3, 2009
Can I alter the time it takes for the screen to lock? At the moment it's just 5 seconds or so, I can't do anything before I have to unlock again.
View 10 Replies
View Related
Dec 8, 2013
I have a problem every time I want to install an app. I can download it no problem but when I try to install it the message Error 110 appears all the time. I've done a reset but to no avail. Galaxy Tab 3
View 6 Replies
View Related
Oct 30, 2010
My mom wanted an Android phone and decided to go with the Droid X. She really likes the phone so far, even though there is a bit of a learning curve. The problem that is frustrating us both is that in order to sign into Google's Android Market place you must enter/confirm your gmail account. We enter her account information, which is 100% correct, and then it brings us to a captcha box. I've entered about 30 different captcha's and each time it starts to connect to Google's servers and then brings us right back to another captcha. There will be clear captcha's and I will be very careful I'm entering the correct characters and then it will still not work.Does anyone have a solution to this? Should I chalk this up as a server problem and wait and try it again tomorrow?I understand this isn't necessarily a Droid X issue as it is an Android 2.2 issue.
View 3 Replies
View Related
May 29, 2009
My calls to getFromLocationName() always fail the "first" time I start my app. I catch the IOException which has reason:
Unable to parse response from server
Then I make a second call and it succeeds. Once things are "awake" all future calls to getFromLocationName() succeed, it's just that first one, and there is a ton of latency.
I haven't run this on a device yet, just in the emulator. This seems like a network problem, but it is so reproducible I'm thinking I'm not initializing something properly. I'm using Android SDK 1.1.
View 2 Replies
View Related
Aug 29, 2010
How can I make progress bar to measure time (pause/playing/total time) of different video which is streaming from website?
View 2 Replies
View Related
May 5, 2010
Using appbrain on my PC seems to work fine when I'm not logged in. When I do log in and try to click on an app I get this error message:
"Error: Server Error The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the query that caused it."
Anyone else have this issue when using Appbrain on their pc?
Well, It looks like I solved the problem. I just deleted my account and created it again and it's fixed (for now).
View 1 Replies
View Related
Nov 1, 2010
I am getting a date/time string from web in the format of "yyyy/mm/dd'T'HH:MM:SS'Z'" and it is in UTC. Now i have to identify the current time zone of device and then convert this time to my local time. (FYI, Currently, UTC time is 10:25 AM, in india current time is 3:55 PM)
View 1 Replies
View Related
Aug 25, 2009
at the moment I am thinking about a new app and need some information to decide whether to develop on Android or an alternative OS. I am particularly interested in "time to first screen", "boot-up time", "time to first Audio" and "app-start" (can be any from the android market or even one of the pre-installed ones) time? Does anyone know a source or perhaps measured those numbers?
View 9 Replies
View Related
Jul 12, 2009
I want to develop a game, so I need to know elapsed time at lots places in my game. For example, to measuring FPS. I see there is some example use "System.currentTimeMillis" to measure elapsed time. But I see the warning on document: http://developer.android.com/intl/zh-TW/reference/java/lang/System.ht... "This method shouldn't be used for measuring timeouts or other elapsed time measurements, as changing the system time can affect the results." So, if this method should not be used for measuring elapsed time, then what will be suitable?
View 2 Replies
View Related
Nov 11, 2010
So I wanted some DigitalClock help. I have set up a digitalclock, and here's what I want to do. Once the clock hit's a certain time, perform an action. How can I control the actions on the digital time to check for a certain time?
View 2 Replies
View Related
May 17, 2010
Is there any android widget that enable to pick the date and the time at the same time ? I already use the basic date picker and date picker:
http://developer.android.com/guide/tutorials/views/hello-timepicker.html
http://developer.android.com/guide/tutorials/views/hello-datepicker.html
but they are not that sexy and user friendly (I found). Do you know if a widget including both date and time exists? Thanks a lot,WW.
View 1 Replies
View Related
Oct 1, 2010
I'm searching for time and billing apps. I've tried Time Catcher, myTimeSheet, and Time Recording. None of these allows start and stop of clock for multiple entries throughout the day. Any tips for better time sheet apps?
View 1 Replies
View Related
Aug 17, 2010
I am trying to get a local time from a server UTC time. I get the UTC time form the server -- and i want to make it right for each individual Android phone whether it be in California or China. This is the code I am using now -- however it snot working.The time I get from the server is "2010-08-17 19:41:13.0" And the code I use to get the difference(in seconds) is the following: public static long getSecondsDifference(Timestamp timeStamp) { final Calendar calendar = Calendar. get Instance (Locale.getDefault()); int refrenceOffset = TimeZone. get Default (). getOffset(timeStamp.getTime()); final long referenceSeconds = (timeStamp. get Time() + refrenceOffset) / 1000; final long currentTimeSeconds = (calendar. getTimeIn Millis()) / 1000; final long differenceMinutes = (currentTimeSeconds - referenceSeconds) / 60; return differenceMinutes; The timestamp is from the java.sql.timestamp package.Right now the time where I am is 11:50AM -- and the method returns that the given server time is -53 minutes ago( so obviously doing something wrong
View 1 Replies
View Related
Jan 14, 2010
Is there a way to get the time or date stamp of the last time the GPS was updated?
View 6 Replies
View Related
Apr 11, 2010
All text messages that I receive are 6 hours ahead of the actual time on the phone. Does anyone know how to fix this?
View 1 Replies
View Related
May 25, 2010
Hey I think this was covered in a Hero forum but there was no good answer. Does anybody know why Handcent decides to not show facebook pictures from time to time?
View 2 Replies
View Related
Aug 29, 2010
MotoDroid 2.2. Since 2.2, the auto-rotate screen goes haywire from time to time. I normally use the vertical format, easier to type, but when it switches, not much screen left, and I have to go back and back to start over again.
View 4 Replies
View Related
Jun 7, 2009
I just got the magic yesterday and so far I'm loving it. Just have a couple questions about texting. When I receive a text it usually tells me the time in eastern time though I'm pacific. However, my sent messages come up with the right time. This makes it so that threaded sms is kind of useless. Everything is all out of whack. Also, every once in a while it just won't even give me a time and there has been once or twice(after fiddling with it for a bit) that it gave me the right time but it just went back to the wrong time right after. Could this be a problem with the phone or is it rogers' fault? I'm assuming it's getting the time from the network and they have it wrong(meaning I can't fix it) but I just wanted to see if anyone else has had this problem.
Also, is there any way to make it vibrate when I receive a text? I feel dumb for asking this as it seems like it should be something really obvious but I can't seem to find it anywhere.
View 4 Replies
View Related
Jan 14, 2010
Is there a way to keep the phone from changing time as you cross time zones?
View 4 Replies
View Related
Dec 30, 2013
I recently received an LG optimus f3 with android 4.1.2.
After activating the phone, it displayed the correct date and time for my time zone, so I didn't mess around with settings to reset the time, as I would with any other device.
However, I've noticed that the time changes to exactly an hour ahead, before changing itself back several minutes later.
I went to settings > date and time, but 24 hour time and selecting a date format are the only options listed.
I prefer to leave mobile data off when I am at home and can use the wi-fi. Is it necessary to have mobile data turned on, so the phone can receive the time from a cell tower, or is there a way I can set an internal clock?
View 4 Replies
View Related
Aug 2, 2010
When i'm connected to my router at home via wifi, the connection randomly drops from time to time. My laptop and TV is fine which are both running via the internet. The setting is set to stay connected always, even when the screen goes black.
Does anyone have a resolution for this? Perhaps static IP? if this is the answer, what should the settings be?
View 7 Replies
View Related
Aug 7, 2010
I was having the waketime/sleeptime problem that many, many folks have reported and my battery life was obviously crap...and took forever to charge as has also been noted. I had already turned off all the auto-update stuff that I did when I first got the phone. Then I read the many posts abut Facebook app being the problem, but when I tried that it turned out that I was still running the old version 1.2, so apparently that wasnt causing it on my Evo.
Not really wanting to do a factory reset, I thought I'd check for other app updates in case one of the other apps had 2.2 bug fixes. Ran a sync thru the AppBrain app, and it found three updates that I hadnt been notified of:
Once those updates were completed, my EVO immediately starting going to sleep as it used to. I watched it for a few hours after the update and it continued to show realistic numbers for wake vs. sleep. My battery was almost depleted at this point, so I powered it off, and did the battery pull for good measure before powering back on and plugging in to charge during the night. This was all late Thursday night. All day Friday my battery performed VERY well...much better than even during 2.1. I had it on charge most of the day while listening to Pandora at my desk. I unplugged it to go home and now checking it this morning, it's now been off charge for 14h 39m, show wake time of 33:44 vs. sleep time of 15:28, and shows 80% battery remaining! This whole scenario makes me wonder if one of those three apps had a similar bug to Facebook. If you have those...you might want to take a closer look.
View 1 Replies
View Related
Apr 23, 2013
I have tried searching the database for this and googled it and I couldn't find anything.
I'm not very experienced in Android, however, I am trying to develop an application. Within the application I want to check if the current time falls between time ranges
pseudo code
[HIGH]if (currTime > 9am AND currTime < 7pm)
{
//do this
}
else if (curTime>7pm AND currTime <10pm)
[Code]...
View 1 Replies
View Related
Dec 28, 2012
How can I determine if the current time is between two other time objects?
For example: current: 15:23, startTime: 22:00, endTime: 06:00. So the current time is not between this two other times, but this "23:47" is.
*I don't care about the date, only the time
I tried to do it like this:
Code:
Time startTime = getStartTime();
Time endTime = getEndTime();
Calendar c = Calendar.getInstance();
Time now = new Time(c.getTimeInMillis());
[Code]...
but it dosen't work well. their aren't any errors but it just dosen't work.
To be more precise the problem is that 15:35.after(22:00) return true... and I don't know why. I think that the problem is something with the dates but I don't know what
View 1 Replies
View Related