Category Archives: Android

Android – Save / Load state Fragment

public class SomeFragment extends Fragment {   public final static String OBJECT_ATTR = "object"; Data data;   @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {   /** * restore */ if(savedInstanceState != null) { data = savedInstanceState.getParcelable(OBJECT_ATTR); }   /** * using data */ … }   /** * called when [...]

Also posted in Java | Leave a comment

Android: Install .apk from command line

adb install -r app.apk

Posted in Android | Leave a comment

adb connect… unable to connect to 192.168.1.4:5555

connect mobile with usb cable $ adb tcpip 5555 restarting in TCP mode port: 5555 disconnect mobile from pc $ adb connect 192.168.1.4 connected to 192.168.1.4:5555 $ adb devices List of devices attached 192.168.1.4:5555 device

Posted in Android | Leave a comment

Android on VirtualBox + BLE4 + adb / ADT

VirtualBox config: Settings -> Serial Ports on Settings -> Network: NAT Port forwarding: On start machine select Devices menu -> USB -> mark device with Bluetooth support. $ ipconfig Karta Ethernet VirtualBox Host-Only Network: Sufiks DNS konkretnego połączenia : Adres IPv6 połączenia lokalnego . : …… Adres IPv4. . . . . . . . [...]

Also posted in VirtualBox | Leave a comment