Which port android app is using - android

My wifi works through proxy, so I am using rooted phone with asproxy to connect to the internet.
most of the apps use standard ports (that's my belief), but some uses special ports like play.google.com uses 5228 to connect.
is there a way to know which port my other apps are using (probably to listen) example mighty text so i can configure them in asproxy. I have tried logcat but i doesnot give much details.
logcat extract:
W/com.Alsu.ASProxy( 757): Network connected, starting
> D/WifiWatchdogService( 251): (android.server.ServerThread) wi-fi
> (.f....) does not require the watchdog D/Tethering( 251):
> MasterInitialState.processMessage what=3 D/GTalkService( 2257): #####
> Network broadcast (connected=true) type=WIFI, state=CONNECTED
> I/MediaUploader( 6574): No need to wake up D/GTalkService( 2257):
> [GTalkConnection.1] ### networkStateChanged: active and curr network
> type/state are the same(1/CONNECTED), ignore D/CMStats ( 6594):
> CONNECTIVITY_ACTION: noConnectivity = false D/CMStats ( 6594):
> CONNECTIVITY_ACTION: starting service D/CMStats ( 6594): User has not
> opted in -- skipping reporting.
> **V/texty ( 5190): Data connection is ON.** D/dalvikvm( 370): GC_CONCURRENT freed 390K, 45% free 3913K/7047K, external 133K/513K,
> paused 4ms+6ms W/KeyCharacterMap( 370): Can't open keycharmap file
> W/KeyCharacterMap( 370): Error loading keycharmap file
> '/system/usr/keychars/europa_keypad0.kcm.bin'.
> hw.keyboards.0.devname='europa_keypad0'

Related

Debugger is no longer active in Android Studio

I am using Android Studio to build and run a simple application. My problem is that i can't run the project on the emulator although there are no errors except these weird ones:
11-15 17:12:25.250 704-772/system_process I/art: Explicit concurrent mark sweep GC freed 73473(4MB) AllocSpace objects, 28(834KB) LOS objects, 33% free, 9MB/14MB, paused 1.578ms total 87.751ms
11-15 17:12:25.250 704-719/system_process I/art: WaitForGcToComplete blocked for 104.615ms for cause Background
11-15 17:12:25.283 2403-2403/? D/AndroidRuntime: Shutting down VM
11-15 17:12:25.292 2403-2408/? I/art: Debugger is no longer active
11-15 17:12:27.776 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:12:47.778 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:07.776 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:30.131 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:47.779 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:53.387 82-82/? D/Genyd: Received Set Clipboard
11-15 17:13:53.387 82-82/? D/Genymotion: Received Set Clipboard
I have tried to run another project of mine and it worked perfectly (The problem is related to this specific project). Also, i have tried to kill the adb process and close and reopen this project but the problem persisted.
How to solve this problem?
After spending hours searching to solve this problem, I found that the problem is related to my AndroidManifest.xml, and this is how I found the solution:
Let's have a see at this message in the logcat connected mode and no configuration. Here I have thought about something missed in my project configuration, so I have checked it
Here is the key to finding the solution Run Configuration Error: Default Activity not found. So I have known that the debuger didn't know what is the default activity (the main activity). And now I have checked my AndroidManifest XML file and I have found an important part missing which is the part to tell the debuger which activity is the enter point of my app
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
After updating the AndroidManifest file, everything goes well now, but I still can't understand why Android Studio 1.4 didn't generate it for me automatically.
Hope I have helped.

chariotsolutions phonegap-nfc plugin rebooting on scan

I am using PhoneGap build and the chariotsolutions NFC plugin to scan NFC cards, and it was working. However, it started failing after PhoneGap build went down. I can only guess that PhoneGap build is now using a newer version of the plugin. A clean build still makes it crash internally on scan of a card.
I created a new Cordova project with the latest build using the cordova CLI, and installed the chariotsolutions plugin. It is still failing with only the bear bones project, which is outside of PhoneGap build now.
Hardware and software: Android Nexus 7 running Android 4.4.2
Cordova version 3.3
Bear bones project code contains only this onDeviceReady:
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
console.log('v0.0.3');
document.addEventListener('resume', app.resume, false);
document.addEventListener('pause', app.pause, false);
// Read NDEF formatted NFC Tags
nfc.addNdefListener (
function (nfcEvent) {
console.log('nfcEvent '+JSON.stringify(nfcEvent));
var tag = nfcEvent.tag,
ndefMessage = tag.ndefMessage;
// dump the raw json of the message
// note: real code will need to decode
// the payload from each record
console.log(JSON.stringify(ndefMessage));
// assuming the first record in the message has
// a payload that can be converted to a string.
console.log(nfc.bytesToString(ndefMessage[0].payload).substring(3));
},
function () { // success callback
console.log("Waiting for NDEF tag");
},
function (error) { // error callback
console.log("Error adding NDEF listener " + JSON.stringify(error));
}
);
},
ADB output on launch of the app:
I/ActivityManager( 512): Start proc com.test.myapp for activity com.test.myapp/.myappname: pid=17325 uid=10037 gids={50037, 3003}
I/CordovaLog(17325): Changing log level to DEBUG(3)
I/CordovaLog(17325): Found start page location: index.html
D/Whitelist(17325): Unlimited access to network resources
D/CordovaActivity(17325): CordovaActivity.onCreate()
V/WebViewChromium(17325): Binding Chromium to the background looper Looper (main, tid 1) {4211c938}
I/chromium(17325): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain(17325): Initializing chromium process, renderers=0
W/chromium(17325): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
D/libEGL (17325): loaded /system/lib/egl/libEGL_tegra.so
D/libEGL (17325): loaded /system/lib/egl/libGLESv1_CM_tegra.so
D/libEGL (17325): loaded /system/lib/egl/libGLESv2_tegra.so
D/CordovaWebView(17325): CordovaWebView is running on device made by: asus
D/JsMessageQueue(17325): Set native->JS mode to 2
D/CordovaActivity(17325): CordovaActivity.init()
D/CordovaWebView(17325): >>> loadUrl(file:///android_asset/www/index.html)
D/PluginManager(17325): init()
D/CordovaWebView(17325): >>> loadUrlNow()
I/CordovaLog(17325): Changing log level to DEBUG(3)
I/CordovaLog(17325): Found start page location: index.html
D/Whitelist(17325): Unlimited access to network resources
D/CordovaActivity(17325): Resuming the App
D/CordovaActivity(17325): CB-3064: The errorUrl is null
D/SoftKeyboardDetect(17325): Ignore this event
D/OpenGLRenderer(17325): Enabling debug mode 0
D/SoftKeyboardDetect(17325): Ignore this event
I/ActivityManager( 512): Displayed com.test.myapp/.myappname: +813ms
D/AndroidRuntime(17309): Shutting down VM
D/dalvikvm(17309): GC_CONCURRENT freed 97K, 15% free 589K/688K, paused 0ms+2ms, total 5ms
D/CordovaActivity(17325): onMessage(onPageStarted,file:///android_asset/www/index.html)
D/CordovaLog(17325): file:///android_asset/www/index.html: Line 25 : Viewport target-densitydpi is not supported.
I/chromium(17325): [INFO:CONSOLE(25)] "Viewport target-densitydpi is not supported.", source: file:///android_asset/www/index.html (25)
D/CordovaWebViewClient(17325): onPageFinished(file:///android_asset/www/index.html)
D/CordovaActivity(17325): onMessage(onPageFinished,file:///android_asset/www/index.html)
D/CordovaActivity(17325): onMessage(spinner,stop)
D/CordovaNetworkManager(17325): Connection Type: wifi
I/chromium(17325): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/chromium(17325): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
D/CordovaNetworkManager(17325): Connection Type: wifi
D/CordovaActivity(17325): onMessage(networkconnection,wifi)
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 58 : onDeviceReady v0.0.3
I/chromium(17325): [INFO:CONSOLE(58)] "onDeviceReady v0.0.3", source: file:///android_asset/www/js/index.js (58)
D/NfcPlugin(17325): execute registerNdef
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 83 : Waiting for NDEF tag
I/chromium(17325): [INFO:CONSOLE(83)] "Waiting for NDEF tag", source: file:///android_asset/www/js/index.js (83)
D/NfcPlugin(17325): execute init
D/NfcPlugin(17325): Enabling plugin Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.test.myapp/.myappname }
D/NfcDispatcher( 769): Set Foreground Dispatch
D/NfcPlugin(17325): parseMessage Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=com.test.myapp/.myappname }
D/NfcPlugin(17325): action android.intent.action.MAIN
D/CordovaLog(17325): file:///android_asset/www/plugins/com.chariotsolutions.nfc.plugin/www/phonegap-nfc.js: Line 18 : Initialized the NfcPlugin
I/chromium(17325): [INFO:CONSOLE(18)] "Initialized the NfcPlugin", source: file:///android_asset/www/plugins/com.chariotsolutions.nfc.plugin/www/phonegap-nfc.js (18)
D/CordovaActivity(17325): onMessage(spinner,stop)
ADB output when I scan a card. Seems to pause the app at matched single TECH for some reason, and then reloads Cordova running the onDeviceReady again.
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NfcDispatcher( 769): dispatch tag: TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.NdefFormatable] message: null
I/ActivityManager( 512): START u0 {flg=0x10008000 cmp=com.android.nfc/.NfcRootActivity (has extras)} from pid 769
D/dalvikvm( 512): GC_FOR_ALLOC freed 564K, 15% free 18611K/21744K, paused 145ms, total 145ms
D/dalvikvm( 512): GC_FOR_ALLOC freed 283K, 15% free 18573K/21744K, paused 144ms, total 144ms
I/NfcDispatcher( 769): matched single TECH
D/CordovaActivity(17325): Paused the application!
D/CordovaWebView(17325): Handle the pause
D/NfcPlugin(17325): onPause Intent { }
D/NfcPlugin(17325): stopNfc
D/NfcDispatcher( 769): Set Foreground Dispatch
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 48 : -- pause event fired --
I/chromium(17325): [INFO:CONSOLE(48)] "-- pause event fired -- ", source: file:///android_asset/www/js/index.js (48)
I/ActivityManager( 512): START u0 {act=android.nfc.action.TECH_DISCOVERED cmp=com.widgapp.NFC_ReTAG_FREE/com.widgapp.NFC_ReTag_dispatch_other (has extras)} from pid 769
V/receiver Tag discovered: (15520): TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.NdefFormatable] mifare tagid: 8A0924F9
I/ActivityManager( 512): START u0 {flg=0x4000000 cmp=com.widgapp.NFC_ReTAG_FREE/.automode (has extras)} from pid 15520
D/NfcDispatcher( 769): Set Foreground Dispatch
D/NfcDispatcher( 769): Set Foreground Dispatch
D/dalvikvm(15520): GC_CONCURRENT freed 224K, 4% free 7810K/8072K, paused 4ms+3ms, total 42ms
W/InputMethodManagerService( 512): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#429d7908 attribute=null, token = android.os.BinderProxy#427e6bf8
I/CordovaLog(17325): Changing log level to DEBUG(3)
I/CordovaLog(17325): Found start page location: index.html
D/Whitelist(17325): Unlimited access to network resources
D/CordovaActivity(17325): Resuming the App
D/CordovaActivity(17325): CB-3064: The errorUrl is null
D/NfcPlugin(17325): onResume Intent { }
D/NfcDispatcher( 769): Set Foreground Dispatch
D/CordovaLog(17325): file:///android_asset/www/js/index.js: Line 41 : -- resume event fired --
I/chromium(17325): [INFO:CONSOLE(41)] "-- resume event fired -- ", source: file:///android_asset/www/js/index.js (41)
D/NativeNfcTag( 769): Tag lost, restarting polling loop
D/dalvikvm(15037): GC_CONCURRENT freed 475K, 7% free 8271K/8824K, paused 3ms+4ms, total 40ms
D/dalvikvm(15037): WAIT_FOR_CONCURRENT_GC blocked 30ms
D/Finsky (15037): [1] 5.onFinished: Installation state replication succeeded.
Any help would be appreciated.
The reason it's not working is because the application is looking for an NDEF tag, but you're scanning a non-NDEF tag.
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NativeNfcTag( 769): Check NDEF Failed - status = 255
D/NfcDispatcher( 769): dispatch tag: TAG: Tech [android.nfc.tech.MifareClassic, android.nfc.tech.NfcA, android.nfc.tech.NdefFormatable] message: null
To read a non-NDEF tag, you'll need to add nfc.addNdefFormatableListener or nfc.addTagDiscoveredListener. You can use one event handler, e.g. app.onNFC, for multiple tag types.
You could also use NXP Tag Writer to write a message to the tag, which will also format it as NDEF.
Note that devices with the Broadcom NFC chipset won't read Mifare Classic tags, so you might get errors about non-NDEF messages even when reading a NDEF message on a Mifare Classic tag.
My Nexus 7 (original version) has the NXP NFC chipset. Your code worked, after I removed console.log('nfcEvent '+JSON.stringify(nfcEvent));. The event can't be stringified because of circular references. I think the second generation Nexus 7 uses the Broadcom NFC chipset.

