Why my json code don't work in Android browser ?? - Java for Android App Development

Hi all,
For my project i need to interact with a server. To do this i use a tablet and Tasker with HTTPGET commando.
The home automation server is from Domoticz, wich is a very good open source project !
I'am not much of a coder, so i can't understand what's happening in the situation below:
Put this code in my browser:
192.168.178.100:8080/json.htm?type=command&param=switchlight&idx=99&switchcmd=Set%20Level&level=6
Everything works fine. Dimming lights works great !
The Domoticz server is also on the same PC.
Now,
I open a browser on my Android tablet and i get an error.
Using the Tasker app in Android (HTTPGET) the command doesn't work either. However clean "on" and "off" works. But the dimvariable is not. A fault message appear and read that there is some %20level issues.
Can somebody help ?
Thx.!

Related

Sky by mobile

I'm sure you know what this does, incase you don't, you can set your sky + box from your phone and browse the programme schedule.
I've installed the attached file and get as far as being able to enter my user name and password. The login and exit buttons do not respond.
Any ideas of how to make this work? any devs able to adapt this for our HDs?
This would be a great app to use.
Thanks
Mark
attached as a zip this time
Seems like a Java application. I usually don't like to use my midlet A native application would definitely be cool.
Regards,
Carty..
You can also buy a SlingBox and broadcast Sky and other video sources to your phone, laptop, PC etc.

[Q] Firesheep app for Andriod

