William H Taylor

Greenhorn
+ Follow
since Apr 22, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
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 William H Taylor

I understand, thank you very much.
6 years ago
private class WeatherTask extends AsyncTask<String, Void, Weather> {
@Override
protected Weather doInBackground(String... params) {


I got these two questions about the asynctask three types in one and the string ... parameters, I never saw these before. Can someone explain it to me. I was reading through java code and I don't know how to look these up. I think they are Generics but I never saw generics with three types. I also never saw java with a variable set of method parameters. I appreciate the help.
6 years ago
I am planning a JSP site that is connected to a database. The title, the heading tags, and content are all to be pulled from a database. I need to be able to make this site searchable by Google and I don't know how. I don't even know how to search for the answer. How do I make a data driven JSP site searchable by Google like a blog would be? I need it so that each returned JSP page can show up in a Google search results page. Thanks.
9 years ago
JSP
I am new to java programming. I am trying to implement a java servlet that processes google in app payments. I am trying to work my way through the code snippet that they provided. The code they have verbatim is below. My first question is how do I set up the servlet? Do I put a call in the doPost method of the servlet? If I leave it outside, the container wont call it right? What calls the getJWT() method? Third what do I do with the String that the method returns?

Here is the getting started page: https://developers.google.com/in-app-payments/docs/tutorial

I find the in app billing app beyond my present skills. Does anyone know of a good tutorial that includes all of the source code for a simple in app billing program. I find myself completely confused by the sample program.
10 years ago
I am making a chatbot for android for fun and I get this runtime exception. If anyone can help with this I appreciate it. The log cat message suggests an unassigned object variable somewhere but I don't know where it is.

The log cat message is

12-28 23:32:27.143: D/AndroidRuntime(337): Shutting down VM
12-28 23:32:27.143: W/dalvikvm(337): threadid=1: thread exiting with uncaught exception (group=0x40015560)
12-28 23:32:27.173: E/AndroidRuntime(337): FATAL EXCEPTION: main
12-28 23:32:27.173: E/AndroidRuntime(337): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wtaylorjr2001.practice/com.wtaylorjr2001.practice.PracticeActivity}: java.lang.NullPointerException
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.os.Handler.dispatchMessage(Handler.java:99)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.os.Looper.loop(Looper.java:123)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.ActivityThread.main(ActivityThread.java:3683)
12-28 23:32:27.173: E/AndroidRuntime(337): at java.lang.reflect.Method.invokeNative(Native Method)
12-28 23:32:27.173: E/AndroidRuntime(337): at java.lang.reflect.Method.invoke(Method.java:507)
12-28 23:32:27.173: E/AndroidRuntime(337): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-28 23:32:27.173: E/AndroidRuntime(337): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-28 23:32:27.173: E/AndroidRuntime(337): at dalvik.system.NativeStart.main(Native Method)
12-28 23:32:27.173: E/AndroidRuntime(337): Caused by: java.lang.NullPointerException
12-28 23:32:27.173: E/AndroidRuntime(337): at com.wtaylorjr2001.practice.PracticeActivity.onCreate(PracticeActivity.java:24)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-28 23:32:27.173: E/AndroidRuntime(337): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
12-28 23:32:27.173: E/AndroidRuntime(337): ... 11 more


Thread [<1> main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1647
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 1663
ActivityThread.access$1500(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 117
ActivityThread$H.handleMessage(Message) line: 931
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 3683
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 507
ZygoteInit$MethodAndArgsCaller.run() line: 839
ZygoteInit.main(String[]) line: 597
NativeStart.main(String[]) line: not available [native method]
10 years ago
Thanks the program does work now but it has a serious problem. The size of the file on the sdcard continuosly increases. There are no error messages.This program seems to be eating up memory.



10 years ago
Latest try still not working, the emulator says there is only 1 byte in the file and There is more than that.


10 years ago
I halfway solved the problem. The problem is that with this code I am reading and writing one byte of the z8 file and I don''t know what to do about it. This is my code.

10 years ago
I am writing an interactive story. It is a z8 file that is readable by zcode interpreters. I am trying to write a program that embeds the z8 file in an apk. The program will look into the users phone to see if it has twisty, a free zcode interpreter, and notify the user that an interpreter is needed if one is not found. It will take the z8 file and load it onto the sdcard. I need an example or a tutorial of how to load a binary file onto the android sdcard. Thank you for your help and time.
10 years ago
Thank you Sohaib, I think that this will work.
11 years ago
I want to have the user input a string into a textfield, retrieve the text from the textfield, process it and return another string to a text view object. I don't know how to do this. Can someone either point me to a tutorial, or post some code. I have searched google but I am not trying to create a new input class, I am trying to figure out how to modify the android manifest and extend an activity that uses a textview. Thanks.
11 years ago
Java has a network api where you can put together a simple server using the server socket class. My question is do you just need an active jvm to run it? How do you go about finding a host for something like that? You would not use servlets and tomcat because it is a server already right?
12 years ago
Thank you the validate and repaint worked. I wasn't sure where to place the question, sorry about that.
12 years ago
Hello,

Can anyone tell me how to get an image to display without having to resize the java applet first. I wrote a program to display an image but the image wont display unless I resize the web page or the applet viewer. Thank you for your time. I am using java 6 on a vista 64 box. I used the paintComponent method with the imageicon painticon method.

public class PhotoPanel extends JPanel{
ClassLoader cldr = getClass().getClassLoader();
String file = "sausages2.jpg";
URL fileName = cldr.getResource(file);
ImageIcon icon = new ImageIcon(fileName);
public PhotoPanel(String aFileName){
super();
file = aFileName;

}
public void paintComponent(Graphics g){
super.paintComponent(g);
icon.paintIcon(this, g, 0, 0);
}
}
12 years ago