Posts

Showing posts from February, 2013

Change button text and action - android development

      final Button testButton = ( Button ) findViewById ( R . id . button1 ); testButton . setTag ( 1 ); testButton . setText ( "Edit" ); testButton . setOnClickListener ( new View . OnClickListener () { @Override public void onClick ( View v ) { final int status =( Integer ) v . getTag (); if ( status == 1 ) { mPlayer . start (); testButton . setText ( "Done" ); v . setTag ( 0 ); //pause } else { testButton . setText ( "Edit" ); v . setTag ( 1 ); //pause }

Layout resource inflate in Android

One thing that often confuses developers new to the Android platform is the handling of layout resources. The xml files describing the layouts are magically transfered into a more efficient binary format behind the scenes and hidden away - leaving the developer with a static reference to the resources via the R.java file. By using the setContentView(int layoutResId) method of the Activity class your layout will be displayed on the screen. Behind the scenes the Android platform is creating all the view objects contained in your layout xml file provided to the setContentView(int layoutResId) method. This process of creating view objects out of layout resources is referred to as layout inflation. So far so good. This means that before the setContentView(int layoutResId) method is called the findViewById(int resId) method will return null for any view references in the layout, causing some potential NullpointerExceptions . @Override public void onCreate ( Bundle savedI

Download Android USB Drivers For Samsung, HTC, ASUS, Sony, LG And Other Devices [Windows]

Image
The question does arise, why would you need USB drivers for your Android smartphone or tablet? And, if they’re so important, how come you haven’t had to install those for most of your devices? The answer to this can be multi-faceted. For one, it depends on which Windows version you’re using. In the later iterations of the operating system, Windows update can serve USB drivers for many Android devices from reputable OEMs (Original Equipment Manufacturers). Then, since most of these devices connect, by default, in USB (mass) storage mode, a generic driver can suffice. At still other times, you may have installed an accompanying PC suite or like for your handset, and that, in turn, would’ve set up the proper drivers, too. As I said, there can be various scenarios, each with its own explanation. However, things play out a little differently when you connect your Android device in USB debugging mode, an essential requirement for application development in Windows, and for m

How to use Java if it's been blocked in Firefox for Mac or Windows

Image
Activate Java once When you see the "Click here to activate" message, simply click it to load the Java content normally. Note: The next time you visit the site or any other that uses Java you will see this message again. Always activate Java for a site If you have a trusted site that uses Java and you need to use that site often, you can make Java work normally on just that website. Click the red plugin icon in the address bar and a message window will open. At the bottom of the message window, click the Activate All Plugins dropdown menu and choose Always activate plugins for this site . Now, whenever you visit this site, the plugin will automatically run and you won't get the "Click to activate" message.

I can't find firefox to enable Java on my Mac

Image
Question:     I just got a new Macbook Pro and have noticed that I cannot access any sites that use java in Firefox. I have verified that I do have the latest Java installed and it works fine in safari, and when I do a software update there is nothing to update. I tried to go into the preferences to see if there is a checkbox to enable it, but there is nothing there, just for javascript - but I need Java. How can I get firefox to recgonize that I have Java and work? I do also have the java plugins installed and both are enabled. This happened Every time Firefox opened == Since I've downloaded firefox last week Helpful replies I have found a solution. I re-downloaded firefox and installed it. Repoened firefox, tried again and now all works. zzxc 22 solutions 242 answers Posted 6/4/10 12:26 PM Java is enabled by default. There is no longer a checkbox fo

JAX-WS Deployment Five Minute Tutorial

After we explained how we can implement a JAX-WS web service (endpoint, client) in the JAX-WS Five Minute Tutorial , we will continue by explaining how we can deploy the web service endpoint on any application server... and here we'll use Tomcat. To deploy your WS endpoint you need to package it as a war first then deploy it on your application server. Note:- You can download the source code for this example from the resources section. Ok, lets begin  1) Open Eclipse. 2) Create a new Web project . 3) Create your Web Service interface (Greeting): package com.webservices; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface Greeting { @WebMethod String sayHello(String name); } 4) Create your Web Service implementation (GreetingImpl): package com.webservices; import javax.jws.WebService; @WebService(endpointInterface = "com.webservices.Greeting") public class GreetingImpl implements Greeting { @Override public

JAX-WS Five Minute Tutorial

This tutorial is for people who want to run a JAX-WS example (Endpoint + Client) in just five minutes. What you need to run this example: JDK 1.6 Eclipse . Be Excited ;)  Note:- You can download the source code for this example from the resources section.  Developing WebService End Point 1) Open Eclipse, and create a java project "WS-Server". 2) Create WS-Service Endpoint Interface: package com.webservices ; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface Greeting { @WebMethod String sayHello(String na

Web service with JAX-WS in Eclipse

Image
In this tutorial, I'll show you how to use JAX-WS to build a web service in Eclipse. JAX-WS stands for Java API for XML Web Services. You can use it to build web services and clients that communicate using XML messages. We are not using the built-in web service generation tool provided by Eclipse. How to build a sample client will be explained in a future blog post. The basic steps for building a web service: Code the implementation class Annotate the class Use wsgen to generate web service artifacts Deploy in Glassfish from Eclipse 1. Code the implementation class First create a dynamic web project in Eclipse. I called my project webservice , but you call your project anything you like. Make sure the target runtime is Glassfish, and select Minimal Configuration in the configuration screen. In the next screen, accept the default output folder or choose a custom one. Memorize the output folder, because we need this when we generate the web service artifact

How to install Spring IDE in Eclipse

Image
Spring IDE is a very useful graphical user interface tool adding support for Spring Framework. In this tutorial, we show you two ways to install Spring IDE in Eclipse. Version used in this tutorial : Spring IDE 2.9 Eclipse 3.7 1. Install New Software Classic way, Eclipse IDE, click “ Help ” -> “ Install New Software …”. Type “ http://springide.org/updatesite ” to access the Spring IDE update site. Select all the Spring IDE features you want to install. Take long time to install and restart Eclipse after finished. 2. Eclipse Marketplace This is the prefer way, because you no need to remember the long Spring ide update URL. In Eclipse IDE, click “ Help ” -> “ Eclipse Marketplace “, type “ Spring IDE “, follow the wizard to finish the installation. Same, take long time to install and restart Eclipse after finished.