Debugging on phone

I have an app that I have been using for a long while now. It's open source and fell out of development. I started modifying it when it broke and it worked fine on my Epic Touch. I recently picked up the Sprint Note 2 and installed it. It forced closed on me. I decided "OK lets see whats going on and why its FCing". I ran it in an emulator 4.1.2 and it worked fine. When I tried to debug it in eclipse using the real phone my logcat showed problems and never loaded:
D/dalvikvm( 1032): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1032): Note: class Landroid/app/ActivityManagerNative; has 153 ulemented (abstract) methods
D/AndroidRuntime( 1032): Calling main entry com.android.commands.pm.Pm
W/zipro (30332): Unable to open zip '/data/local/tmp/BalanceWidget.apk': Permission denied
D/asset (30332): failed to open Zip archive '/data/local/tmp/BalanceWidget'
I/ApplicationPolicy( 2487): isApplicationInstallationEnabled
W/zipro (30332): Unable to open zip '/data/local/tmp/BalanceWidget.apk': Permission denied
D/asset (30332): failed to open Zip archive '/data/local/tmp/BalanceWidget'
D/dalvikvm( 2487): WAIT_FOR_CONCURRENT_GC blocked 0ms
W/DefContainer(30332): Failed to parse package
W/PackageManager( 2487): verifying app can be installed or not
W/DefContainer(30332): Failed to parse package
D/dalvikvm( 2487): GC_EXPLICIT freed 329K, 14% free 44856K/51591K, paused 4ms, total 96ms
D/AndroidRuntime( 1032): Shutting down VM
D/dalvikvm( 1032): GC_CONCURRENT freed 128K, 87% free 568K/4096K, paused 0ms, total 2ms
D/jdwp ( 1032): Got wake-up signal, bailing out of select
I tried wiping the cache, chmoding the folders, but nothing worked. I changed to a different project to see if it was that project but it did the same thing.
Does anyone have any ideas on what the problem could be and how to fix it?
My phone:
Rooted Stock Sprint Note 2
L900VPALJC
OS Running - Android 4.1.1
Thanks

