Tag: java

Encryption using AES-128 in Android and IPhone (Different result)

I am trying to encrypt some text using the AES algorithm on both the Android and IPhone platforms. My problem is, even using the same encryption/decryption algorithm (AES-128) and same fixed variables (key, IV, mode), I get different result on both platforms. I am including code samples from both platforms, that I am using to […]

java.text.ParseException: Unparseable date: “2014-06-04” (at offset 5)

I want to parse the date into a desired format but i am receiving an exception every time. i know it is easy to implement but i am facing some problem don’t know where exactly.: Exception: java.text.ParseException: Unparseable date: “2014-06-04” (at offset 5) Following is my code: private String getconvertdate(String date) { DateFormat inputFormat = […]

AndroidStudio emulator “won't run unless you update Google Play Services”

I have this problem with my emulator, i’m using API 5.1.1 and i have the lastest version of Google Play Services from SDK Manager. AndroidManifest.xml: <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> In the build.grable: compile ‘com.google.android.gms:play-services:+’

Cookie manager causing fatal signal 11

My app silently crashes (no force close popup) when i try to set a cookie on the cookiemanager. mHttpClient.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false); HttpGet http_get = new HttpGet(url); HttpResponse response = mHttpClient.execute(http_get); for(Cookie cookie : mHttpClient.getCookieStore().getCookies()) { Log.d(AppPreferences.TESTTAG,”cookie = ” + cookie.getName()); if(cookie.getName().equals(“SACSID”) || cookie.getName().equals(“ACSID”)) { response.getEntity().consumeContent(); String cookieString = cookie.getName() + “=” + cookie.getValue() + “; domain=” […]

What is the difference between `opencv.android.JavaCameraView` and `opencv.android.NativeCameraView`

Exacly as stated in the subject: What is the difference between opencv.android.JavaCameraView and opencv.android.NativeCameraView. What are advantages one over the other, the main ones, which gives more options?

Check if String in String is in ArrayList<string>

I just built a Broadcast Receiver with which I can get the incoming text messages, than I split the text message when there’s a space and save it into a String[]. Now I need to check if in this String[] is something from my database. For that I created a ArrayList<String>, which gets all the […]

How to handle AsyncTask failure

Is there a specific way to handle failure in an AsyncTask? As far as I can tell the only way is with the return value of task. I’d like to be able to provide more details on the failure if possible, and null isn’t very verbose. Ideally it would provide an onError handler, but I […]

requestDisallowInterceptTouchEvent does not work unless selecting view first

According to android docs you can get your parent ViewGroup and call requestDisallowInterceptTouchEvent(true) on it to stop other things from interfering. This causes not only the immediate parent but any other parent objects that might intercept the touch to ignore it for the duration of the particular event… This sounds great and seems to work […]

How to pass parameter to a webservice using ksoap2?

I’m using Eclipse IDE to develop an android app. I’m trying to connect to a .net webservice. I’m using ksoap2 version 2.3 When I’m calling a webmethod with no parameters, it works fine. When I come to pass a parameter to the webmethod, I get null (while debugging the webservice I discovered that) and I […]

JSON `date(…)` to `java.Util.Date` using `org.json`

I’m learning Java and writing an android app that consumes a JSON object that is passed by the server. I have it all working except the dates. I get one of these back ‘SomeKey’:’\/Date(1263798000000)\/’ I am using org.json.JSONObject. How do i convert SomeKey into a java.Util.Date?

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.