Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!

Andy Crowther

Ranch Hand
+ Follow
since May 17, 2017
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andy Crowther

When you say with the wife, do you mean as a pillion? If so, I would lean towards comfort.
3 months ago
Awesome, thanks   I didn't know I wanted a cow until I got one
It turns out that Google wont allow authentication in a webview, which is what iOS used when you add to home screen.  This means it opens Safari, which can't pass the authentication info back into the webview, so I think I'm stuck with just using it as a website, not a webapp   (Well, until maybe iOS make some changes)
Hi, I've tried to set my 'site' up as a mobile web app.  I've got bits in the header like this -

And I've tried various solutions in JavaScript to stop it going out to a browser when a link is pressed. At the moment, it's this -

That generally works, except the login page, Google's login, which even as a standard link on my iPad, opens Safari. When I login with Google in Safari, the webapp still sits waiting to be logged in...

If I do everything through Safari, it all works fine.

Does that make sense?  Does anyone have any tips to keep everything in the webapp?  On Android it all works fine within the webapp.
The first message seems quite a nice one to me. Surprised it upset you so much?

The second is clearly an automated message based on the system they use.  A site of that size can't me manually moderated.

How do you know you were the only one to receive a warning message?  I know at work if we discipline someone, we certainly don't go telling everyone else...  but often people say 'why am I the only one!' when ofcouse everyone is being dealt with.

I do agree this is a great place to ask questions though.  SO is massive, so you would get a quicker answer, but many people doing the answering have some sort of superiority complex, hence the down voting if you've done something slightly wrong

Use SO for reference, use here for questions
7 months ago
I'm looking for some advice on how I do something.  I have a weather app and want to be able to add locations.  I'm using OpenWeather API and they have a JSON file with about 40,000 cities listed as possible options.

In my app, how would I let the user search these cities?  The JSON file is about 12meg, so I don't really want to put the whole file in, do I?

The JSON has lots more info per city than I need, I just need the name and city code which could actually go into a HashMap.

How should I do this?

11 months ago
Hi, I wonder if anyone can tell me how to implement the data-toggle on my navbar.  Previously, you would click the item, it would load the new page, including the navbar again, with the correct one set to active.

I am now creating header.php which will go into each page and it looks like this -

I assume I shouldn't be loading the page again, but just changing the contents of a <div> or something along those lines.  Can anyone give me some pointers?

I realise I shouldn't have called it a service either, it's a Notification Receiver.

Also, I had another look and realised I didn't call mGoogleApiClient.connect() at any point...  seems to work now
11 months ago
Sorry, when I say 'in the app' I meant in the main activity. If I actually open the app, the above code is in onCreate, the location is found (onConnected is called) and everything works.  When I quit, an alarm is set to call the notification receiver at a set time which contains the same code (as seen above) but when the api is built and called in onReceive, it never calls onConnected.

Does that make sense?  Happy to try again if needed
11 months ago
Hi, I wonder if anyone can help me please.  I'm making a simple weather app, the main purpose is to warn me the night before, if the weather will be icy, wet etc overnight or in the morning.

It all works fine in the app itself, parsing the weather info etc, so now I want to make the notification build when the service is called.  I've generally just copied the working code from the app and built it in the notification receiver, but the location isn't being found.

I have this -

In the app this then calls onConnected, but in the service it doesn't.  What do I need to change in the service to get the location just the once?

11 months ago
I've been trying to do this all in PHP and not getting very far (I'm new to php and haven't really used Javascript at all yet) so I wonder if anyone can give me any pointers?

I have this php cart -

And this is the code Paypal give me to use -

What I need to do is get $toPay into where it says '0.01' in the Javascript.  How do I do this?

Thanks for any help.  Please let me know if I need to supply more info.

It's set up here for now -

But that's the php/old way, redirecting away to Paypal.  The new express checkout keeps you on your own site, which seems better, as once I know the payment is taken, I can update my database.
I've been riding about 10 years now and I think the best advice I could give is start small and work your way up.

Right now I ride a KTM Superduke R Special Edition -

It has a 1.3 ltr engine kicking out around 170bhp...  it's far more power than I need (or use) if I'm honest.  I took 9 years to build to that though.

I started on a 600cc touring bike (Honda Transalp) which at the time felt plenty fast enough.  After 3 years (and mainly because I get lent a CB1000R while teh Transalp was being serviced) I moved up to a Honda Varadeo (1ltr touring... and huge/heavy)

Then a few years on I plucked up the courage to buy my own CB1000R.  Then after 4 years on that I've jumped to 'The Beast'.

So, as I say, don't rush it.  Take your time. Gain confidence and riding skill.

As for what type of bike, Peter made a great list to choose from.  Did I miss somewhere, what you'll be doing with it?  If it's hitting the open roads just for some rides, I would think a touring bike.  If it's commuting look at a naked.  If it was hitting the track, or generally tearing it up, a sports bike.
11 months ago

Norm Radder wrote:I don't know that Android has a file chooser class.  I never found it and finally wrote one for myself.
I'd be very happy if there is now one available.

So I've come round to looking at this again, having fixed all my apps to work with Oreo...  it actually looks quite easy -

private static final int CHOOSE_FILE_REQUESTCODE = 1;

    protected void onCreate(Bundle savedInstanceState) {

        Uri selectedUri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + "/AutBuddy/");
        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
//        intent.addCategory(Intent.CATEGORY_OPENABLE);
        intent.setDataAndType(selectedUri, "*/db");
        Intent i = Intent.createChooser(intent, "File");
        startActivityForResult(i, CHOOSE_FILE_REQUESTCODE);


    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

                    Uri uri = data.getData();
                    String filePath = uri.getPath();
                    Toast.makeText(this, filePath,

        super.onActivityResult(requestCode, resultCode, data);

That toasts the file location, which I assume (wont get to code it into an app until tomorrow evening at the earliest) I can just slot into my app.

What I've not got working (although people say this code should do it) is have it start off in the folder that has my db files in it.  Any ideas on that?
1 year ago
Yes, phones generally do a good job, and for most will be just fine.
1 year ago
It's a lap timer app, which could be used (possibly by me) for track days, so speeds up to 150mph.  A separate GPS unit is quite a lot more accurate than a phone GPS to the point you can see your line through bends and such.

Unfortunately, me being still a beginner (maybe 4 months in?) it still takes me a very long time to understand new things like this...  and this is just added to my list of things to learn   Hopefully by next March or so, as people start doing track days again, I'll have figured it out
1 year ago