Adam Preston

Greenhorn
+ Follow
since Mar 04, 2011
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 Adam Preston

ill try it tomorrow but i heard configuring an emulator properly can be quite complicated

EDIT: nvm I think i have figured the problem out, problems occurred on line 48 and 43
7 years ago

Ron McLeod wrote:Adding the ACCESS_NETWORK_STATE permission should have fixed that issue.

Maybe try making a clean build.



done clean build and errors have gone, but warnings are still showing up:

01-25 20:06:47.979: W/IInputConnectionWrapper(1075): getExtractedText on inactive InputConnection

Is this something to do with my phone not being able to connect to the internet?
7 years ago
okay i fixed the array issue but now there is a problem with connecting to the internet. it says there is a security exception although i have enabled both two permissions:



Anyway here is the new log message:

01-25 19:16:04.199: I/ApplicationPackageManager(2239): cscCountry is not German : H3G
01-25 19:16:36.969: D/AndroidRuntime(2239): Shutting down VM
01-25 19:16:36.969: W/dalvikvm(2239): threadid=1: thread exiting with uncaught exception (group=0x40018578)
01-25 19:16:36.979: E/AndroidRuntime(2239): FATAL EXCEPTION: main
01-25 19:16:36.979: E/AndroidRuntime(2239): java.lang.SecurityException: ConnectivityService: Neither user 10073 nor current process has android.permission.ACCESS_NETWORK_STATE.
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.os.Parcel.readException(Parcel.java:1322)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.os.Parcel.readException(Parcel.java:1276)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.net.IConnectivityManager$Stub$Proxy.getActiveNetworkInfo(IConnectivityManager.java:369)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.net.ConnectivityManager.getActiveNetworkInfo(ConnectivityManager.java:251)
01-25 19:16:36.979: E/AndroidRuntime(2239): at com.example.weconnectingtowebpage.MainActivity$1.onClick(MainActivity.java:47)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.view.View.performClick(View.java:2485)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.view.View$PerformClick.run(View.java:9080)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.os.Handler.handleCallback(Handler.java:587)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.os.Handler.dispatchMessage(Handler.java:92)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.os.Looper.loop(Looper.java:123)
01-25 19:16:36.979: E/AndroidRuntime(2239): at android.app.ActivityThread.main(ActivityThread.java:3687)
01-25 19:16:36.979: E/AndroidRuntime(2239): at java.lang.reflect.Method.invokeNative(Native Method)
01-25 19:16:36.979: E/AndroidRuntime(2239): at java.lang.reflect.Method.invoke(Method.java:507)
01-25 19:16:36.979: E/AndroidRuntime(2239): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-25 19:16:36.979: E/AndroidRuntime(2239): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-25 19:16:36.979: E/AndroidRuntime(2239): at dalvik.system.NativeStart.main(Native Method)
01-25 19:18:04.349: I/ApplicationPackageManager(2321): cscCountry is not German : H3G
01-25 19:18:46.739: W/IInputConnectionWrapper(2321): beginBatchEdit on inactive InputConnection
01-25 19:18:46.739: W/IInputConnectionWrapper(2321): endBatchEdit on inactive InputConnection
01-25 19:18:46.739: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:18:46.749: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:18:51.819: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:18:51.819: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:19:18.439: I/ApplicationPackageManager(2321): cscCountry is not German : H3G
01-25 19:19:56.999: W/IInputConnectionWrapper(2321): beginBatchEdit on inactive InputConnection
01-25 19:19:56.999: W/IInputConnectionWrapper(2321): endBatchEdit on inactive InputConnection
01-25 19:19:56.999: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:19:56.999: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:20:02.089: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:20:02.089: W/IInputConnectionWrapper(2321): getExtractedText on inactive InputConnection
01-25 19:20:02.159: I/ApplicationPackageManager(2321): cscCountry is not German : H3G

7 years ago

Ulf Dittmer wrote:You're initializing the "urls" array to be of zero length - so when you try to access the element at the first position ("urls[0]") you get the exception. Try "String[] urls = new String[1];" instead.



of course, i see it now i'll fix the array exception first then i'll deal with asynctask. I will have to do it tomorrow now though.
7 years ago
i'm assuming it has something to do with AsyncTask but i'm relatively new to android programming and don't know enough about it to understand why an error is occuring.
7 years ago
here is the log:

