[Q] Compiling help a noob. - Android Q&A, Help & Troubleshooting

Im writing a Network Scanner currently in Python/Kivy for Android. I could do everything i wanted if i could execute a Python module called Scapy from the shell(Obviously this is a rooted app), but unfortunately its not possible. Atleast not with alot of work and when the App is finished i dont want my users to have to go through installing countless dependencies to get it working!
I've stumbled along a little unix program called Arp-Scan but i cant find a port for Android. I'm not sure how to port this to Android so i can execute it from a shell.
I have no experience with compiling and needless to say this is frustrating the hell out of me! . This one little stumbling block has been plaguing me for 2 weeks. The rest i will be able to do in pure Python, namely PortScanning and such.
The way the Android OS works is that an APK is unable to use raw sockets. But you are allowed to run a shell as root.
I have the option to use Nmap but if there was ever to be a paid version of my app i would have to buy a license and i simply cant afford it.
All i need is to execute a program from shell: like Arp-Scan to obtain an IP and MAC from the LAN.
Any help will be greatly appreciated.
Thanks in advance.

Related

Programming Java on NT-Including generating APKs

Programming Java on NT-Including generating APKs
I don't know anything about java but am trying to learn. Most of what I would like to create will be simple. It would be nice to be able to create APKs so I could pass on to others if I wished necessary.
I have not been very successful setting up a proper environment in windows or linux. There are numerous guides on the internet for each operating system. The problem is the world keeps revolving and by the time I find a guide and try to follow it to conclusion there have been changes that cause an incorrect environment which is unusable.
I remember programming on iPAQs (xscale-arm processor) both in c/c++ and c# on board the iPAQ. After looking around a little I have found several options for windows users (gui) and one for linux users (command line) to program on the NT in java.
I felt I should pass this information along for others. These will be listed windows Style(gui) first and then linux style(command line) last.
Windows Style environment(gui) :
Aide - https://play.google.com/store/apps/details?id=com.aide.ui&feature=search_result
Just install and you have a working environment which will compile android api10 example files with nearly no changes (example change=add res directory which had been left out of example). The only thing that was not apparent is to watch the notification area for any errors which give you the problem and how to correct them. Updates have been often and useful. My first choice for windows type (gui) environment. Check the web for more info and tutorials about this program.
Android Java Editor – https://play.google.com/store/apps/..._result#?t=W251bGwsMSwyLDEsImNvbS5hbmplZGkiXQ..
With this one I had to watch the video and pause it several times to decide how to get setup and use (no audio-just video). It works and creates APKs also but is a bit more involved and the learning curve of the program is higher due to no available directions.
Linux Style environment(command line):
Terminal IDE – https://play.google.com/store/apps/...cuside&feature=nav_result#?t=W251bGwsMSwyLDNd
Easy install, good tutorials, and very easy to learn. Can be used with a tether (wifi or cable) and telnet to use keyboard and screen from your pc. This one has updates since I downloaded and support is great. I couldn't get the software keyboard to work on stock 1.4.0 but works great in CM7. As a result I used hackers keyboard while on 1.4.0. Also creates APKs. Includes vim, Midnight Commander, etc. This is a thirty meg download and is twice that when installed but everything is installed in /data/apps/ folder so it had no impact on a stock 1.4.0 system.
Notes:
None of these require being rooted to setup and use. There are others but I have decided not to list them in this thread for various reasons. I feel I have chosen the easiest to get working and use and provide the end result of an APK if you desire.
I forgot to mention they are all free. I have just begun this project so I can't be any help on use of these programs or java. I'm just passing on information as I think others may find useful. The way I see this project is anything I learn (no matter how little) from this is added to my limited knowledge and certainly can't help.
Almost forgot, I use jota text editor to look at and create source files.https://play.google.com/store/apps/...51bGwsMSwxLDEsImpwLnNibG8ucGFuZG9yYS5qb3RhIl0.
Nvm, you're talking about developing for android on android
lufthanza said:
Nvm, you're talking about developing for android on android
Click to expand...
Click to collapse
Yes that is correct.

Android source code building/software development