I got an installation error, and don't know what to do

When I run my application it does not launch, and shows me this message in Console:
[2012-05-20 17:36:58 - TravelersDictionary] Installation error:
INSTALL_FAILED_INSUFFICIENT_STORAGE
[2012-05-20 17:36:58 - TravelersDictionary] Please check logcat output for more details.
[2012-05-20 17:36:58 - TravelersDictionary] Launch canceled!
I did check my Logcat but there is nothing written in red.
Here is the last 5 logcat messages:
05-20 14:37:36.520: D/ExchangeService(438): Received deviceId from Email app: androidc259148960
05-20 14:37:36.520: D/ExchangeService(438): Reconciling accounts...
05-20 14:37:48.555: W/ThrottleService(75): unable to find stats for iface rmnet0
05-20 14:44:00.404: D/dalvikvm(75): GC_CONCURRENT freed 648K, 13% free 8475K/9735K, paused 12ms+11ms
05-20 14:44:32.975: D/dalvikvm(170): GC_CONCURRENT freed 397K, 13% free 6241K/7111K, paused 8ms+7ms
You get the next error: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE and as the error said you don't have enough space in your device to install the app, therefore delete some unwanted apps and other data and try again.
it seems that your device is running out of internal storage space, where the application are typically installed. You have two options. Remove some application, or, since you are developing, if you are is going to target API level grater than 8 (Android 2.2), you can set the android:installLocation="preferExternal", in the AndroidManifest.xml file. Android will try to install the application in the external storage, as the doc says:
If you declare "preferExternal", you request that your application be
installed on the external storage, but the system does not guarantee
that your application will be installed on the external storage. If
the external storage is full, the system will install it on the
internal storage.