01-24 16:02:34.479: I/ApplicationPackageManager(959): cscCountry is not German : H3G
01-24 16:02:34.579: D/AndroidRuntime(959): Shutting down VM
01-24 16:02:34.579: W/dalvikvm(959): threadid=1: thread exiting with uncaught exception (group=0x40018578)
01-24 16:02:34.579: E/AndroidRuntime(959): FATAL EXCEPTION: main
01-24 16:02:34.579: E/AndroidRuntime(959): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.weconnectingtowebpage/com.example.weconnectingtowebpage.MainActivity}: java.lang.ArrayIndexOutOfBoundsException
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.os.Handler.dispatchMessage(Handler.java:99)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.os.Looper.loop(Looper.java:123)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.ActivityThread.main(ActivityThread.java:3687)
01-24 16:02:34.579: E/AndroidRuntime(959): at java.lang.reflect.Method.invokeNative(Native Method)
01-24 16:02:34.579: E/AndroidRuntime(959): at java.lang.reflect.Method.invoke(Method.java:507)
01-24 16:02:34.579: E/AndroidRuntime(959): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
01-24 16:02:34.579: E/AndroidRuntime(959): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
01-24 16:02:34.579: E/AndroidRuntime(959): at dalvik.system.NativeStart.main(Native Method)
01-24 16:02:34.579: E/AndroidRuntime(959): Caused by: java.lang.ArrayIndexOutOfBoundsException
01-24 16:02:34.579: E/AndroidRuntime(959): at com.example.weconnectingtowebpage.MainActivity.onCreate(MainActivity.java:38)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
01-24 16:02:34.579: E/AndroidRuntime(959): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
01-24 16:02:34.579: E/AndroidRuntime(959): ... 11 more
7 years ago
hi, just asking why this program doesn't work..

computer specs:
-using eclipse adt bundle

android phone specs
- using model number: Samsung galaxy ace GT-S5830
- using android version 2.3.3

error produced:
On startup the application shows a blank white screen and then closes. Immediatley after, the android device pops up with an error message saying "the application WEConnectingToWebPage (process con.example.weconnectingtowebpage) has stopped unexpectedly. Please try again.

code for MainActivity.java:




code for activity_main.xml:



and finally code for the android manifest file:




I will be checking this thread regularly and any suggestions will be much appreciated

7 years ago

Paul Clapham wrote:Your first step is to decide which of the four methods you want to use.

And I don't understand what you mean by "I couldn't find any of the apps". What "apps" are you looking for and why?



there are apps by the name of the integration methods but that doesn't matter :) I have chosen integration method 1 to keep things simple. So now what do i do??
8 years ago
thank you it worked! I believed i should put it where all my projects were stored in the 'bin' directory of my working space but you were right.
10 years ago

Greg Charles wrote:Hi Adam,

I'm not sure what you mean that you "tried that" in relation to Paul's suggestion.

Try this:



I guarantee that the output from that (i.e., your Java app's working directory) is going to be different from the directory where your file is.


Greg



Thanks sorry I thought Paul's suggestion meant to put the file I was trying to use in the directory of my working folder (the folder where all my projects are stored in eclipse) Btw you gave me a line of code to work with but where in my program should I put it and should I make any alterations to the line of code. But I will play about with the code anyway try and make it work till you reply.
10 years ago

Paul Clapham wrote:

Adam Preston wrote:My system has never cooperated with me to read files from other programs.



You don't seem to understand computing very well. There's no "cooperation" taking place there; the computer does what it does, and it's your job to work with that. Blaming the computer will get you nowhere; you can't shame the operating system into doing anything different. It's up to you to make things work.



Okay I agree with you. But now may I point out to you that actually I am looking for help on how to overcome this problem not criticisms on my level of understanding in computing. Btw I'm 14 therefore I wouldn't be surprised if my understanding of computing is low however as I am learning I/O at the age of 14 in the UK where they have not inherited America's education curriculum of computer programming in schools, I do not believe there is much to complain about.
10 years ago
Thanks and I tried that but its still not working. My system has never cooperated with me to read files from other programs.
10 years ago
Hi I have a program which in theory should work perfectly but is failing to produce the out come I expected. I am starting to believe that my firewall(standard windows), anti-virus(Microsoft security essentials) or even my OS(windows vista) is blocking it is blocking this program from working but I am never sure. Here is the code:


please report any errors, thanks! this is the error message that the program produces:
Error: quicksave.txt (The system cannot find the file specified)
10 years ago
Nope still doesn't work... even with the things changed.
10 years ago