Hello all,
Its been a long time no speak on this forum for a while, I have finally made the jump from WM (HTC LEO/SE X1) to Android on a Dell Streak. Admittedly I am still waiting on a stable o2 sanctioned version of Froyo to put SENSE UI on!
My question here relates to Firesheep, an add on for Firefox that allows packet capture on public WiFi networks. I was wondering if anyone could port this application to android as a stand alone App, or if anything else similar had been developed?
I hope someone can give me an answer at least to the feasibility of this request.
+1
I too would love to know hehe
Sent from my Desire HD using XDA App
It would require drivers for the wireless chipset in the phone to be put in promiscious/monitor mode to capture packets, as far as I know, neither is possible, unfortunately.
timekeeper said:
It would require drivers for the wireless chipset in the phone to be put in promiscious/monitor mode to capture packets, as far as I know, neither is possible, unfortunately.
Click to expand...
Click to collapse
Couldn't it run in firefox mobile
monitor mode in galaxy S
There is an app available in market called pixie who get the promiscuous mode for the wifi interface. I'm able to capture packets in Samsung Galaxy S (GT-I9000) with the app installed.
Now we're waiting for firesheep realease for android... it's impossible to install the XPI in Firefox mobile beta...
Yeah, I tried porting the XPI over to firefox mobile, but it wont work without a packet capture utility, like WinPcap, which is used with the normal Firefox Win version.
I would be definately interested in seeing where this goes though...
vit_mar said:
Yeah, I tried porting the XPI over to firefox mobile, but it wont work without a packet capture utility, like WinPcap, which is used with the normal Firefox Win version.
I would be definately interested in seeing where this goes though...
Click to expand...
Click to collapse
It is also working in OSX so I guess libpcap should be enough to use it. By reading this http://seclists.org/tcpdump/2010/q1/98 it seems that there is support for Android. However you will need root access to use it.
This thread, discussing Shark for Root app, refers to a lot of functions that firesheep uses: http://forum.xda-developers.com/showthread.php?t=725692
Perhaps using libpcap/tcpdump (as janfsd suggested), we can port this over. Root is a must though, true...
any updates?
i need this for my N1
Tanks
Bumping for an update on this project!
Found this thread in google. Try http://faceniff.ponury.net/ I've wrote it yesterday I wrote it to sniff only facebook accounts but it can be easily modified to other services.
Hello!!
This is awesome! wooow! I don't mean the fact that you can steal web session profiles,
but the fact that an Android application can open an interface e.g. WIFI and realise sniffing -
network monitoring without being run as root or system. To do so, an application should be
signed with the platform's key : http://stackoverflow.com/questions/6010796/run-secure-api-calls-as-root-android
How is this possible?? I am really wondering about that. Some time ago I tried to port
jNetPcap, so as to use it in an Android application for monitoring the WIFI. I successfully
ported it but I couldn't read the list of Android interfaces from its API and realise web
monitoring.. (see here for details: http://stackoverflow.com/questions/5966603/jnetpcap-on-android-problem-with-findalldevs-method,
http://jnetpcap.com/node/792)
I am really wondering how faceniff faces this problem??
e.g. Shark for Android runs an instance of libpcap in the background and derives the
appropriate information from the pcap traces..
What faceniff do to get the information it wants, e.g. the web sessions?? I am
really curious about that.. Any ideas?
faceniff runs as root....
Yes, but how is it possible to make an application that runs as root?
There is no Android permission you can use in Android manifest to give you
such privileges.. Even other Android applications that run only in rooted phones
cannot open an interface an capture traffic, and for this reason they run in the
background a tcpdump and process the pcap traces it produces (e.g. Shark for
Android).
is anybody here that knows how faceniff can capture packets??
I know how it works because I wrote it
It has a binary file which lies in /data/data/net.ponury.faceniff/
Then the java app executes "su" (to gain root permissions) and executes that binary file. And it grabs results from the binary showing them on the screen. Hope it helps.

Help making android application into service

Hey guys, I'm fairly new to android applications. I am specifically working on an android application that runs for the Notion Ink Adam. A guy by the name of Mr.Guy actually wrote the app nearly perfectly and provided the source to me but there is a small issue I want to work out, hopefully with some help.
Basically the app runs from a search button long press, runs a native linux command (which toggles the backlight on and off) and closes.
The problem with the current application is that if you have somethings open in a current window they are closed by this application running. An example is opening the app drawer on the homescreen. Running the application closes the app drawer. In some cases th interruption makes a greater difference like when viewing media.
Anyway heres the source, ftp://eto.homeip.net/Shared/NotionInkHacks/PQiToggle.zip
I think I need the application to run a service instead of an activity but this didn't seem to matter. I'm pritty sure I need it to not call a UI and just run the service.
An ideal fix for this is to skip the application and just rely on keycodes run from init.rc but trying to do this I had zero success. I'm not sure if the version of init in my rom supports keycodes.
If you could help me either with making it a service or allowing a native linux command run from keycodes I would greatly appreciate it. Thanks!!!
You can call a service directly from a broadcast receiver which can listen for the "on search long press" intent
http://developer.android.com/guide/topics/fundamentals.html#ActivatingComponents
http://developer.android.com/reference/android/content/BroadcastReceiver.html

[Q] Nook Simple Touch disable screensaver & full screen browser

Hi,
First of all, thanks for great set of resources! I was rooted an up and running with market in no time.
I am planning to use the Nook as a home automation controller, where the interface is presented through a webpage. For that, I am going to have it mounted and constantly powered-up.
So, my question is - how can I disable screensaver to have the Nook show the browser 24/7?
Also, is there any simple way to show contexts of the browser window without the navigation buttons? (If not, no worries - I can put something together quickly in PhoneGap or similar).
Thanks!
Bumping for interest - has OP/anyone found a solution to this? I'm going to have a tinker with the sys files in the next few days to see if I can manipulate those, will post any positive results.
I'm looking for always-on functionality as part of a live bus timetable / weather station project I'm 75% through.
For those interested, I'm running a simple PHP server pulling data from London's TFL API and the UK MetOffice's Datapoint API and displaying the page in Dolphin.
julianfox said:
Bumping for interest - has OP/anyone found a solution to this? I'm going to have a tinker with the sys files in the next few days to see if I can manipulate those, will post any positive results.
I'm looking for always-on functionality as part of a live bus timetable / weather station project I'm 75% through.
For those interested, I'm running a simple PHP server pulling data from London's TFL API and the UK MetOffice's Datapoint API and displaying the page in Dolphin.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?p=29113425 (found by googling "nook screensaver disable sqlite3").
julianfox said:
Bumping for interest - has OP/anyone found a solution to this? I'm going to have a tinker with the sys files in the next few days to see if I can manipulate those, will post any positive results.
I'm looking for always-on functionality as part of a live bus timetable / weather station project I'm 75% through.
For those interested, I'm running a simple PHP server pulling data from London's TFL API and the UK MetOffice's Datapoint API and displaying the page in Dolphin.
Click to expand...
Click to collapse
Hi, I am quite interested in your project and was wondering how you got on with this.
Basically I am looking to have a calendar + weather page up constantly on in my rooted Nook Simple Touch. I have managed to get rid of the screensaver but it still goes into sleep mode after a while. Also would like to get some direction on how I could do my own PHP based page because most of the calendar apps out there dont seem to report weather
Jayyzee said:
Hi, I am quite interested in your project and was wondering how you got on with this.
Basically I am looking to have a calendar + weather page up constantly on in my rooted Nook Simple Touch. I have managed to get rid of the screensaver but it still goes into sleep mode after a while. Also would like to get some direction on how I could do my own PHP based page because most of the calendar apps out there dont seem to report weather
Click to expand...
Click to collapse
I implemented the server side part of this weather app
http://www.mpetroff.net/archives/2012/09/14/kindle-weather-display/
also made the following changes
http://www.shatteredhaven.com/2012/11/1347365-kindle-weather-display.html
Getting the image on the nook is a different story. I tried using crond to wget or curl the image from the server to the screensaver folder so I could have other info graphics rotated throughout the day. I was unable to get the image via wget and unable to get cron working. Any suggestions... (besides having a browser open 247)
here is another example
http://origami.phys.rpi.edu/~jimenc/public/pjs/weather_kindle/server2/weather.php
Refresh?
larryflynt said:
Getting the image on the nook is a different story. I tried using crond to wget or curl the image from the server to the screensaver folder so I could have other info graphics rotated throughout the day. I was unable to get the image via wget and unable to get cron working. Any suggestions... (besides having a browser open 247)
Click to expand...
Click to collapse
Hi, kudos for the progress so far.
I take it you couldn't just use another device to FTP the file to the nook every so often?
I was hoping to do a very similar thing with my spare NST but unfortunately my coding skills are not up to that level. You mention that you were trying to populate the screensaver folder with the image to be displayed, would there be any way to automatically make the NST wake up every few hours to refresh this image (assuming you can get the image there in the first place)?
I think that the better way to do this all is to write an app.
The app could use either an ImageView or a WebView.
You could easily make this work directly without a proxy or a server.
You wouldn't have to play around with screen timeout/wakeup,
This is going to be hard wired powered?
Renate NST said:
I think that the better way to do this all is to write an app.
The app could use either an ImageView or a WebView.
You could easily make this work directly without a proxy or a server.
You wouldn't have to play around with screen timeout/wakeup,
This is going to be hard wired powered?
Click to expand...
Click to collapse
The more I think about this, the nook simple touch might have to be charging.
I've done something very similar with my nook showing a custom weather listing in a fullscreen Dolphin browser. Though I have a problem with it not running for more than a day or so before the browser stops refreshing anymore. Have you experienced this? I'm currently looking into some way to kill/restart the browser on schedule perhaps.
Also, how did you get the browser in landscape mode? I can't find that anywhere.
neonpolaris said:
Also, how did you get the browser in landscape mode? I can't find that anywhere.
Click to expand...
Click to collapse
I use this to set the orientation: https://play.google.com/store/apps/details?id=com.mah.screenrotationlock
OB
Sent from my HTCEVOV4G using Tapatalk 2
Another way to set orientation is if you have an application that only does landscape.
Switch to the landscape app, home out of that, go to the application that does both.
It should stay in landscape mode.
I have an assortment of apps, some portrait only, some landscape only, some both orientations.
By jumping briefly to a landscape only or portrait only app you can set the orientation for subsequent apps.
Thanks for the help guys!
I've got a web server running on my NAS serving a custom page for me. The browser launches fullscreen on boot up via some auto start app. After 5 min, the page redirects to an all black page for a second, then an all white page for a second (to clean up the display), then back to the original page with any new information on it.
This works well except for two issues.
1. On boot up, there's no way to avoid the first lock screen. After unlocked, it doesn't come back, but it's always there on startup. This wouldn't really be an issue except...
2. The browser stops loading the page after a while. I can hit refresh and it goes through the motions, but the page isn't updated. It can take a couple of days for this to happen. Restarting the nook solves this. I confirmed that the page is still served normally to other devices (not a web server problem). I would just have the device auto restart at 3am or something, but then the lock screen would always be there.
Do you guys have any ideas about how to correct this or at least work around it?
I can't even try other browsers because this is the only one I've found that displays full screen.
Any updates on this?
I wonder if there's a way to have a cron job kill and relaunch the browser every once in a while to get past the freezing issue you'd mentioned. Or just have the cron job kill the browser every once in a while and relaunch it, pointed at a new information display page.
Even better would be if there was way to bypass the need for a web browser and interact directly with the e-ink screen buffer as can be done on rooted kindle devices. (I can't post a link, but google search "Tools Eink Framebuffer Update Trigger" to find the kindle framebuffer commands)
Yeah, I worked directly with the screen output on my kobo, which worked well, but it was more of a pain to make changes. That might be because I'm more familiar with php and css than python and screen blit-ing. Having android to work with makes it much easier to expand functionality by just downloading an app and using my fingers, instead compiling software and ssh-ing in for everything.
Speaking of which, it looks like my problem is solved. I installed tasker and set it to kill the browser at 3am and start the browser at 3:01am. Thanks all.
What about google play apps for weather? Most of the apps I have used so far have had contrast issues since they are designed for color screens. Does anybody know of good apps that display the current weather info and forcast data in an eink friendly color scheme?
As far as the going to sleep issue, the apk listed in the second comment here: http://forum.xda-developers.com/nook-touch/general/fridge-calendar-t3057759
worked without issue for me, so that problem has mostly been solved.
Try this: electricsign app
Apologies for the resurrection, but for those looking for a digital low power / e-ink info display this might just do it.
This app will do the trick if a static jpg of a web page updated at an interval will do (set to output a jpeg in the custom screensaver folder on rooted nook)
Electricsign android app: (search electricsign on the play store - I can't post a URL here yet).
Leave the WiFi on and set the screensaver timeout.
The source code is on github also (google.it ).
I can never find the app because I always think it's called electricsheep.
Hope this helps someone...or me in the future.
Hi future me, the app is called electricsign, not electricsheep. You'll thank me next time you forget. From your past self bored at a ceildh BC your gf doesn't want to dance.
electricsign looks like the ticket!

How to remote debug android via network with screen casting?

Hi guys,
One of our tester is working in other city( long distance from us). while testing our apps, his devices raise some strange bugs often,
and we have to send our new debug apk to let him install and test every time, then we have to wait for his feedback( sometime need screencap or screenrecord etc.)
it lose us much time.
can we have a solution to find a way that remote debug a android device via network( optative with screencast to our PC ), not via wifi?
Like he connect his android device to his PC, and install some software, and our developers can using their eclipse to remote debug the tester's devices?
Thx so much.
if no solution , find a way to remote logcat is also ok

Categories

Resources