Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 106

dedey
Lost but trying
Profile
Posts: 2
Reg: Feb 14, 2012
mas
20
02/14/12 08:38 PM (13 years ago)

creating a android application for final project

I have to create android apps for my final project. I want to create a network tracer to trace internet flow. I've create the coding in JCreator and I've transfer it to Eclipse but it can't work. I don't know how to fix it. can anyone help me? this is my coding. package com.muo.network; import java.net.*; import java.io.*; import java.util.*; public abstract class Network{ public static void main(String[] args)throws IOException { BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); String str; int bil; System.out.print(\n\t\t\t***NETWORK TRACER*** ); System.out.print(\n Welcome to Android Network Tracer! ); System.out.print(\n\n\n); System.out.print(\n\t\t ========\t ============== ); System.out.print(\n\t\t |1. ping |\t |2. traceroute| ); System.out.print(\n\t\t ========\t ============== ); System.out.print(\n\n); str=stdin.readLine(); bil=Integer.parseInt(str); { if(bil==1) { System.out.println(ping\n); String ip=args[0]; String pingResult = ; String pingCmd = ping + ip; System.out.print(\n\t\t You have entered: ); System.out.print(\n\t\t ===================== ); System.out.print(\n\t\t\t +ip+ ); System.out.print(\n\t\t ===================== ); System.out.print(\n); try { Runtime r = Runtime.getRuntime(); Process p = r.exec(pingCmd); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { System.out.println(inputLine); pingResult += inputLine; } in.close(); } catch (IOException e) { System.out.println(e); } } else if(bil==2) { System.out.println(traceroute\n); String trace=args[0]; String tracertResult = ; String tracertCmd = tracert + trace; System.out.print(\n\t\t You have entered: ); System.out.print(\n\t\t ===================== ); System.out.print(\n\t\t\t +trace+ ); System.out.print(\n\t\t ===================== ); System.out.print(\n); try { Runtime r1 = Runtime.getRuntime(); Process p1 = r1.exec(tracertCmd); BufferedReader in = new BufferedReader(new InputStreamReader(p1.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { System.out.println(inputLine); tracertResult += inputLine; } in.close(); } catch (IOException e) { System.out.println(e); } } else { System.out.println(invalid); System.exit(0); } } } } thanks.. n sorry for my bad English.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/15/12 01:42 AM (13 years ago)
Are you adding this to a buzztouch project or a custom project? If you're adding it to a custom project (not using buzztouch to build the app) you'll have a hard time getting help on this forum. This forum is mostly used by people working with apps they created using the online control panel here, at buzztouch.com. This also means that the majority of them don't have a deep enough understanding of the java programming language to guide you along.
 
dedey
Lost but trying
Profile
Posts: 2
Reg: Feb 14, 2012
mas
20
like
02/15/12 01:46 AM (13 years ago)
oh. sorry.. but I couldn't understand buzztouch to build the app. thanxs
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.