Java Question Library creation experimenting

giga

Well-Known Member
Licensed User
Longtime User
I have been testing making libraries for B4A and B4J.

I am trying this code but receiving the following errors.

The value of the field GetName.ba is not used
The value of the field GetName.eventName is not used



private BA ba;
private String eventName;

Any guidance would be appreciated.


B4X:
package com.get.testname;


import anywheresoftware.b4a.BA;
import java.net.InetAddress;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;



@ShortName("GetName")
@Author("giga")
@Version(1.0f)
@ActivityObject
@DependsOn(values = { "GetName" })



/**

* Created with Basic4Android Library Generator - by XverhelstX

*/

public class GetName{

private BA ba;
private String eventName;
private GetName getname;



public void Initialize(final BA ba, String EventName) {
EventName.toLowerCase(BA.cul);
this.getname = new GetName();

}

public GetName getGetName() {
return this.getname;

}

public void setGetName(GetName getname) {
this.getname = getname;

}

public byte getaddress() {
return this.getname.getaddress();

}

public String getHostAddress() {
return this.getname.getHostAddress();

}

public String getHostName() {
return this.getname.getHostName();

}

public InetAddress getAllByName() {
return this.getname.getAllByName();

}

public InetAddress getByName() {
return this.getname.getByName();

}

public InetAddress getLocalHost() {
return this.getname.getLocalHost();

 }

}
 

giga

Well-Known Member
Licensed User
Longtime User
Thanks for the guidance.
I started with this code in eclipse then ran it through Simple Library compiler

B4X:
package com.get.testname;

import org.omg.CORBA.portable.UnknownException;


public class GetName{
 
 /**
  * returns address in byte format
  */

 public byte[] getaddress() {
 return getaddress();
 
}
 /**
  * returns address in byte format
  */
 
 public String getHostAddress() {
 return getHostAddress();

 
}
 /**
  * returns the IP or hostname address of this inetadress. it can be returned as and array of bytes or a string 
  * of the form "192.168.1.1"
  */
  
 public String getHostName() {
 return getHostName();
 }
 /**
  * returns only one address for the specified hostname
  */
 public static InetAddress[] getAllByName(String hostname) throws UnknownException {
 return getAllByName(hostname);
 
 } 
 /**
  * returns an array of all given addresses for the specified hostname
  */
 public static InetAddress[] getByName(String hostname) throws UnknownException {
 return getByName(hostname);
}
 /**
  * returns inetaddress of the local machine
  */
 public static InetAddress[] getLocalHost() throws UnknownException {
 return getLocalHost();
 }
}
 
Top