Sleep CPU control - network applications - Android Software Development

Hi,
There's another thread with Samba server testing, which brought me to ask this question.
Let's say someone (who happens to be JimmyChingala) ports a generic Linux application that uses CPU and network (which happens to be Samba server). It compiles and runs, and everything's great - but it's an application that uses network, so it should be working on demand when the phone is in sleep mode, too. That's doesn't happen by itself, and the speed slows down terribly when phone is going into sleep mode.
This doesn't happen on network apps like SwiFTP, for example (FTP server).
Is that something that can be set during process runtime? Or is source code change required here to utilize wakelocks and what not?

Related

USB / ActiveSync / Internet connection, using Desktop PC

Hi,
A newbie, dummy, etc to the WM5.0, o2 xda exec device and what not + great to see this resource out there. I have got no WiFi or BlueTooth setup, the device set me back heavily for a good little while ;-)
Meanwhile attempting to develop some apps at home, I am trying to avoid O2's call plan data usage and connect to desktop PC (ie. some custom TCP apps running on it) as well as attempt to use its internet connection via USB/ActiveSync.
Have looked around for hours, hit google and more, and all I could find is help topic in ActiveSync : 'Use ActiveSync to "pass through" this computer, which of course I can't see working. For example, pocket IE just comes back with 'address is not valid' for any IP address I specify.
I can see the IP addresses associated with ActiveSync, ping them etc. but for the life of me I can't figure out what's required to use the pocket IE or any TCP client on the device to see the desktop's IP address or use its internet connection.
Any help greatly appreciated.
Regards,
Andy
In ActiveSync, go to connection setting. At the box "This computer is connected to", choose "The Internet".
It suppose to work now.
Thanks for the prompt reply. Have tried that, and what it presents is 'automatic', 'work', and 'internet'. I would have imagined it would present an option to chose my dial-up connection but nope, only those three choices are there.
None of them work, my setup does use a USB modem but I suspect that might not be a problem (although ActiveSync (4.1) seeems to be touchy about other USB devices judging by some web searches).
What I do see is a new Local Area Connection in network control panel for the mobile device. All its IP properties are set to automatic (private IP is automatic too). Event Log on the desktop doesn't report anything wrong either.
I try to use IP adrresses as URLs in Pocket IE only, hence it eliminates DNS issues or similar. I've also wiped the firewall to make sure it is not interfering in any way but still no luck.
What I am wondering now is whether this automagically works for others, if they had to add new modem connection or something on the device, and whether they had to enable Internet Connection Sharing on their dial-up (which I tried and messed up IP addresses and DHCP to some extent so I reverted back).
Any hints where I could be screwing up appreciated.
Regards,
Andy
From what I understand reading all day long (won't give up easy, is that pass thru is achieved through layered LSPs but somehow it's not working (question being does it really work with an USB/Dial up broadband).
And miserably failing at it, the network connection given to PC has following:
DHCP enabled
IP-Address : 169.254.2.2
Subnet-Mask: 255.255.255.0
Defeault-Gateway: (none specified)
DHCP Server is the Windows CE device and given address 169.254.2.1.
I would appreciate if someone can share their (working) Remote-NDIS Host settings from device in Settings/Network Cards/The Internet.
Thanks in advance.
Found and grabbed the settings off the web and some other forums, (169.254.2.1, and subnet mask of 255.255.255.0), things get "better".
"better" = another mega piece of nonsense.
R-NDIS Host now reconfigured, Pocket IE is still unable to use the USB dial-up broadband (no USB hubs involved on the desktop pc btw)
By some odd accident, started the MSN and while it refuses to check mail or similar (edit: it did allow it eventually), its chat features are working perfectly fine. Looking at desktop trace it goes off to :
ip48.hotmail-ppe.com via https
While that will return nothing to a browser based setup it certainly manages to use the desktop PC's connection as wireless is totally off on the device (called flight mode off is it, or similar?).
If anyone has seen or could explain this, or what on earth to do to get the IE (which consistently refuses with 'The address is not valid') to see the desktops connection from here, I'll be their slave for a week ;-)
Regards,
Andy
Matter solved, notified the networking and hopefully they pass it to IE team.
Put simply, write your own web-browser and it'll work
;-)
layman said:
Found and grabbed the settings off the web and some other forums, (169.254.2.1, and subnet mask of 255.255.255.0), things get "better".
"better" = another mega piece of nonsense.
R-NDIS Host now reconfigured, Pocket IE is still unable to use the USB dial-up broadband (no USB hubs involved on the desktop pc btw)
By some odd accident, started the MSN and while it refuses to check mail or similar (edit: it did allow it eventually), its chat features are working perfectly fine. Looking at desktop trace it goes off to :
ip48.hotmail-ppe.com via https
While that will return nothing to a browser based setup it certainly manages to use the desktop PC's connection as wireless is totally off on the device (called flight mode off is it, or similar?).
If anyone has seen or could explain this, or what on earth to do to get the IE (which consistently refuses with 'The address is not valid') to see the desktops connection from here, I'll be their slave for a week ;-)
Regards,
Andy
Click to expand...
Click to collapse
The fact that you can see the new Local Area Connection (Windows Mobile-based Device #..) proves that your Pocket is connected with your PC.
The “Remote NDIS Host” setting can be “IP address allocated by server” (then you may have an error message, but you should share the PC internet connection with the Pocket), or “Specific IP address” 169.254.2.1 (Subnet Mask 255.255.255.0).
So, your problem may come from the connection that PIE is trying to use.
The settings of “Parameter/Connections/Connections/Advanced/Select Networks” should be “Work Network” (réseau de bureau in French) in which :
General = parameters set name
Modem = “empty”
[VPN = “empty”]
Proxy parameters = “This network connecting to Internet” ticked
“This network connecting to Internet through a proxy server” NOT ticked (unless you are connecting to internet through a proxy server).
Sometimes, when you change from GSM/GPRS/UMTS networks, you must soft reset the Pocket to make sure that PIE will use the newly selected network.
In my case my PC is connected to the ADSL modem through a router, which is used as a DHCP server. Then my pocket is getting an IP address by the router in my local network range (different than 169.254.2.1). I don’t know if the connection of the modem on USB can be a problem, but I don’t think so.
You mentioned “some custom TCP apps running on” the PC, did you try without?
Good luck
Had similar Problem ....
Hi Layman,
Your problem sounds very similar to mine - except that I have a cable connection rather dial-up. Differences aside:
I had a machine at work where I plug-in my XDA and it works fine with the inernet.
It refused to work at home. To cut a long story short ... Check your settings are correct, and DO NOT SHARE THE INTERNET on your machine.
On my XP at home I had a bridge (or connection sharing). Once I deinstalled that everything worked. The symptoms were simialr to yours, I can ping local machines but cannot go to the interenet.
My setup at home,
XP Home Edition
USB connection
Activesync 4.1
CABLE modem connected to a wireless/wired switch router.
This machine is connected to the switch.
NO Internet connection sharing.
Hope thi shelps.
Hope this helps...
Thanks to both of you for reply, I pretty much took it as IE bug and slashed out under (real identity at MS guys but no harm meant etc. All a good thing.
------------------------------------
Glaps, cheers, have tried that on number of occasions and what was weird is that it kept coming back checked, or that everything would be unchecked. I just did the tests again
As per earlier posts I switched to purely flight mode (no wireless), so soft reset wasn't required. Having said that and looking at it, I can confirm the My Work connection to use Internet (not proxy) gets unchecked
on every soft reset (perhaps another bug? Yep, it's a BUG ).
Even in a single boot, when I triple, quadruple checked the proxy was not on and that the setting was still unchecked, and that IE was available on Work connection PIE wouldn't connect. I think I did a hard reset about 100 times as well and none of it helped. I've tried probably 20 variations on the theme with many settings. The fact remained IE-irony was the only app unusable.
(This pretty much makes the Connection/Settings on ActiveSync4.1 to use pass through for work or internet irrelevant, it should be all automatic. I think the idea of it all was that RNDIS and that DTLP feature is intelligent enough to figure out what's local network (work) or internet. Frankly I think it was a mistake taking that route for one scenario at least, but time will tell, no point speculating and certainly off topic..)
------------------------------------
RedJupiter, cheers. I can confirm the above holds for the disabling of Internet Conn Sharing too. It is not a deciding factor for the device or more correctly Pocket IE. With or without ICS, all applications apart from IE work.
To add to this (and encourage the debate perhaps, at least others/I can learn more from other experiences), in the last 3 days I've seen numerous posts on how to configure ActiveSync 4.1 'correctly' (heck even the install is labeled wrong, 4.0, speaks volumes). Suggestions ranging to enable IP routing in registry on desktop XP box, to enable NetBios over TCP/IP, to configure WINS, DNS etc. All of which I just don't see affecting much at all (at least in my own setup)
Here it is a USB modem, no routers, simple Dell 9100 box. So two USBs used: one for device and one for broadband modem. (will post the ROM versions and other stuff later). Ops, add another one for keyboard but surely that shouldn't do interrupts or something ;-
Custom app HTTP requests succeed with no problem at all, all other apps work with internet too. Pocket IE stands out.
Hope I am proven 'wrong', it really don't matter on that front. It's just that I can't test with Pocket IE and must give money to provider just to use the browser with settings (MyISP) that will probably make it work (which btw, I haven't setup yet; and will be surprised if that solves this problem instead . Call it avoiding O2's 'mega-bloat-software' install that smashes the device effect, so I am even scared to set the ISP up since that freezing cold experience lol.
( was an intro, but consider it ignorable as it is just early experience:
Above all together only part of the story because the whole thing is as unstable as it gets, the device (OS really) can get really shaken when running low on memory. Files get deleted as you watch them, ActiveSync can return consistent 0x8007000E error on the device (wonder if anyone is checking this really) although plenty of free RAM is on it. Google just solidifies all this with the number of hits and problems related, but things ActiveSync can do (like add files) are just beyond any bug reason; it needs to be scrapped really and alternatives are available so no more moaning from me there).
Ok just one more , what's more things get far more messy when you involve VS 2005, bugs in all OS-es with SSL usage, cert handicaps, you name it. I guess that tells what I am doing with the desktop, simply
trying to do a full roundtrip and test my own server running on desktop. Turned out a web client was required so went down the route to host the browser and pump the HTTP/S myself. Of course, turns out there are issues with the TCP/IP Winsock interface and limitations not only related to authentification and certificates but more, but it's a start. Besides, I am glad I can hit websites from the device (not just desktop debugging)
Eventful 4 days, and all I can conclude is that coming back to software+hardware, jack changed in last 6 years of software 'advances'. Yet you'll see new AKUs, new issues and what not before all the other important bits are resolved first.. But .NET adoption will keep smashing those devices until they figure out it's not sensible having it at all if all software that will run on it would use it like its Free Money Monday every day; not until they sort out the desktop GUI and RAM eating experience first; and it will still all be classified as 'vis ta bloat' OS. )
Rant over
------------------------------
Device : O2 EXEC DELETE * O2 FROM [CABs]
ROM version: 1.13.82 WWE (ROM Date: 11/30/05)
Radio version: 1.04.02
Protocol version: 42.37.P8
ExtROM version: 1.13.188 WWE

Seamless Handoffs between GPRS and Wifi Possible?

Are there any networking applications that would allow seamless switches between Wifi and GPRS/Edge?
It would be nice to be able to have a GPRS connection on the way into work, perahps streaming internet radio and then to have the network connection detect the Wifi and then switch. I suppose you would have to preconfigure your device with a list of access points, but considering that most of us use our devices at work and home, that should be easy to setup.
Or am I asking for something technically difficult to do?
YEs, Yes you can, but it maybe more trouble than its worth..
Its possible, Im not sure how "seemless" the transistion is going to be. First, you need to turn your Wifi slider to Performance so wifi radio stays on and scans while the PDA is sleeping. Then you need to add the SSID's (and WEP keys if applicable) of all the access points you intend to switch between. Having done this, you're going to need a huge battery, because leaving wifi on on this mode usually only yields about 3 - 3.5 hours of battery life. In addition, your GPRS radio is running so your battery life will be consumed slighly faster. With this configuration I have my work private network access points (3 for the different departments). My home wifi AP, and a few hotspots that I frequent in the evenings. When wifi is on, I can walk between any of these locations and the pda will automatically connect me to the present network. The downside to this is that every time I pass another visisble hotspot, the Universal chimes and wakes up to alert me to the new connection options. I also recommend doing the 802.11G hack for more compatibility (no speed improvement). Hope this helps.
Really seamless handover between GPRS and WIFI is not really possible without some firmware/radio stack changes. As long as you can put up with a second or two of data interruption there might be an 'seamless enough' solution in software (i haven't found one though).
There are some new phones which can do this handover for the voice channel (so called 'UMA' phones) but even then I have only seen the handover work seamlessly one way (wifi-to-gsm) in practice.
I can't see MS adding UMA support for some time (Motorola and Nokia have some phones that do this already). It nay be that a 3rd party adds UMA support but it won't be great as it needs to be embedded in the OS for best usability.
Google "UMA mobile phones" for more info.
It is possible to have seamless handover between GPRS and WIFI without firmware/radio stack changes ! The technigue is Mobile IP. But the provider would support/provide it or you have your own Home Agent server ( like proxy server)
You have only one IP address and your connection session is never abrupt during WIFI <-> UMTS Handover.
The other problem is GPRS/UMTS connection-hooking on MS Windows CE !
best regards,

Turning off wifi after inactivity

Hello,
Is there some program for windows mobile 6 standard that will let me turn on wifi automatically when it is needed (by an application) and switch it off after its been inactive for a little bit?
ivan
When the machine is suspended - either by pressing the power button or after a timeout, the wifi will be off automatically.
Unless you want to have power on full-time....
I meant that I wanted to have wifi turn on automatically if an app needs network access, otherwise no. The fact that the phone turns on wifi even if you are just checking the clock makes it a bit annoying to leave it on. Nokia phones, for example, ask you when an application needs network access if you'd like to connect. After you close the application, the connection is closed as well.
What you described is dial on demand. But Wifi in WM nor Windows PCs as a matter of fact, is a LAN device that just doesn't "dial". It just connects as-is, like a physical ethernet adapter. In other words, you can't even do it in Windows PCs.
However, you may be able to use some profile based solutions to switch on/off your wifi base on time, location, etc. But that may not be what you want.
ww2250 said:
What you described is dial on demand. But Wifi in WM nor Windows PCs as a matter of fact, is a LAN device that just doesn't "dial". It just connects as-is, like a physical ethernet adapter. In other words, you can't even do it in Windows PCs.
However, you may be able to use some profile based solutions to switch on/off your wifi base on time, location, etc. But that may not be what you want.
Click to expand...
Click to collapse
I guess nokia figured it out first then
or actually symbian?
Oh i'd love to use S60 on my S620

Need someone familiar with services running on the android kernel (cm6 specifically)

So I'm a network admin. I use strong passwords, alphas, numerics, etc.. keep a tight lid on what i install. AVs, spyware scans, etc.. no crap gets on my systems. Its been quite a number of years since I've had to clean out any of my systems.
Moving on...
My boss hands me a mini today from one of her family members - supposedly it has a bug and they didn't want to pay the geeksquad people.
Hearing that it has a bug, I didn't want to put it on the work network so I decided to hook it up to the wifi tether on my phone and download malware bytes via that. I figured - no windows bug is getting on my linux phone. I didn't think about any network-based attacks.
Few hours later, I turn my tether off and go to lunch when I visit my chiro twice a week. I'm laying down getting my back all jazzed up when my phone pops up with a "sign-in" error to my gmail. The password that I knew to be true didn't work. I hop on the bike and rush back to work.
I find all my googles signed out. I attempt to sign back in and get prompted with "suspicious activity detected, please verify". I did so through SMS and was prompted for my OLD password - which worked to my surprise (hacking 101: when you get in, first thing you do is change the pass). I was then prompted to change the pass which I did. I logged in to my gmail and saw a mobile login from an IP in peru. I also found quite a number of NDRs in my inbox (20 or so) with just a URL in it - so it was compromised for spam purposes.
Doing scans on all my systems, no sniffers or keyloggers running. They never had a chance to but just in case, i ran the scans anyway. My only thought is that mini connected to the net through my phone.
I'm thinking that since the phone presents itself as a wireless router and hands out DHCP, whatever local IP the phone sets itself to becomes the default gateway for the mini. If that mini is truly infected (at the moment, I'm not finding anything on it), and it does a network scan type of thing - could it have picked up some SMTP port that our android kernel keeps open? At that point, it wouldn't need my password (which would make sense that my old password worked). I didn't give it much thought at the time but I did think that a few hundred MBs of download was kinda high while the tether was connected.
So thats my question to anyone familiar with the kernel - network wise, are there any open, unsecured (smtp is unsecure in its nature..) services ran by the kernel? Once the phone goes into router mode and gives itself a local ipv4 address and a node (in this case the mini) hops onto the same subnet - those services would be readily accessible to that node.
IE: this bug scanned for port 25 or something.

[Q] Radio low power mode timeout

It's my understanding that the radio will go into low power mode when the screen is off, unless some program is doing something over the network in the background.
I assume that when something happens in the background, the radio will wait for a period of inactivity before it goes into low power mode. Does anyone know how long this is?
I set up openvpn, and it kills my battery when I leave it connected. The default keepalive messages are sent every 10 seconds, but are adjustable. I have a home automation/security device that needs to be able to send data back to my phone for alerts, which is why I'd like to keep the VPN up all the time. I'm trying to figure out if I can increase the keepalive time enough to give the radio time to sleep, but not enough to allow my NAT session through TMO's proxy/NAT devices to timeout, which will break the VPN and require a reconnect.
Too bad IPV6 isn't widely supported yet, since it provides encryption at Layer-3, and would negate the need for NAT.
I haven't looked into IPv6 from the T-Mo side of things (are there even any v6 apps on the phone? anybody tried to access a v6 site yet?) but you can get a free v6 tunnel endpoint for your home from places like SixXS.
I'm fully IPV6 enabled inside my home network (including Android), running dual stack. And I have a 6to4 tunnel with tunnelbroker.net.
Apparently Android does not support IPV6 natively on the 3g/4g interface yet. Once that happens, it will be possible to get on the IPV6 beta with TMO. Right now, you need a Symbian or Maemo phone.

Categories

Resources