I am a beginner on android platform, and I want to build a tracerouting app. So these are my queries:
Is it possible to make such an application in Android? if possible then guide me the way that I follow.
Does Android support low-level programming to capture ICMP packets? or do I need to add some kind of JAR (in java) or some other libraries to support this application?
In Java, there are JPCAP and docjar etc kind of libraries that we can import in our IDE or Eclipse so that Java support for making such kind of API's?
I need valuable suggestions.
It's quite late - but someone might see it.
i found this one and it worked for me:
https://github.com/olivierg13/TraceroutePing
The simplest way I can think of is to just check for the traceroute Linux application, execute it, and parse its output.
Android has full networking support, however, Java doesn't expose an interface to alter the IP header. Hence, manually crafting ICMP packages is out of the question (JPCAP is no help here, since it relies on libpcap, which I suppose you won't find on any vanilla installation).
Another possible solution is to use the NDK and create a small library that handles the low-level number crunching. However, I'm not sure if the NDK would allow you to use setsockopt.
This is working pretty well for me, you may have to filter out the string results.
To add this library, you have to download or clone the git repository and implement the folder "library" just as he does in the other module "app" for it to work properly.
Related
One of my friends suggested to use c++ support in Android studio in order to hide passwords. I have found tons of tutorials how to get started with ndk in android. But they are all outdated(2015) and everytime I try to use c++ in any way, Android studio crashes. Is there any way to do it in a simpler way now?
P.S./ I want to get rid of experimental plugin that every one uses.
Little off the question, storing passwords in the native layer does not ensure complete safety. A good hacker can get that as well. It is just that you add another additional layer so one has to dig deeper
We have a setup where we want to use https://ship.io/ as our cloud-based continuous-integration server.
However we also want to have some kind of static code analysis (preferably SonarCube but that is debatable), which isn't supported officially by ship.io.
The Projects are classic mobile Projects (Android and iOS).
I have seen some posts of people mentioning that they managed to setup this kind of configuration. SonarCube just has released a gradle plugin http://www.sonarsource.com/2015/06/15/sonarqube-gradle-1-0-released/ so the Android part should be doable.
However at the moment i have no idea what would be the best way do do this for the iOS part of the project.
We already contacted the ship.io team on this issue but did not recieve a response yet.
Any suggestions/insights on this?
My name is Tim Rosenblatt and I'm one of the senior engineers here at Ship.io. I'm not sure why you didn't get a reply from our support email, and I'm glad you posted about this here.
As Viktor mentioned, we definitely support custom scripts. You absolutely can run whatever you like during your build process with this type of step.
I've got a few links that should be helpful for you in getting SonarCube added to your Ship job, but you can definitely get in touch with us if anything isn't clear enough for you. You can use the in-app support icon at the bottom right of your dashboard, or just email me personally -- tim at ship dot io
http://support.ship.io/environment/install-software
http://support.ship.io/environment/custom-shell-scripts
Thanks!
You should be able to write a script (bash, ruby, ...) which runs your static code analysis and then call that script on your own Mac or on any CI which supports running custom scripts. AFAIK ship.io does support this, our service (https://bitrise.io/ - CTO here) certainly does.
Is there a handy-dandy equivalent to org.apache.commons.beanutils.PropertyUtils on Android?
I can't seem to use bean utils in my android app due to some dependencies on PropertyDescriptor,and IndexedPropertyDescriptor. So I'm wondering if there are any alternatives?
Basically all I want to do is use a method name as a string "someMethod" and feed that into setMethod(anObject, "someMethod", value), much like PropertyUtils does; but without having to resort to the nasties of reflection...
Or are my hands tied and I need to use Reflection?
There is bridge library which works on Android: android-java-air-bridge.jar. Just include into project path and use all apache beanutils features in your Android project as you could use in ordinary java application. Moreover, there are lot of other classes which moved to this Android supporting library. Look at the list.
There is a possibilty to use libraries or write own code depending on the PropertyUtils. But it sure isn't dandy. You can get the general idea about what has to be done in this thread.
There are apparently some projects who have successfully solved the issue, so you can study thier solution. Take a look at Drawingpad-base and libgdx. You can find PropertyUtils in the package com.madrobot.beans in the first project and com.badlogic.gdx.beans in the second.
I know there is a dedicated area for Android issues, BUT I just want to know if there's an option to program to Android in C or in Java, and what will be the best language to write apps for Android.
This info you can't find in the Android area...
Thanks !!
Android practically is java.
Just read some how to start tutorials and you will see theres not much difference to conventional java applications.
It is Java with some platform dependent features.
SDK:
http://developer.android.com/sdk/index.html
DevGuides:
http://developer.android.com/guide/index.html
The Android API is in Java. You can find the developer guide here.
For performance-critical code, you can use the Android NDK.
Android's comprehensive java SDK makes it a lot easier to write apps in Java. You should check out the getting started page on their developer site.
The best? Java.
You can also write in C/C++ with the NDK.
And you can also write with Python or, say, Scala, but is not easy at all.
Java is the best because the API is Java, so all the documentation is in Java. Equally important, Google's ADT plugin to program Android in Eclipse is super easy, so you are going to work with an IDE, no need to advanced text editors and so.
Android applications are java based. (although I heard new NDK support development of full application in C).
It is possible to develop some libraries in c/c++ and load them to your application using JNI, which is also a Java feature. Start from here: http://developer.android.com/index.html I know it seems to general, but the official site is a great place to start from.
You use Java to program Android. It says it in the documentation for development for Android.
You can also use the NDK but don't start with that.
I would like to know if SNMP is supported in Android(2.1)?
If it is not available, is it possible to port the snmp source for Android?(some pointers plz..)
If it is available, how can I test the presence of it in my device.
All pointers are welcomed.
Thanks,
Sen
SNMP4J 2.x can be directly used on Android without changing its sources. The logging can be set to a simple console logger by calling
static {
LogFactory.setLogFactory(new ConsoleLogFactory());
ConsoleLogAdapter.setDebugEnabled(true);
}
in your root activity. Of course, you can implement a Android Logging Adapter too and register it as shown above.
I know this is a really old question, but I was doing exactly what you're asking. The short answer is no, by default, SNMP is not supported on android 2.1. Because it isn't available, what I wound up doing was grabbing snmp4j's source code, and sticking it in android and making my own library. There are libraries (snmp4android comes to mind) but I found that it lacked certain classes I needed and did not have the whole snmp4j.agent branch.
There are a few dependencies and a few libraries that android is missing but most of them pertain to the log4j class.
To remedy that, just convert/make the switch to something like slf4j, which is a small logging library that you can include with your application.
I hope that answers some of your initial questions, and I hope this is still relevant even if it is an old question.