I have been searching and searching much to no avail. Here is my dilemma: I'm interested in android development and have installed ubuntu Linux os along with other requirements outlined on the android source website but I'm having the most difficult time getting the git program to install. I constantly receive error after error. Python, jdk6, and make have all installed with no problems. Can someone point me in the direction of a step by step procedure for completely setting up my computer with the required programs necessary for android development. Any and all help is greatly appreciated!
Sent from my LG-P925 using xda premium
google developer page clearly says which packages to install and what to do, you can search here at xda too.
if you have any problem try:
remove ~/bin directory
remake it
redownload repo script
add PATH variable
chmod it for executable
remove workdir
remake workdir
cd to your working directory
init your source
linux is not about make it and it should work you need a lot of things to get by yourself and learn to pass through problems. personally I was noob too, and still think I am, but linux really learns thinking in pc usage, that's not windows "if you can't do anything, that's impossible", you just have to find other way
it will be hard to start without linux knowledge, try using it first for a month then start development. you'll also need some xml and makefiles editing to know.
what you'll need
if you have cyanogenmod sources it's easy, you probably have everything that's needed,
if you use google's, then it's harder, because you miss drivers, device tree can fit from cm but you need to edit it.
you can find usb connection setup painful with editing udev rules, but with some practise it will be easy.
and please, for everyone to know: don't PM me or ask for help, I'm not a support, just saying here something that could help and I'm not pro .

Installing, Running, and Navigating through apps

I've gotten a few questions about how to run apps on the Nexus Q, so I figured I'd make some sort of post giving instructions, at least basic ones.
1. Enable USB debugging on the Q. This is done by running the nexus Q app on another device, pairing with the Q, and then going to advanced and enabling USB debugging.
2. Installing apps is done by running
Code:
adb install path/to/app.apk
in the command line on a computer.
3. launching apps is done in command line by running
Code:
adb shell
, then typing
Code:
am start package.name/.Activity name
. For example, opening settings is done with
Code:
am start com.android.settings/.Settings
once in adb shell. Netflix is
Code:
am start com.netflix.mediaclient/.UIWebViewActivity
, and Angry Birds is
Code:
am start com.rovio.angrybirds/com.rovio.ka3d.App
. The package/activity names can be determined by running the app on another android device, plugging it into a computer, and running the monitor tool in terminal and looking at the hierarchy viewer.
4. XY coordinates for touch/drag events can be given to the device by using the monkeyrunner tool (documentation can be found on the android developers website). For a brief overview:
start monkeyrunner (located in android-sdk/tools/)
Code:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
device.touch(x, y, MonkeyDevice.DOWN_AND_UP)
device.drag((startX,startY), (endX, endY), 1, 10)
device.press('KEYCODE_BACK', MonkeyDevice.DOWN_AND_UP)
I realize this isn't very complete, but I'll add some stuff to it as I play more.
Thank you for posting this, this clears up a couple of my questions
This might be handy : link
So theres no UI for the apps? You have to memories each apps command string?
That sucks. lol Is there any chance of a UI in development or a launcher for the apps?
That seems excessively complicated to run for example angry birds with quite an extensive com string.
Agreed, it does really suck to have to use console commands.
Well...lets just say I'm working on something. It may take a few days before I know whether it'll actually work, but I'll let you know.
Why not install the VNC application for droid
in order to run the VNC server on your nexus Q and then use your tablet or other touch enabled android/computer/device to control the Q interface
http://code.google.com/p/android-vnc-server/
https://play.google.com/store/apps/details?id=org.onaips.vnc&hl=en
https://play.google.com/store/apps/...t#?t=W251bGwsMSwyLDEsImNvbS5zY2h1bWkudm5jcyJd
this is just an idea considering you have root the app shouldnt be hard to set a call to on some kind of init.d script path
i think it would serve well for navigation
it's basically identical internals to the galaxy nexus, with some extra hardware outputs, so you can port over a custom rom for galaxy nexus and use that as the UI for now
UKROB86 said:
it's basically identical internals to the galaxy nexus, with some extra hardware outputs, so you can port over a custom rom for galaxy nexus and use that as the UI for now
Click to expand...
Click to collapse
What your saying does make sense, so I'm willing to give it a try this weekend. I will port over the same ROM I have on my VZW Galaxy Nexus (Stock Jellybean 4.1 from Rootz Wiki). In order to do so I will need just a little bit of help... My Q is already rooted, so you can just provide me with a walk thru outlining how to push/port the ROM over. Do I have to hook it to the pc again and start the bootloader with adb or what exactly? Thanks for the help in advance.
You can install droidmote server on nexus q and control it with your android phone.
with droidmote server you simulate a mouse a keyboard a multitouch touchpad etc. etc.
you can play, in remote,also with games that support only the touch screen
...

[Q] [SL4A] Importing PHP or Python script from github to execute from command line

