A method for metering a battery charging level in a mobile device and that communicates with a first server over the Internet, the mobile device is identified in the Internet using an Internet Protocol (IP) address and is operative to be in plurality of states that includes first and second states based on the metered battery charging level, the method comprising:
- operating, by the mobile device, a mobile operating system;
- sending, by the mobile device to the first server over the Internet, the IP address;
- establishing, by the mobile device with the first server over the Internet, a Transmission Control Protocol (TCP) connection using an ‘Active OPEN’ or ‘Passive OPEN’;
- while connected to the Internet, periodically metering the battery charging level in the mobile device and a utilization of a resource in the mobile device, and comparing each of the metered battery charging level to a threshold level;
- in response to each comparing, responsive to being in the first state, to the metered utilization resource, and to the metered battery charging level being above the threshold level, staying, by the mobile device, in the first state;
- in response to each comparing, responsive to being in the first state, to the metered utilization resource, and to the metered battery charging level being below the threshold level, shifting, by the mobile device, to the second state;
- in response to each comparing, responsive to being in the second state, to the metered utilization resource, and to the metered battery charging level being above the threshold level, shifting, by the mobile device, to the first state;
- in response to each comparing, responsive to being in the second state, to the metered utilization resource, and to the metered battery charging level being below the threshold level, staying, by the mobile device, in the second state;
- periodically sending, by the mobile device to the first server over the established TCP connection, a heartbeat message that comprises the state of the mobile device, or is in response to a status of the mobile device;
- receiving, by the mobile device from the first server over the established TCP connection, a message acknowledging the receipt of each of sent heartbeat message;
- receiving, by the mobile device from the first server over the established TCP connection, a request for a content;
- and
- obtaining, by the mobile device, the content, in response to the receiving of the request, wherein the metering of the resource utilization comprises a metering of a processor or CPU time of executing one or more threads or processes,
- wherein the metering of the resource utilization includes metering of the processor or CPU idling time, or an execution of a system idle process,
- wherein the metering of the resource utilization comprises sensing of a status of a hardware component in the mobile device,
- wherein the metering of the resource utilization comprises metering of a utilization of an input or output capability,
- wherein the metering of the resource utilization comprises metering an amount of used or unused location or space of a memory in the mobile device,
- wherein the metering of the resource utilization comprises sensing an input from a user by an input device, sensing an output of a sensor, or metering of a communication activity, or wherein the metering of the resource utilization comprises metering of communication bandwidth of communication with another device over the Internet.