Suppose I have a URL in my query string. Someone told me that Google does not like it because they believe we are pulling content from another server.
http://mydomain.com/?id=http://abc.com
I am about to start developing an android app and need to get an IDE. Eclipse and the android eclipse plugin appears to be the natural choice. However I am familiar with intelliJ and re-sharper so I would prefer use intelliJ.
Has anyone used http://code.google.com/p/idea-android/"http://code.google.com/p/idea-android/? Is this any good?
Should I just bite the bullet and learn Eclipse?
I want to remove top frame using google Language Translation link ( http://translate.google.com/translate?hl=en&ie=UTF-8&sl=es&tl=en&u=http%3A//www.yahoo.com/ )....
after inserting site name and language option (Translate from:.. Translate INTO:)
I have a reciever that works well, but I can't seem to show a proper UI, although the toast appears correctly. As far as I can tell, this is caused by Android requiring the class to extend Activity, however, the class already extends BroadcastReciever, so I can't do this.
So, I tried to do an Intent, but this failed too. There are no errors, but the screen doesn't show. Source code is below, and any help would be most appreciated.
Reciever
public class Reciever extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Toast.makeText(context, "Alarm Recieved", Toast.LENGTH_LONG).show();
Intent i = new Intent();
i.setClass(context, AlarmRing.class);
}
}
AlarmRing
public class AlarmRing extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.alarm);
MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.sweetchild);
mp.start();
}
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.comaad.andyroidalarm"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".AndyRoidAlarm"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.comaad.andyroidalarm.Reciever" android:enabled="true">
<intent-filter>
<action android:name="com.comaad.andyroidalarm.Reciever"></action>
</intent-filter>
</receiver>
<activity android:name=".AlarmRing"></activity>
</application>
</manifest>
}
Hi,
i'd like to create localized URL's for my site. They should obviously point to the same controller actions, but I want the first routevalues to -always- be the location/language specification. Is this possible?
http://www.website.com/en/us/controller/action
http://www.website.com/en/gb/controller/action
I understand it can be done by defining {language} and {location} in every route, but i'm looking for a slick, non-hacky solution.
Hi,
When I try to set the header properties on a WebRequest object, I get the following exception
This header must be modified using the appropriate property
I've tried modifying the .Headers propery and adding them that way like so
webRequest.Headers.Add(HttpRequestHeader.Referer, "http://stackoverflow.com");
But still getting exceptions. I can get around this by casting the WebRequest object to a HttpWebRequest and setting the properties such as httpWebReq.Referer ="http://stackoverflow.com"
But I'd like to know if there's a way to get a finer grained control over modifying headers with a request for a remote resource.
Thanks
hey guys this is my 1st android app(learning), so i want to call a number given in the textbox but i'm getting error as "The application 'xyz'(process com.adroid) has stoped unexpectedly".. following the code i have done so far... where m doing wrong ??
EditText txtPhn;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button callButton = (Button)findViewById(R.id.btnCall);
txtPhn = (EditText)findViewById(R.id.txtPhnNumber);
callButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
try {
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:"+txtPhn.getText().toString()));
startActivity(callIntent);
} catch (ActivityNotFoundException activityException) {
Log.e("Calling a Phone Number", "Call failed", activityException);
}
}
});
}
EDITED LogCat
03-09 11:23:25.874: ERROR/AndroidRuntime(370): FATAL EXCEPTION: main
03-09 11:23:25.874: ERROR/AndroidRuntime(370): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx-xxx-xxxx flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from ProcessRecord{40738d70 370:org.krish.android/10034} (pid=370, uid=10034) requires android.permission.CALL_PHONE
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Parcel.readException(Parcel.java:1322)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Parcel.readException(Parcel.java:1276)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1351)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1374)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Activity.startActivityForResult(Activity.java:2827)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.Activity.startActivity(Activity.java:2933)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at org.krish.android.caller$1.onClick(caller.java:29)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.view.View.performClick(View.java:2485)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.view.View$PerformClick.run(View.java:9080)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Handler.handleCallback(Handler.java:587)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Handler.dispatchMessage(Handler.java:92)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.os.Looper.loop(Looper.java:123)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at android.app.ActivityThread.main(ActivityThread.java:3683)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at java.lang.reflect.Method.invokeNative(Native Method)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at java.lang.reflect.Method.invoke(Method.java:507)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-09 11:23:25.874: ERROR/AndroidRuntime(370): at dalvik.system.NativeStart.main(Native Method)
Permission denied for <http://xxx.com> to get property
HTMLDocument.body from
http://www.xxx.com.
var c = parseFloat(cf.contentDocument.body.offsetHeight) + 30;
When programming sites you usually have one set of config files for the development environment and another set for the production server (or one file with both settings). I am assuming all projects should be handled by version control like git or svn. Manual file transfers (like FTP) is wrong on so many levels.
How you enable/disable the correct settings (so that your system knows which ones to use) is a problem for me. Each system I work on just kind of jimmy-rigs a solution. Below are the 3 methods I know of and I am hoping that someone can submit a more elegant solutions.
1) File Based
The system loads a folder structure based on the URL requested.
/site.com
/site.fakeTLD
/lib
index.php
For example, if the url is http://site.com then the system loads the production config files located in the site.com folder. However, if I'm working on the site locally I visit http://site.fakeTLD to work on the local copy of the site.
To setup this I edit my hosts
file and add site.fakeTLD to point to my
own computer (127.0.0.1/localhost) and then create a vhost
in apache.
So now I can work on the codebase locally and then push to the server without any trouble. The problem is that this is susceptible to a "host" injection attack. So someone loading site.com could set the host to site.fakeTLD and then the system would load my development config files instead of production.
2) Config Based
The config files contain on section for development - and one for production. The problem is that each time you go to push your changes to the repo you have to edit the file to specify which set of config options should be used.
$use = 'production'; //'development';
This leaves the repo open to human error should one of the developers forget to enable the right setting.
3) File System Check Based
All the development machines have an extra empty file called "development.txt" or something. Each time the system loads it checks for this file - if found then it knows it is in development mode - if missing then it knows it is in production mode. Since the file is NEVER ADDED to the repo then it will never be pushed (and checked out) on the production machine.
However, this just doesn't feel right and causes a slight slow down since all filesystem checks are slow.
Is there anyway that the server can auto-detect wither to use the development or production configs?
Hi Guys,
This is a screen shot of a JVM (win64, 6u17) running ActiveMQ, after every garbage collection the heap size is reducing. As the heap size reduces garbage collection gets more frequent and the heap reduces more quickly. Eventually the VM locks up as it's spending all it's time in GC.
-Xms is the default and -Xmx is 2048mb.
What is happening!!? How can I avoid this?
http://imagebin.org/92614
n.b originally posted on serverfault.com, moved to stackoverflow.com as requested
I'm using the httpcompression module from blowery. It works great with asp.net mvc except on the root url, www.samplesite.com/. On all others it's great, www.samplesite.com/Countries for example.
Is anyone here using this module or any other compression module with asp.net mvc ?
I need an example how to display the strings that I have marked up with simple html into a TextView. I have found "Spanned fromHtml(String source)", but I don't know how to plug it into my java code.
Here is my Java:
package com.SorenWinslow.TriumphHistory;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
public class TriumphHistory extends ListActivity {
String[] HistoryList;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ArrayAdapter<String> adapter;
HistoryList = getResources().getStringArray(R.array.history);
adapter = new ArrayAdapter<String> (this,R.layout.historylistlayout,HistoryList);
setListAdapter(adapter);
}
}
Here is a sample of history:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="history">
<item><b>1883</b><br/>Some stuff happened</item>
<item><b>1884</b><br/>Some more stuff happened <i>before</i> the other stuff
</item>
<resources>
Here is my historylistlayout.xml:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center_vertical"
android:textColor="#ffffff"
android:background="#000050"
android:layout_marginTop="5px"
android:minHeight="?android:attr/listPreferredItemHeight"
android:padding="3px"
android:textSize="8pt" android:layout_gravity="top|left"/>
And here is my main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:textColor="#ffffff"
android:background="#000080"
android:isScrollContainer="true"
android:layout_height="fill_parent"
android:layout_width="fill_parent" android:scrollbarStyle="insideOverlay">
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:dividerHeight="1px"/>
</LinearLayout>
Consider the log in page on NerdDinner.com: http://www.nerddinner.com/Account/LogOn
Some nice features:
jQuery effects on the OpenID choice
popups for the other major providers
Is this revision of the NerdDinner AccountController and its View available for public download? How would you reinvent this implementation? Any code you can post would be fine.
Calling Jon Galloway!
Hi,
I have a UILabel tha contains a URL (ie www.google.com). Is there a way to display the label as URL so the User can tap on the URL for Safari to open it?
Same question I have for a mailto item (ie [email protected]) to open mail with a new email to that address
thanks in advance
Hi,
I having a hard time to consume this webservice https://www.arello.com/webservice/verify.cfc?wsdl in my rails application.
I successfully generated the ruby files with the wsdl2ruby.rb but when un run the generated script I get the following error:
at depth 0 - 20: unable to get local issuer certificate
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
I also tried to connect via this script but same issue
require 'http-access2'
client = HTTPAccess2::Client.new()
client.ssl_config.set_trust_ca('/arello.cert')
puts client.get('https://www.arello.com/webservice/verify.cfc?wsdl').content
Any ideas?
Thanks
Currently, FCBKcomplete created new tags after you type something in and press enter. Is there a way to get the plug-in to allow for comma's (which is how tags are commonly separated) to create new tags?
I'd hate to have to try to retrain users to user enter as opposed to the more standard comma separator.
Plugin: http://www.emposha.com/javascript/fcbkcomplete.html
Demo (use the second control): http://www.emposha.com/demo/fcbkcomplete_2/
Hi,
I'm trying to create a SlidingDrawer with LinearLayout content over a FrameLayout.
At first it all seems fine, I get my SlidingDrawer's handle at the bottom of the screen.
But then, if I start dragging the handle up and the content starts showing, it gets clipped by the border rectangle of the handle. If I drag the handle all the way up the entire content eventually gets shown, however if I now drag the handle down, it will be clipped by the border rectangle of the content. Also, if the handle is all the way up, as soon as I start dragging it the whole content disappears.
I can still click on where the handle should be on the screen, drag it and the content would show, but I need to guess where the handle is.
What seems to be causing this is the fact that I have a SurfaceView in the xml file just before SlidingDrawer.
Removing the view from the xml solves this problem, however I need this view.
Here's the xml:
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Removing this DrawView from here solves the problem -->
<com.package.DrawView
android:id="@+id/main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<SlidingDrawer
android:id="@+id/SlidingDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:allowSingleTap="true"
android:animateOnClick="true"
android:handle="@+id/slideHandleButton"
android:content="@+id/contentLayout"
android:padding="10dip">
<Button
android:id="@+id/slideHandleButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/sliding_button">
</Button>
<LinearLayout
android:id="@+id/contentLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button
android:id="@+id/clearButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test">
</Button>
</LinearLayout>
</SlidingDrawer>
</FrameLayout>
Java:
package com.package;
import android.app.Activity;
import android.os.Bundle;
public class SlideTest extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
package com.package;
import android.content.Context;
import android.util.AttributeSet;
import android.view.SurfaceView;
public class DrawView extends SurfaceView
{
public DrawView(Context context, AttributeSet attrs) {
super(context, attrs);
}
}
Edit: I just noticed that if DrawView extends View and not SurfaceView this problem goes away.
However, I'm using a dedicated drawing thread and according to the documentation (and LunarLander example) when using a dedicated drawing thread, it should draw to a SurfaceView.
Any help would be greatly appreciated!
I need to convert a string of text containing a long url into the same string but with a tinyurl (using the tinyurl api). eg. convert "blah blah blah /http://example.com/news/sport blah blah blah" into "blah blah blah http://tinyurl.com/yaeocnv blah blah blah".
How can it be done? PLEASE NOTE I added a slash before the long url as I'm only allowed to post one link
Im attempting to make use of dependency injection in Jboss AS 7 and im having huge difficulties.
I have setup a EAR which contains both a EJB jar and a war.
The war contains a richfaces web app.
Im attempting to inject an EJB from the ejb jar into a faces managed bean with the code below :
public class UserController {
@EJB(mappedName="UserService")
private UserFacadeService userService;
public String getService(){
if(userService == null){
however when i deploy jboss puts the error in the console :
rolled back with failure message {"Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"GoodByeJohnEAR.ear\".\"GoodByeJohnWeb-1.0-SNAPSHOT.war\".component.\"managed-bean.za.co.gbj.UserController\".START missing [ jboss.naming.context.java.module.GoodByeJohnEAR.\"GoodByeJohnWeb-1.0-SNAPSHOT\".\"env/za.co.gbj.UserController/userService\" ]","jboss.deployment.subunit.\"GoodByeJohnEAR.ear\".\"GoodByeJohnWeb-1.0-SNAPSHOT.war\".jndiDependencyService missing [ jboss.naming.context.java.module.GoodByeJohnEAR.\"GoodByeJohnWeb-1.0-SNAPSHOT\".\"env/za.co.gbj.UserController/userService\" ]","jboss.naming.context.java.module.GoodByeJohnEAR.\"GoodByeJohnWeb-1.0-SNAPSHOT\".\"env/za.co.gbj.UserController/userService\".jboss.deployment.subunit.\"GoodByeJohnEAR.ear\".\"GoodByeJohnWeb-1.0-SNAPSHOT.war\".module.GoodByeJohnEAR.\"GoodByeJohnWeb-1.0-SNAPSHOT\".2 missing [ jboss.naming.context.java.module.GoodByeJohnEAR.\"GoodByeJohnWeb-1.0-SNAPSHOT\".env/UserService ]"]}
09:03:50,576 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) Starting deployment of "GoodByeJohnEAR.ear"
09:03:50,670 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "GoodByeJohnWeb-1.0-SNAPSHOT.war"
09:03:50,670 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) Starting deployment of "GoodByeJohnEJB-1.0-SNAPSHOT.jar"
09:03:51,367 WARN [org.jboss.as.server.deployment.service-loader] (MSC service thread 1-2) Encountered invalid class name "com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor" for service type "com.sun.faces.spi.injectionprovider"
09:03:51,367 WARN [org.jboss.as.server.deployment.service-loader] (MSC service thread 1-2) Encountered invalid class name "com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection" for service type "com.sun.faces.spi.injectionprovider"
09:03:51,375 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-8) JNDI bindings for session bean named UserFacadeBean in deployment unit subdeployment "GoodByeJohnEJB-1.0-SNAPSHOT.jar" of deployment "GoodByeJohnEAR.ear" are as follows:
java:global/GoodByeJohnEAR/GoodByeJohnEJB-1.0-SNAPSHOT/UserFacadeBean!za.co.gbj.UserFacadeService
java:app/GoodByeJohnEJB-1.0-SNAPSHOT/UserFacadeBean!za.co.gbj.UserFacadeService
java:module/UserFacadeBean!za.co.gbj.UserFacadeService
java:global/GoodByeJohnEAR/GoodByeJohnEJB-1.0-SNAPSHOT/UserFacadeBean
java:app/GoodByeJohnEJB-1.0-SNAPSHOT/UserFacadeBean
java:module/UserFacadeBean
09:03:51,406 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named UserFacadeBean in deployment unit subdeployment "GoodByeJohnWeb-1.0-SNAPSHOT.war" of deployment "GoodByeJohnEAR.ear" are as follows:
java:global/GoodByeJohnEAR/GoodByeJohnWeb-1.0-SNAPSHOT/UserFacadeBean!za.co.gbj.UserFacadeService
java:app/GoodByeJohnWeb-1.0-SNAPSHOT/UserFacadeBean!za.co.gbj.UserFacadeService
java:module/UserFacadeBean!za.co.gbj.UserFacadeService
java:global/GoodByeJohnEAR/GoodByeJohnWeb-1.0-SNAPSHOT/UserFacadeBean
java:app/GoodByeJohnWeb-1.0-SNAPSHOT/UserFacadeBean
java:module/UserFacadeBean
09:03:51,577 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) Service status report
New missing/unsatisfied dependencies:
service jboss.naming.context.java.module.GoodByeJohnEAR."GoodByeJohnWeb-1.0-SNAPSHOT".env/UserService (missing)
service jboss.naming.context.java.module.GoodByeJohnEAR."GoodByeJohnWeb-1.0-SNAPSHOT"."env/za.co.gbj.UserController/userService" (missing)
Please assist!
Hello,
In a LAMP environment, if a user authenticates itself on example.com domain, hosted on server1, how can i keep him logged in on forum.example.com, hosted on server2 ?
Thank you in advance for your advise.
Hello, I implemented IDispatchMessageInspector and in method AfterReceiveRequest I can receive name of method (action) that calling from client like this request.Headers.Action. Can I found name of service that where this method was implemented? For example I have service Test and two methods Start and Stop and request.Headers.Action for this method like this request.Headers.Action "http://bla.my.com/Start" and "http://bla.my.com/Start" How Can I found name Test and possible this or impossible?
Normally, this can't be done. I have written a class which wraps around the usual Storekit functionality and will allow an app to behave (while running on the simulator) as if the Storekit transaction had succeeded.
I have written a blog post about the design decisions behind the code, which can be read here and includes a download link:
http://code-evolution.blogspot.com/2010/05/evolved-code-example-1-simplestore-for.html
Or you can just grab the sample project from this location:
simplestoreevolved.googlecode.com/files/SimpleStoreEvolved.zip
Enjoy
T.
I have a problem.
When I updated Android SDK tool to version 17 and the ADT to 17 I can't use ksoap2 any more.
I start the app and get this error:
03-25 20:13:49.995: E/AndroidRuntime(555): FATAL EXCEPTION: main
03-25 20:13:49.995: E/AndroidRuntime(555): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
03-25 20:13:49.995: E/AndroidRuntime(555): at com.alcad.pernat.praksa.SplashScreen.pridobiDanasnjo(SplashScreen.java:124)
03-25 20:13:49.995: E/AndroidRuntime(555): at com.alcad.pernat.praksa.SplashScreen.onCreate(SplashScreen.java:73)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.os.Handler.dispatchMessage(Handler.java:99)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.os.Looper.loop(Looper.java:123)
03-25 20:13:49.995: E/AndroidRuntime(555): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-25 20:13:49.995: E/AndroidRuntime(555): at java.lang.reflect.Method.invokeNative(Native Method)
03-25 20:13:49.995: E/AndroidRuntime(555): at java.lang.reflect.Method.invoke(Method.java:521)
03-25 20:13:49.995: E/AndroidRuntime(555): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-25 20:13:49.995: E/AndroidRuntime(555): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-25 20:13:49.995: E/AndroidRuntime(555): at dalvik.system.NativeStart.main(Native Method)
I should get String with some numbers but instead I get this error.
I was using ksoap2-2.5.4.jar and tried the new ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar.
I'm using Eclipse indigo, Ubuntu 11.04.
The code looks like this:
SoapObject Request =new SoapObject(NAMESPACE,METHOD_NAME); // Here I get the error
SoapSerializationEnvelope soapEnvelope=new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet=false;
String tmp=odstejDatum(datum);
Request.addProperty("datumod",tmp);
Request.addProperty("datumdo",datum);
Request.addProperty("tip_lme",1);
@SuppressWarnings("deprecation")
HttpTransportSE aht=new HttpTransportSE(URL,5000);
soapEnvelope.setOutputSoapObject(Request);
//
aht.call(SOAP_ACTION_DANASNJI,soapEnvelope);
Object response= soapEnvelope.getResponse();
Thanks for the help.
I've got in-place editing on a page in my app (using Rails 2.3.5 and jQuery). I want to know how to display an error on the page when the update fails.
I'm using ajax (an XMLHttpRequest) to save an update to a Comment object. The controller has an update method like this:
def update
@comment = Comment.find(params[:id])
respond_to do |format|
# if @comment.update_attributes!(params[:comment])
if false #deliberately forcing a fail here to see what happens
format.json { render :nothing => true }
else
format.json { render :json => @comment.errors, :status => :unprocessable_entity }
end
end
end
In Firebug, I can see the server returns a "422" (an appropriate validation error status code). But it's a response to an XMLHttpRequest so there is no redirect to an error page.
I think I actually want to do this:
format.json { render :json => @comment.errors}
or maybe this:
format.json {render :json => { :status => :error, :message => "Could not be saved" }.to_json, :status => 400 }
and trigger some Javascript function that iterates through (and displays) any errors.
I'm using a rails plugin http://github.com/janv/rest_in_place/ to implement the in-place editing. It doesn't appear to have any callback function to handle a failure. What are my options? Can I write some Javascript to respond to a failure condition without hacking the plugin? Do I have to hack the rest_in_place plugin to handle a failure condition? Is there a better plugin (for Rails or jQuery) that handles in-place editing, including failure conditions?
UPDATE
This post from Peter Bui (http://paydrotalks.com/posts/45-standard-json-response-for-rails-and-jquery) was helpful in showing how to handle an error message from the server using XMLHttpRequest.status. I looked at his implementation of a blog using ajax (http://github.com/paydro/talks). I'm surprised at the complexity required to handle a simple error condition. Usually Rails has all the goodness baked in but it seems server errors with JSON are out of scope. Can that be?
I also looked at grimen's validatious-on-rails (http://github.com/grimen/validatious-on-rails/) which accommodates models validations when ajax XMLHttpRequest is used. It's not clear to me how I'd use it to handle the general case of a "save" failing when validations succeed.
P.S.
Please vote me up... so I can use more than one HTML link when I ask my question :-)
I have a master page which references a style in the following manner:
<link rel="stylesheet" type="text/css" href="../../Content/Style.css" />
All my pages inherit from this master page. And this works well when the URL is http://www.domain.com/home/details/5, however the URL is http://www.domain.com/home/create, then, of course, Style.css cannot be found because `../../Content/Style.css' resolves to a directory one higher where there is nothing there.
How is this typically handled?