Darryl A. J. Staflund

Ranch Hand
+ Follow
since Oct 06, 2002
Darryl likes ...
Android Java VI Editor
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Darryl A. J. Staflund

Hi there,

I haven't really used Android handler's before, but from what I have read handlers can be used to send messages to other objects and messages can hold data bundles. So maybe you could add your data to a bundle, add the bundle to the message, and then use the handler to send the message to the AsyncTask. It should work in theory, but having never used handlers I am not sure.

Darryl
2 years ago
Hi there,

If the variable is going to take on different values at runtime, then I think you'll have to change your background programmatically using something like the following:



Hope this helps.
Darryl
2 years ago
Hi there,

I guess I don't understand what you're asking. Git is a revision control system so you're not going to run the code using git from the command line. You can commit or push the code from the command-line, but that's a git task that's better asked in a different forum.

If you are looking to run the application using the Android SDK from the command-line, I've never really done it but documentation on how to use Android SDK's commmand-line utilities are available on the web. You can, however, run the application from within Android Studio by importing the Gradle project and then running it. That really doesn't involve git though.

Good luck.
Darryl
3 years ago
Hi there,

If the project uses Gradle to build the application (and many Git-based Android apps do), open Android Studio and 'Import project (Eclipse ADT, Gradle, etc.)'. Once you tell Studio where the project is located, it should be able to import the project itself. Then you should be able to run the project by pressing the Green Arrow in the toolbar. There's a lot more too it than this, but this should help you get started/

I cant help you with any other scenario, I'm afraid.

Good luck,
Darryl
3 years ago
Hi there,

Udacity offer some excellent online video-based courses on Android, taught by members of the Google Android team. Just go to the following link:

Developing Android Apps

and try it out. It's free but you can enroll in their Android Developer Nanodegree if you want to be certified. I have taken this course and its excellent -- it will have you build a Popular Moves app that pull movie information from The Internet Movie Database (IMDb) and will also walk you through:

* Using Android Studio
* Activities and Fragments
* UI Development and customization (layouts, resources, drawable, etc.)
* Cursors and Content Providers
* AsyncTasks, Loaders, and SyncAdapters.
* Networking
* JSON Parsing
* Services
* And much more

The instructors are well-known and respected in the Android development community, including:

* Reto Meier, is an Android Advocate for Google
* Katherine Kuan is developer of the Google Keep application

Anyway, I heartily recommend it :-)

Darryl
3 years ago
Hi there,

You can do this as follows:

1. Place your text file in '/res/raw' to indicate that this file contains raw data.
2. Then read in a manner similar to the following:



Customize as needed.

Hope this helps.
Darryl
3 years ago
Hi again,

I just learned of an easier way of doing this and wanted to post it here. If you've defined your map using a fragment similar to the following:



then you can declaring the starting map position right in the fragment definition as in the following:



Very nice!

Darryl
3 years ago
Hi there,

You can specify the version number right in the AndroidManifest.xml file. Take a look at the following:

Versioning Your Applications

Darryl
3 years ago
Hi there,

Let Android's Intent system do the work for you. If you have the Uri of a movie or trailer you want to view, just create an intent as in the following code. The user will then be asked to select the application they want to view the movie in and then the selected application will play it for them:



Darryl
3 years ago
This happened to me too -- I'd start my app and find myself positioned somewhere over Africa or something. The way I solved it was to set the bounds of my map in the onMapLoaded method as follows:



Are you able to do something similar in your map?

Darryl

NB: I found that if you try animating your camera to a single coordinate on the map, the camera would be so low to the ground after animation that you can't really see anything of the surrounding area. So if you're working with a single coordinate instead of a bounded area of two or more coordinates, you might also want to set your zoom level to a value that allows for appropriate viewing of the surrounding area.
3 years ago
Hi there,

I don't think passing an activity as an Activity or fragment as Fragment to another class is good practice, although passing a Context is usually fine. But there are a number of other ways in which you can establish code re-use without having to pass activities -- for instance, you could create a common base class for your activities or fragments and put the AsyncTask code in there. Hope this helps.

Darryl
3 years ago
Got it.

The XPath expression that I need to use is:



Darryl
10 years ago
JSP
Hi all,

I am developing a JSP-based breadcrumb component that reads in the following (similar) sitemap document:



and generates a breadcrumb based on the user's current URI. For instance, if the user's URI is currently '/roleAdd.html', the Breadcrumb would look as follows (with all the appropriate links taken from the file):



I am using the JSTL XML tag library to implement the breadcrumb. The code I am currently testing with looks as follows:



What I need to do in order to finish my breadcrumb is replace the line:



with one that looks something like the following:



This line would retrieve a nodelist consisting of all ancestors from the root of the tree directly to (and including) the node with the URI that the user is currently viewing. I can't seem to figure out the syntax for this though.

I am running Tomcat 6.0.18 with the latests versions of JSP and Xalan-j. Can someone tell me what the correct syntax should look like?

Thanks,
Darryl
10 years ago
JSP
Well, I downloaded Sun Java JDK 1.6.0_07 for Windows x86 and it compiled without error.

I am pretty sure it is a bug that just hasn't been patched for the JDK release on our build server. Looking at the Java Bug Database, the JDK specification definitely allows dangling commas at the end of an annotation array. And the problem, which was first posted here:

Original Array Annotation Dangling Comma Bug Report

has officially been accepted as a Java Compiler bug here:

Java Bug ID: 6337964 ("Should ignore last comma in annotation array")

So, that's it then. There is nothing I can do since I can't modify our build server. I appreciate the responses.

Darryl Staflund
10 years ago
Alas, I don't have the ability to changing JVMs on either the build server or my workstation at work (NB: We're working on a defense contract and our customer - who owns the hardware - is quite particular about these sorts of things.) But I will install 1.6.0_07 on my home workstation to see if it makes a difference. I have to be honest, I don't think it will. I expect the compiler to behave as it does at work because I think the different in compiler behaviour lies not in the particular minor release I am working with, but with the fact we're working with two JVMs designed for two different architectures (one 32-bit, the other 64-bit) and operating systems (Windows and Linux). I'll post my results though for everyone to see.

Thanks for your comment.

Darryl
10 years ago