ADB in WSL2

To connect to ADB via WSL, we can first make sure the device is visible on Windows when executing the adb devices in cmd/powershell. 1. Set ADB Server In Windows side(cmd/powershell), do adb tcpip 5555 to set the ADB server to listen on port 5555 for a connection from a device over TCP/IP. 2. Get…

OnePlus 10T unlock/root/magisk

Fi Issue I have been using Samsung and pixel device for the past 5 years and did not get a chance to root phones for a while. I used to do that for all my devices(Nexus 4/5/6) for custom ROMs and kernals etc. Recently my pixel 5 does not work properly with the google Fi…

React Native on a machine 8081 occupied

Today, as i was setting up a basic React native app on my company’s laptop, I cannot run the RN packager server which is default to port 8081​. I ran the lsof -i :8081 but get nothing. Turns out I have to run it with sudo because the app that uses this port is the Corporate…

Android boot process

Boot process of embedded system is similar to PC from overview level, but slightly different from microscopic level. Here’s the boot process of an Android device: PC-BIOS/BootMonitor, MBR and GRUB/LILO etc are all combined in one Boot Strap Firmwarecalled Bootloader. Its init.S initializes stacks, zeros the BSS segment and calls _main() in main.c. The main.c…

android get wifi connection states

in my app, i need to notify user before they connect to internet for video if their device is not connected to wifi. To achieve this, we need to add ACCESS_NETWORK_STATE permission in the Manifest file first. you will obviously also need the INTERNET permission. Then we check the state:

save settings in android app

1. settings use getSharedPreferences(prefFileNameString, mode). I just need 1 settings file in my current app, so I only need to define a string in resource for the “prefFileNameString” and use it across all activities. 2. change theme The above code is used for switch between holo and holo light theme. Make sure they are before…

parse json file in android from asset

1. The JSON Structure I am taking an example of following JSON which will give you list of employees and each employee will have details like id, name, city, gender, age etc. Consider that above JSON data is stored in jsondata.txt file which is stored in assetsfolder. 2. Reading Text File (from assets folder) Before we start parsing…

create a quick android app with rss

现在很多的网站都推出了自己的app,但是对于我们这些普通的小网站来说,自己去做一个app有点得不尝试,也没有去那么的精力去做这些,于是就有人做了这样的服务,AppYet就是这样的而一个服务,只要提供网站的feed rss地址,appyet就能自动的生成一个比较perfect的app,只是对于免费的用户, 嵌套了广告,毕竟是免费的,我们也就没有什么可以说的。 appyet是提供了一种服务,只需你提供网站的feed rss,就能很快的生成一个网站的app出来,对于小网站用户来说足矣。(from this blog) 对于webvanta, 提供了rss生成script rss2.0的格式: <?xml version=”1.0″ encoding=”UTF-8″?> <rss version=”2.0″> <channel>     <title>DotNetBips.com Latest Articles</title>     <link>www.dotnetbips.com</link>     <description>DotNetBips.com Latest Articles</description>     <language>zh-cn</language>     <copyright>Copyright (C) DotNetBips.com. All rights reserved.</copyright>     <generator>www.dotnetbips.com RSS Generator</generator>     <item>     <title>Using WebRequest and WebResponse</title>     <link>http://www.dotnetbips.com/displayarticle.aspx?id=239</link&gt;     <description>Description here</description>     <category></category>     <author>Bipin Joshi</author>     <copyright></copyright>     <pubDate>Sun, 25 Jan 2004 12:00:00 AM GMT</pubDate>     </item> </channel> </rss> rss:  每个RSS Feed,都有而且只能有一个rss标签,作为顶层元素,属性version是版本号,如2.0 channel:   在rss标签下,必须有且只能有一个channel标签,可包含