I begin to wonder whether I should try condensing the app into one view for now, then trying to figure out how to add a second view separately...might be a way to separate out the issues enough to attack them productively.
Showing posts with label struggle. Show all posts
Showing posts with label struggle. Show all posts
2012/04/11
Testing Test...
Spent much of the day going around and around and around in circles. The word is argh.
2012/04/10
Source Not Found
I haven't yet found any useful suggestions on dealing with Source Not Found; so, I'm going to take some stabs in the dark and see if any of them result in a scream.
Now, I have a sneaking suspicion that there's some duplication between these two lines, so let's see what happens if I take one out, leaving
Aha! Stack Overflow to the rescue! Looks like the whole thing is redundant now I've got
First off, I know that I have said that the warnings aren't that important, as long as there aren't any actual errors. How about I just test that; I comment out the unnecessary import statements [a simple /* on one side and */ on the other does the trick. Alternatively for single lines // works.]
Commenting in this way is a great method to quickly change code around - because if I decide that removing something was a mistake, I just have to uncomment it, not remember how it went and re-type it.
Then the remaining warning is around
private DatePickerDialog.OnDateSetListener mDatePicked;and how I use it in
mDatePicked = new DatePickerDialog.OnDateSetListener() {In that Eclipse is telling me that mDatePicked is not used! Um, oops...what's gone wrong here then? I declare mDatePicked, as you see above, then I do some stuff onDateSet.
Now, I have a sneaking suspicion that there's some duplication between these two lines, so let's see what happens if I take one out, leaving
mDatePicked {Nope, that errors. Badly. Howabout taking out the first one? Also makes things worse, in that the warning has upgraded to an error.
Aha! Stack Overflow to the rescue! Looks like the whole thing is redundant now I've got
So I'll just try cutting out the lot, see what I get. No...that causes even more problems. I'm going around in circles here. I believe the technical term is GAH!public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
2012/04/09
Testing, Testing, 1-2-1-2
To test an app, first thing you need is for Eclipse to not report any errors.
Then you need to feel that there is enough of your app complete to be worth testing. For instance, I don't really-truly care about whether the home screen looks right, if all I can do is look at it. I want to know whether it works when I press buttons.
Then you Save All (Ctrl+Shift+S), and finally you go to the green and white Button for "Run Wedding Logistics".
Having already specified a test machine (in my case using the specs for my own Android phone), it should just load up. Be aware though, this step can be veeeery slow.
And...ah. Oh dear:
Well, at least you can see what Toast looks like! As well, of course, as the appearance of the testing software [which is included in Eclipse].
It does occur to me that most programming I've done will talk about de-bugging, and this seemed to be more of a 'run program' option. Hmmm. *Looks around* Aha!
I clicked on this:
I should have gone for this:
The Debug button. Debugging is one of those terms that is more literal than you think - while the origins are obscure, it was popularised in the days of the first computers, vast buildings full of valves such as Colossus or ENIAC. - when it was possible for a bug like a moth to get into the works and cause the machine to behave in unexpected ways. The archetypal bug is pictured here.
I believe my error is linked to the fact that the tutorials from hackaday were with already completed and tested code - so the bit of seeing it work at the end was just the reward. Anyway, now I hit Debug, so I'll see what pops out:
Source not found.
Ah. I have no idea. Will have to come back to this once I've done some more reading.
2012/04/04
Struggling with SSA (no, not what you might think!*)
AAAAAAAARRRRRRRRRRRRRRGGGGHHHHHHHHHHHHHH!
'scuse shouting, this is frustrating.
The latest thing I've tried is:
[OnClickListener being a method which can look out for an action by the user and take action when it is detected.]
However, Eclipse doesn't like this - the specific error it's giving me is
My best guess is that I shouldn't be using an OnClickListener on a DatePicker. Hmmm. There is a way to use auto-completion to check that.
Aha. By typing
and as I go down the list, setOnClickListener is a valid option.
Better yet, when I take the suggested variable of setOnClickListener(l) I get a different error.
I do not know how to resolve this at present, but I'm sure I can come back to it.
*I realized after dubbing my SplashScreen as SSA** for the purposes of this blog that in the parlance of American Evangelicals SSA stands for same-sex attraction; as such "struggling with SSA" is the process that homophobic Evangelicals have to go through if they realise they are homosexual.
I don't feel attracted to men, and even if I did it wouldn't change the fact that I am attracted to women; so not only is the wedding still on, but the post title might be misleading to people from that world.
** I learn from the fiancĂ©e that SSA† is also a term in Chemistry for the Steady-State Approximation.
† SSA also stands for the Secular Student Alliance who are all kinds of awesome if you're USian and not so keen on the Religious Right.‡
‡ Nested footnotes FTW!
'scuse shouting, this is frustrating.
The latest thing I've tried is:
based on an example I found for implementing an OnClickListener.DatePicker WeddingDate = (DatePicker)findViewById(R.id.datepicker);WeddingDate.setOnClickListener(this);
[OnClickListener being a method which can look out for an action by the user and take action when it is detected.]
However, Eclipse doesn't like this - the specific error it's giving me is
The method setOnClickListener(View.OnClickListener) in the type View is not applicable for the arguments (SplashScreenActivity)The above is shown in red to give some inkling of how angry Eclipse is with me. Now, I actually just realised an error in the above - I already defined WeddingDate as a DatePicker above, so re-defining it like this is just going to confuse Eclipse. So I take that out to get:
WeddingDate = (DatePicker)findViewById(R.id.datepicker)
WeddingDate.setOnClickListener(this);Main difference? WeddingDate is now highlighted in blue - Eclipse has recognised it as a defined object. The error is still marked, however.
My best guess is that I shouldn't be using an OnClickListener on a DatePicker. Hmmm. There is a way to use auto-completion to check that.
Aha. By typing
WeddingDate.setI get a list of methods whose names begin "set" that might apply to the object WeddingDate. It's a long'un, but the beginning looks something like this:
and as I go down the list, setOnClickListener is a valid option.
Better yet, when I take the suggested variable of setOnClickListener(l) I get a different error.
l cannot be resolved to a variableWhich is fine, because it shows me that the previous error related not to the method setOnClickListener, but only to the argument, which the first time is "this" and the second time is "l". They've given me different errors because in Java "this" has a default meaning (thus the purple colouring) and "l" does not.
I do not know how to resolve this at present, but I'm sure I can come back to it.
*I realized after dubbing my SplashScreen as SSA** for the purposes of this blog that in the parlance of American Evangelicals SSA stands for same-sex attraction; as such "struggling with SSA" is the process that homophobic Evangelicals have to go through if they realise they are homosexual.
I don't feel attracted to men, and even if I did it wouldn't change the fact that I am attracted to women; so not only is the wedding still on, but the post title might be misleading to people from that world.
** I learn from the fiancĂ©e that SSA† is also a term in Chemistry for the Steady-State Approximation.
† SSA also stands for the Secular Student Alliance who are all kinds of awesome if you're USian and not so keen on the Religious Right.‡
‡ Nested footnotes FTW!
Subscribe to:
Posts (Atom)