Android phone reboots while executing my own developed application

I developed an Android application that uses many services, including GPS and orientation (compass). The genre of the application is AR (augmented reality) and I'm moving image views around the screen in real-time depending on the phone orientation. However, after a while, the phone freezes for a second and then reboots (Motorola Droid). I'm unable to find any useful log about this event. The log in the Eclipse is cleared after the phone reboots; I use "adb logcat" command to write the log to a file on my PC. The last meaningful rows of information are:
I/ActivityManager( 1272): Displayed activity com.zlatko/.Main: 2656 ms (total 2656 ms)
D/CameraHal( 1050): Zoom callback param1: 65536, param2: 1
D/CameraHal( 1050): processZoom/1:0. stopped=1
D/CameraHal( 1050): Stored Zoom Data/0/1:0
D/dalvikvm( 1272): GC freed 8444 objects / 453552 bytes in 268ms
D/dalvikvm( 1656): GC freed 13158 objects / 456056 bytes in 257ms
D/dalvikvm( 1656): GC freed 23844 objects / 787840 bytes in 98ms
D/dalvikvm( 1656): GC freed 22942 objects / 756408 bytes in 94ms
How can I find the reason for this frustrating behavior? The logs don't offer insight, there are no explicit exceptions thrown, the system is indeterminate (that means, I cannot conclude at what point in time exactly the phone reboots)...
Any recommendation?
The bugreport you linked to has a possible answer in the "KERNEL PANIC CONSOLE LOG" section:
<1>[ 1845.425445] Unable to handle kernel NULL pointer dereference at virtual address 00000000
<1>[ 1845.425811] pgd = cdfd4000
<1>[ 1845.426025] [00000000] *pgd=8d16d031, *pte=00000000, *ppte=00000000
<4>[ 1845.426879] Internal error: Oops: 817 [#1] PREEMPT
<4>[ 1845.427185] Modules linked in: tiwlan_drv sec modem_pm_driver netmux_linkdriver netmux
<4>[ 1845.428283] CPU: 0 Not tainted (2.6.29-omap1 #1)
<4>[ 1845.428497] PC is at SGXGetMiscInfoKM+0x310/0x348
<4>[ 1845.428680] LR is at List_PVRSRV_DEVICE_NODE_ForEach+0x1c/0x2c
Looks similar to this bug report for a Milestone and a post from May 22 2010 on this Motorola support forum.

Categories

Resources