Need help with project. Getting "unhandled exception java.text.parseexception" error
Hi, in my android studio project, I have been getting an error and I've been trying to resolve it for the last couple hours. Sorry about my links, apparently since I'm new I can't post links yet... So I spaced out my links.
//
The error is: "Unhandled exception:java.text.ParseException"
This error pops up on the following three lines in my code. My full code is located on onedrive at this link: (1drv.ms / 1NatGWH)
Date date1b = format1.parse(endtime1);
Date datenow1 = format1.parse(currenttime1);
//
What I want my app to do:
When I click a button, I want the code to check what time is it and if it is between two times listed. If so, it will then display my next school course that day.
I have a working eclipse version in which it prints what I have next into console. But now I want to make it into an app. The link containing the java file explains pretty well what I want my app to do. It is accessible here at this link: (1drv.ms / 1SBrFki)
Help would much be appreciated. Feel free to ask me questions.
Matthew
Related
I asked this question on stackoverflow but it's getting (literally) no views for some reason so I'll repost it here.
hxxp://stackoverflow.com/questions/3321047/search-suggestions-fail-in-2-2
(new users can't post links)
My application uses in-app search, dynamically builds search suggestions on each request, puts them in a MatrixCursor and returns the suggestions to be displayed. Info on search suggestions here:
hxxp://developer.android.com/guide/topics/search/adding-custom-suggestions.html
This works perfectly fine in 2.1-update1, but when I loaded it on a 2.2 phone, I get a fatal error when I try to search. The error logs are in the link, but basically the application is getting an error in code that isn't mine (Google Android code for displaying search suggestions - SuggestionsAdapter). For some reason it's trying to get the MatrixCursor to Long.parseLong() a String, and the application is failing. Again, this does not happen in 2.1. I hope I've just overlooked something stupid.
Thanks!
Hey there,
I started developing Android Applications a few days ago.
Now, I wrote a Program wich is about to call a new class/activity.
But always when I launch the Program and it want to call the new activity, the errormsg "Source not found" occurs in the debugger.
I created the class with a leftclick on the existing class-file -> new -> class.
I know, the Internet is full with informations about "Source not found" but i didn't find any informations about exactly this issue.
Would be nice, if someone could tell me, what I did wrong...
Thx and greez Visosilver
Please elaborate on what you are doing. Does your app start? Does this happen when you are debugging your app?
I imagine that you are debugiing and stepping through the code. If you try to go into a method from the framework you need to attach the source code for the framework otherwise you get the message "Source not found"
Just been following the "hello world" tutorial on android developers, (hopefully i've installed all the right software) But I am getting an error when I choose "run" from eclipse.
The code as copied from the tutorial is;
tv.setText("Hello, Android");
setContentView(tv);
eclipse says "tv cannot be resolved" "java problem" on both lines?
Can anyone tell me where i'm going wrong ?
eclipse version "Eclipse Java EE IDE for Web Developers.
Build id: 20100218-1602"
You must have missed a line out somewhere from the tutorial - compare what you've got against the example again.
The error implies that the compiler doesn't know what "tv" is - it should've been defined and initialised on the previous line:
PHP:
TextView tv = new TextView(this);
I did yes I dont get errors now, but when I choose run it takes a loooong time for the screen to pop up and only displays "ANDROID" with a flashing cursor and not the "hello android" as displayed in the tutorial.
Also the screen shows no other icons at all I thought the screen would look like my galaxy s, maybe I need to set that up somewhere as well ?
Can anyone provide links to easier to understand step by step tutorials ?
Many thanks
The emulator will be booting a full version of the Android OS (assuming you set it up following the instructions in the tutorial) - it's well known to be very slow, and will sit on the boot screen for ages - just wait and eventually you'll see an Android desktop and your app should run. (Have patience - on my netbook it takes well over 10 minutes to boot!)
When you're done, DON'T close the emulator window, just minimize it. This way you won't have to wait all that time again next time you run your app, since the emulator will already been booted.
Also, you could put your phone into USB debugging mode, and run your code on the phone directly, which will be much faster!
(see http://developer.android.com/guide/developing/device.html )
I've read the other threads about this but there is no help to be found there unfortunately.
I've been playing with App Inventor because I wanted to avoid learning Java but my think now is that seeing as I do JavaScript/PHP/mySQL and HTML/CSS anyway I might as well do my app development properly.
I've been following the instructions at the official developer.android.com site.
and the part where I have the problem is with Eclipse - at step 1 on that page. I've installed the JDK but when I try to install Eclipse I get an error telling me that there is no Virtual Java machine in the eclipse\jre\bin\ folder.
Well I'm following the instructions so what can I do about this? I don't even understand the error. Is there supposed to be a file in this folder, a folder which a.doesn't come with the standard Eclipse .zip file and which b.doesn't exist at all!
I tried this all before some time ago and got the same problem. At that time I couldn't even use App Inventor because of some JDK/JRE problem but I un-installed and reinstalled Java and App Inventor is working now.
This is one of the most frustrating computing problems I've faced because I've searched all over for an answer and there is nothing out there. Frankly I'm a little surprised at how poor the installation documentation is
The only thing I can think of is I have the wrong version of Eclipse. Which exact one is everyone else using?
Hello Subjective Effect. There is not a folder named eclipse\jre\bin in eclipse installation folder. The version i m using is eclipse-helios. I was not faced the problem you have.
I've solved that part of the problem by downloading a different version of Eclipse. It is a Helios version and is the one with Java. The installation instructions are not clear on this.
I now have another issue but I'll try work that out for the time being.
So I've no idea (again because the instructions are so poor) what to do about this.
I'm on the Android Developers site and trying to start the Hello World tutorial. I'm already stumped at the stage of creating a New Project because after I set up Project name, Application name, Package name and Create Activity clicking "Finish" gives this error:
[2010-10-28 01:33:03 - HelloAndroid] ERROR: Unable to open class file C:\workspace\HelloAndroid\gen\com\subjectiveeffect\helloandroid\R.java: No such file or directory
The reason I think the docs are poor is am I supposed to have created this directory or does Eclipse create it for you? And if it's supposed to be created for you what am I doing wrong?
Subjective Effect said:
So I've no idea (again because the instructions are so poor) what to do about this.
I'm on the Android Developers site and trying to start the Hello World tutorial. I'm already stumped at the stage of creating a New Project because after I set up Project name, Application name, Package name and Create Activity clicking "Finish" gives this error:
[2010-10-28 01:33:03 - HelloAndroid] ERROR: Unable to open class file C:\workspace\HelloAndroid\gen\com\subjectiveeffect\helloandroid\R.java: No such file or directory
The reason I think the docs are poor is am I supposed to have created this directory or does Eclipse create it for you? And if it's supposed to be created for you what am I doing wrong?
Click to expand...
Click to collapse
Mine seems to have that error no matter what I type in.
So what have you done about it? Or can I continue without worrying, is this a trivial error message?
1) you should download Eclipse 3.5.2 as Helios is not supported by Android plugin yet.
http://www.eclipse.org/downloads/packages/eclipse-classic-352/galileosr2
2) R.java problem should go away if you restart eclipse
Also, to start with better use the existing sample project HelloWorld rather than setting up your own.
This is a common known bug. You can use the latest eclipse version, once you setup a project, you will have to go under project properties and choose compiler version 1.6, which is set to 1.5 usually.
Tha will solve the problem, because i was facing the same a few days ago when starting to mess with SDK and Eclipse.
I had a similar problem and gave up for awhile and when I came back to it I found out that I didn't have my paths set correctly for the java jdk, not sure if that is it but it worked for me.
I find if I restart Eclipse it fixes things.
I've been playing with layouts!
Hey guys,
I have been having trouble getting started developing applications for android. I know how to use Java, and frequently use the netbeans ide for my java homework ect. But I decided why not adventure out and build upon what I learned in school. Unfortunately I have ran into nothing but problems. The first problem is this:
"Gradle project sync failed. Basic functionality (e.g editing, debugging) will not work properly. "
In the messeages window it reads:
[file path to \app\build.gradle]
Failed to Find: com.android.support:appcompact-v7:21+
I have had trouble using grade in eclipse....well I only got eclipse to work once, when I first got my phone, and managed to make a small pop-up app for my self. I did not know any programming language at the time. I merely just copy and pasted most of the code.
and problem number two;
The generated code is riddled with errors?
I look through most of these errors and they state that certain things can be resovled. For example, cant resolve "support" <--- I think that by not having this imported correctly (I think this falls into the first problem) is causing the rest of the errors in my MainActivity file to go crazy.
Is their any way to post more information? Like a log file, maybe that might be of more help too. I just am unfamiliar with Android Studio, as of right now. Attached is a picture of the IDE when is spawns the error.
Thanks for the help in advance!
How to Fix said issue
KJ4CCH said:
Hey guys,
I have been having trouble getting started developing applications for android. I know how to use Java, and frequently use the netbeans ide for my java homework ect. But I decided why not adventure out and build upon what I learned in school. Unfortunately I have ran into nothing but problems. The first problem is this:
"Gradle project sync failed. Basic functionality (e.g editing, debugging) will not work properly. "
In the messeages window it reads:
[file path to \app\build.gradle]
Failed to Find: com.android.support:appcompact-v7:21+
I have had trouble using grade in eclipse....well I only got eclipse to work once, when I first got my phone, and managed to make a small pop-up app for my self. I did not know any programming language at the time. I merely just copy and pasted most of the code.
and problem number two;
The generated code is riddled with errors?
I look through most of these errors and they state that certain things can be resovled. For example, cant resolve "support" <--- I think that by not having this imported correctly (I think this falls into the first problem) is causing the rest of the errors in my MainActivity file to go crazy.
Is their any way to post more information? Like a log file, maybe that might be of more help too. I just am unfamiliar with Android Studio, as of right now. Attached is a picture of the IDE when is spawns the error.
Thanks for the help in advance!
Click to expand...
Click to collapse
Ok guys, I figured it out. We need to install a package from the sdk manager. The picture shows which one needs to be installed. The package is "Android Support Repository"
Seems you have already gotten the answer. But for this kind of questions, past the main line of the error log into Google is much faster than post a question, I think.