Skip to content

Microsoft ISA Server Authentication in Android

I have an application in Android, in which I were reading files from the remote server, code for reading file is given below; Now all the remote files are behind proxy (Microsoft ISA Server) which required authentication to access the files. Please guide me how I can pass authentication parameters from androi…

Java: Get week number from any date?

I have a small program that displays the current week from todays date, like this: And then a JLabel that displays the week number: So right now I’d like to have a JTextField where you can enter a date and the JLabel will update with the week number of that date. I’m really not sure how to do this…

Spring fails to inject entity manager factory

I writing tests for my DAO classes using JPA, with Hibernate as JPA provider, and Spring 3.2. I am not able to inject the entity manager correctly, I get a NullPointerException when trying to access it. My GenericDAO implementation looks like this: The class of the test looks like this: My root-context.xml is…

JUnit Tests for GUI in Java

I would like to write test cases for a GUI. I want to know how do you simulate a click of JButton, or how do you extract the elements of a JTable. For the purpose of this, I have built a simple GUI that increase the count by 1 if the button is clicked and the JTextfield is empty, but

How to use named parameter in plain sql with jooq

I’m using JOOQ with plain/raw SQL, so that means i’m not using any code generation or the fluid DSL thingy. The following code works: Now let’s say i have a query with multiple parameters like this: How do i use a named parameter with these types of queries? I’m thinking something like…

Switch listener in ListView giving wrong results

Here is my Array adapter. It assigns each switch button in the list with a listener that is dependant on the id given by the database (passed using devices.id). But for some reason, the switch listener is getting the correct states from the switches. For debugging purpose, I’m just using the same on cha…

Does .asSet(…) exist in any API?

I’m looking for a very simple way to create a Set. Arrays.asList(“a”, “b” …) creates a List Is there anything similar for Set ?