|
In worst case you can implement your interaction in C/C++ modules for each supported platform and you can bind your native code to java via native method calls but thats a lot of work especially if you have a lot of different platforms to support. But you can reach any platform specific functionality from java if you are willing to write some platform specific C/C++ for it. In your case I would go with the sound api the guys already linked if its enough to get the job done.
|
|
|
|
|
Native methods in Java? I have to learn about them.
The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.
|
|
|
|
|
You can declare a static or instance method in java and by applying the native keyword on it you indicate for the compiler that you will provide the implementation with native code, and not in java. Then you have to write a DLL (or more DLLs) that exports the native function(s) with the appropriate names. When you java program starts you have to load the needed DLLs with System.LoadLibrary() before you call the native methods. Example: http://www.javaworld.com/javatips/jw-javatip23.html[^]
I would note that you should always try to write as much code in crossplatform java as you can and don't use native methods if you can avoid them because platform dependent stuff defeats the purpose of java.
|
|
|
|
|
hey guys,can you make an array without a length.?
|
|
|
|
|
int arr[]=new int{1,2,3,4};
|
|
|
|
|
|
I have an application where I need to send the values from java applet code to html page. Please help me to send the values from java code to HTML page(may be using javascript)
My java code is,
public class Calc extends Applet
{
public int tot = 0;
public void paint(Graphics g)
{
int M1 = Integer.parseInt(this.getParameter("m1"));
int M2 = Integer.parseInt(this.getParameter("m2"));
int M3 = Integer.parseInt(this.getParameter("m3"));
int M4 = Integer.parseInt(this.getParameter("m4"));
int M5 = Integer.parseInt(this.getParameter("m5"));
int M6 = Integer.parseInt(this.getParameter("m6"));
tot=M1+M2+M3+M4+M5+M6;
this.setParameter("tot",Integer.toString(tot));
g.drawString(Integer.toString(tot), 10, 10);
}
}
|
|
|
|
|
I have this very urgent requirement of developing a code that can extract .mp3 from .flv . I have had partial success in extracting raw bytes of mp3 from it . Now why is it that when i use something like
FileOutputStream fout=new FileOutputStream("dude.mp3");
fout.write(buffer,0,len);
assuming that buffer contains all the bytes of extracted mp3 .
Can somebody perhaps give me an alternate approach which does not involve using ffmpeg . I just want to work with bytes (it's a requirement and also no external apis).
|
|
|
|
|
Member 9459463 wrote: I just want to work with bytes (it's a requirement and also no external apis). Why start by setting restrictions rather than investigating what tools are available that may help to solve your problem?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
It's an interview question .
|
|
|
|
|
Hi all, I'm working on a linux machine and I'd like to show via web services architecture some informations collected via linux shell acting with command like top, or ps.
My aim is to expose via web services informations of some processes that are running on my machine and these informations are available only via shell commands.
Now: how can I do this in Java? Is Java yhe best choice?
Any advice?
Thank you all,
Pietro
|
|
|
|
|
1. Learn how to act as a client (in a client/server setup) to get to a web service.
2. Get the information out of the returned web service call.
3. Learn how to code console output.
4. Use 3 to print the information from 2.
|
|
|
|
|
how can i begin with java language??
what java software i needed??
which source is best for self-learning??
|
|
|
|
|
You have already asked this in QA
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
to begin with java, if u know c++ is better , but if u don't know c++. u can also learn java. u should first go through java book that is "E.balaguruswamy".
u need jdk1.5/1.7.
internet is the best source to learn self....
|
|
|
|
|
A very good way to learn Java is the free course from Stanford Engineering Everywhere:
Programming Abstractions[^]
The instructor Mehram Sahami is simply great!
|
|
|
|
|
Hello Uttam Kukadiya,
First you need to learn the basics of the language.. There are many of tutorials available but you might like to take a look at this online resource:
http://www.functionx.com/java/index.htm
There is also the offical site:
http://docs.oracle.com/javase/tutorial/
The most important aspect when learning how to code in a programming language easily, quickly and effectively is writing the code YOURSELF, testing it and just play around with it by experimenting with changing the values and amongst other things.
Best of Luck!
Happy Learning!
With Kinds Regards,
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:38am.
|
|
|
|
|
How to use data grid in jsp, let me know the coding phase pleaseeeeeeeeeeeeeeeeee
|
|
|
|
|
Member 9449202 wrote: let me know the coding phase pleaseeeeeeeeeeeeeeeeee You could at least try to find out the basics by using Google.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hii frds I can't display all the components in the HTML form while working with COMMON.IO ,any solution !!!
|
|
|
|
|
You need to provide a lot more information than this if you expect some useful answers.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
upload_file_multipale_html.jsp
-----------------------------------------
<%@page import="java.io.File"%>
<title>Multipale file upload by using apache.commons.fileupload
First name:
Last name:
Specify file:
--------------------------------------------
upload_file_multipale.jsp
-------------------------------------------
<%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="" %>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory"%>
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload"%>
<%@ page import="org.apache.commons.io.FilenameUtils"%>
<%@ page import="org.apache.commons.fileupload.*"%>
<%@ page import="java.lang.Exception"%>
<center>
<p><b>First Name:</b>
<%= request.getParameter("fname")%>
<p><b>First Name:</b>
<%= request.getParameter("lname")%>
<%
String itemName="";
boolean isMultipart = ServletFileUpload.isMultipartContent(request);
if (!isMultipart){
out.println("The Form is not Multipart!!!!!");
}
else
{
FileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
List items = null;
try {
items = upload.parseRequest(request);
} catch (FileUploadException e) {
out.println(e.toString());
}
Iterator itr = items.iterator();
while (itr.hasNext()) {
FileItem item = (FileItem) itr.next();
if (item.isFormField()){
String name = item.getFieldName();
String value = item.getString();
}
else {
try {
itemName = item.getName();
itemName = FilenameUtils.getName(itemName);
File savedFile = new File(config.getServletContext().getRealPath("/")+"uploadedFiles/"+itemName);
item.write(savedFile);
session.setAttribute("FileName",itemName);
} catch (Exception e) {
out.println(e.toString());
}
}
}
}
%>
<table align="center" border="1">
<td>
<%
String FileName = (String)session.getAttribute("FileName");
File savedFile = new File(request.getContextPath() +"/uploadedFiles/"+FileName );
%>
<img src="<%=savedFile %>" width="800" height="800">
</td>
</table>
So when I am trying to run these files I can successfully upload my image and display it back but I cannot get the values that I had mentioned in the text fields and it is displaying null
|
|
|
|
|
Hi,
My name is Azeem and i'm a student of computer sciences.
i need help about my project.
i am developing an application using optical character recognition (OCR) for android system Mobiles.
i have some difficulty in choosing tools for this.
what are the best tool for developing Android application.?
i want to know is Java suitable for OCR or C# is best for OCR ?
Can we convert the java program is Android Application ?
or can we convert the C# program is Android Application ?
i am waiting for ur reply... Plz reply soon...
thank you ..
|
|
|
|
|
Why have you posted this here? You have already asked this in the C# forum, when it is a Mobile issue. Please post in one forum only as detailed in the Posting Guidelines[^].
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
Friends suggest me how to read data bytes directly from Port rather than buffer. I want to do this because i want to calculate the time between each incoming byte from serial port.
|
|
|
|