Hey all,
This is my first post here because I have been tearing my hair out trying to get this to work on my own, and I hope you all can help.
What I am trying to do is get either nest-api in PHP or pynest in python to run out of SL4A in order to control my Nest thermostat ultimately out of Tasker. Both are found on github, but I can't link to them as I apparently need ten posts to do so. So a google search for "nest-api github" and "pynest github" will have to do I suppose.
I have absolutely no issues getting either to run out of Terminal on my MacBook Air, but for whatever reading the SL4A shell seems to escape my understanding. I would rather have the PHP script work, as it has more options for things I can set, which I like. The problem is I have no idea where to put the nest.class.php on my phone in order for the PHP shell to reference it when running the example.php or any script I write myself. When I put both files in the sdcard/sl4a/scripts folder and try to run either from within either sl4a or sl4a's shell I get a call to undefined function error.
For the python script, I'm not sure how I need to import the module so that I can call it with nest.py at the beginning of my command line prompt and follow it up with the user name and password and so on. I've done everything including trying to create an .egg file, which I've since been told is not necessary, and that I simply have to put it in the /sl4a/scripts folder. That doesn't make sense to me though, as I needed to run the setup.py command on my computer in order to start using it, and the .egg file should be the equivalent of that on the phone, no?
So what I am looking for is the foolproof way to get either a php or python script running through the shell that isn't actually hooking into the Android environment at all, which is what all the writeups I have found in my searching seems to pertain to. Then eventually make sure that they are available in a way that Tasker can call them. I should also note that all this has been done in an emulator through eclipse until this point, as I didn't want to go screwing around with my brand new Nexus 4's file structure until I had the best practice perfected.
Do you helpful folk have any guidance, tips, or insight on how I can get that done? Of course I can provide any other information you might need.
Thanks in advance.
Nest Api on Android using SL4A
I spend hours yesterday trying to do this. Did you ever get some help or figured it out on your own?
I have no idea how to make it work with SL4A I have done this succesfully on my computer.
Hope you can help me.
heytcass said:
Hey all,
This is my first post here because I have been tearing my hair out trying to get this to work on my own, and I hope you all can help.
What I am trying to do is get either nest-api in PHP or pynest in python to run out of SL4A in order to control my Nest thermostat ultimately out of Tasker. Both are found on github, but I can't link to them as I apparently need ten posts to do so. So a google search for "nest-api github" and "pynest github" will have to do I suppose.
I have absolutely no issues getting either to run out of Terminal on my MacBook Air, but for whatever reading the SL4A shell seems to escape my understanding. I would rather have the PHP script work, as it has more options for things I can set, which I like. The problem is I have no idea where to put the nest.class.php on my phone in order for the PHP shell to reference it when running the example.php or any script I write myself. When I put both files in the sdcard/sl4a/scripts folder and try to run either from within either sl4a or sl4a's shell I get a call to undefined function error.
For the python script, I'm not sure how I need to import the module so that I can call it with nest.py at the beginning of my command line prompt and follow it up with the user name and password and so on. I've done everything including trying to create an .egg file, which I've since been told is not necessary, and that I simply have to put it in the /sl4a/scripts folder. That doesn't make sense to me though, as I needed to run the setup.py command on my computer in order to start using it, and the .egg file should be the equivalent of that on the phone, no?
So what I am looking for is the foolproof way to get either a php or python script running through the shell that isn't actually hooking into the Android environment at all, which is what all the writeups I have found in my searching seems to pertain to. Then eventually make sure that they are available in a way that Tasker can call them. I should also note that all this has been done in an emulator through eclipse until this point, as I didn't want to go screwing around with my brand new Nexus 4's file structure until I had the best practice perfected.
Do you helpful folk have any guidance, tips, or insight on how I can get that done? Of course I can provide any other information you might need.
Thanks in advance.
Click to expand...
Click to collapse
I read on ifttt that they are planning on integrating nest options there. SO that is an easier solution I hope happens soon. They said this fall (already gone) or winter they hope to add functionality to for Nest. <fingers crossed>

Bot for android game

Hello guys,
I have been trying some information to get started but i have not been that successful. I am looking some advise, guide on how to get started with building a bot for a game in android. I am an experienced developer (java, ruby, c) but never coded anything in android or like a bot for a game. Besides running emulators to execute the game what other tools do i use? Do i execute the bot on the emulated device (android) or my pc which somehow can access the emulator. Any links or guides would be helpful, thanks.
I did have a look into monkeyrunner which seems kinda promising (although i hate python ) but still its not very clear how those scripts access the android game.
Mercy0r said:
Hello guys,
I have been trying some information to get started but i have not been that successful. I am looking some advise, guide on how to get started with building a bot for a game in android. I am an experienced developer (java, ruby, c) but never coded anything in android or like a bot for a game. Besides running emulators to execute the game what other tools do i use? Do i execute the bot on the emulated device (android) or my pc which somehow can access the emulator. Any links or guides would be helpful, thanks.
I did have a look into monkeyrunner which seems kinda promising (although i hate python ) but still its not very clear how those scripts access the android game.
Click to expand...
Click to collapse
Bump
do you have any information about this, i am in the same way

Categories

Resources