[Q] Help Android app in process, very confused - Java for Android App Development
hi im confused as to why i keep getting native on draw falure reverting to backround color in my web view android app
This is my main application.java(my xml is ok)
Code:
import me.gpesched.R;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebSettings.RenderPriority;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.EditText;
import android.widget.TextView;
import android.os.Build;
import com.google.analytics.tracking.android.EasyTracker;
import com.google.analytics.tracking.android.Fields;
import com.google.analytics.tracking.android.MapBuilder;
import com.google.analytics.tracking.android.StandardExceptionParser;
@SuppressWarnings("unused")
public class MainActivity extends ActionBarActivity {
private WebView mWebView;
private EasyTracker easyTracker;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_main);
mWebView = (WebView)findViewById(R.id.activity_main_webview);
easyTracker = EasyTracker.getInstance(MainActivity.this);
mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mWebView.getSettings().setRenderPriority(RenderPriority.HIGH);
mWebView.getSettings().setPluginState(android.webkit.WebSettings.PluginState.ON_DEMAND);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadUrl("https://vpnb-cdc.kroger.com/dana-na/auth/url_10/welcome.cgi");
mWebView.setWebViewClient(new cl());
}
private class cl extends WebViewClient{
@Override
public boolean shouldOverrideUrlLoading(WebView webview, String url){
webview.loadUrl(url);
return true;
}
}
@Override
public void onBackPressed() {
if(mWebView.canGoBack()) {
mWebView.goBack();
} else {
super.onBackPressed();
}
}
@Override
public void onStart() {
super.onStart();
EasyTracker.getInstance(this).activityStart(this);
}
@Override
public void onResume() {
super.onResume();
this.easyTracker.set(Fields.SCREEN_NAME, getClass().getSimpleName());
this.easyTracker.send( MapBuilder.createAppView().build() );
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
public WebView getmWebView() {
return mWebView;
}
public void setmWebView(WebView mWebView) {
this.mWebView = mWebView;
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container,
false);
return rootView;
}
}
@Override
public void onStop() {
super.onStop();
EasyTracker.getInstance(this).activityStop(this);
}
}
Log cat]
08-17 04:48:34.984: W/ActivityThread(4600): Application me.gpesched is waiting for the debugger on port 8100...
08-17 04:48:34.987: I/System.out(4600): Sending WAIT chunk
08-17 04:48:35.057: I/art(4600): Debugger is active
08-17 04:48:35.204: I/System.out(4600): Debugger has connected
08-17 04:48:35.204: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:35.405: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:35.606: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:35.807: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:36.007: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:36.208: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:36.409: I/System.out(4600): waiting for debugger to settle...
08-17 04:48:36.611: I/System.out(4600): debugger has settled (1470)
08-17 04:48:37.230: V/WebViewChromiumFactoryProvider(4600): Binding Chromium to main looper Looper (main, tid 1) {65219ff0}
08-17 04:48:37.237: I/LibraryLoader(4600): Expected native library version number "",actual native library version number ""
08-17 04:48:37.238: I/chromium(4600): [INFO:library_loader_hooks.cc(116)] Chromium logging enabled: level = 0, default verbosity = 0
08-17 04:48:37.319: I/BrowserStartupController(4600): Initializing chromium process, renderers=0
08-17 04:48:37.325: W/art(4600): Attempt to remove local SIRT entry from IRT, ignoring
08-17 04:48:37.352: E/AudioManagerAndroid(4600): BLUETOOTH permission is missing!
08-17 04:48:37.389: I/Adreno-EGL(4600): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018_msm8226_LNX.LA.3.5.1_RB1__release_AU ()
08-17 04:48:37.389: I/Adreno-EGL(4600): OpenGL ES Shader Compiler Version: E031.24.00.08
08-17 04:48:37.389: I/Adreno-EGL(4600): Build Date: 03/07/14 Fri
08-17 04:48:37.389: I/Adreno-EGL(4600): Local Branch:
08-17 04:48:37.389: I/Adreno-EGL(4600): Remote Branch: quic/LNX.LA.3.5.1_RB1.1
08-17 04:48:37.389: I/Adreno-EGL(4600): Local Patches: NONE
08-17 04:48:37.389: I/Adreno-EGL(4600): Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018 + f2fd134 + NOTHING
08-17 04:48:37.431: W/art(4600): Thread[15,tid=4708,Native,Thread*=0x48f62448,peer=0x65279048,"Thread-3668"] attached without supplying a name
08-17 04:48:37.458: W/art(4600): Thread[16,tid=4703,Native,Thread*=0x48d75c38,peer=0x6527a238,"Thread-3669"] attached without supplying a name
08-17 04:48:37.531: W/chromium(4600): [WARNINGroxy_service.cc(890)] PAC support disabled because there is no system implementation
08-17 04:48:37.575: W/art(4600): Attempt to remove local SIRT entry from IRT, ignoring
08-17 04:48:37.708: V/GAV3(4600): Thread[main,5,main]: [EasyTracker] sample rate loaded: 100.0
08-17 04:48:37.712: V/GAV3(4600): Thread[main,5,main]: [EasyTracker] dispatch period loaded: 1
08-17 04:48:37.714: V/GAV3(4600): Thread[main,5,main]: Dispatch period set with null handler. Dispatch will run once initialization is complete.
08-17 04:48:37.718: V/GAV3(4600): Thread[main,5,main]: [EasyTracker] session timeout loaded: 30000
08-17 04:48:37.722: V/GAV3(4600): Thread[main,5,main]: [EasyTracker] auto activity tracking loaded: true
08-17 04:48:37.742: V/GAV3(4600): Thread[main,5,main]: ExceptionReporter created, original handler is com.android.internal.os.RuntimeInit$UncaughtHandler
08-17 04:48:37.744: V/GAV3(4600): Thread[main,5,main]: [EasyTracker] report uncaught exceptions loaded: true
08-17 04:48:37.769: W/art(4600): Thread[19,tid=4724,Native,Thread*=0x48f37720,peer=0x652bae00,"Thread-3674"] attached without supplying a name
08-17 04:48:37.937: D/AudioManagerAndroid(4600): ==> onReceive: s=0, m=1, n=h2w, sb=true
08-17 04:48:37.940: D/AudioManagerAndroid(4600): reportUpdate: state=0, devices=[Speakerphone, Headset earpiece]
08-17 04:48:38.151: W/AwContents(4600): nativeOnDraw failed; clearing to background color.
08-17 04:48:38.490: W/art(4600): Thread[21,tid=4736,Native,Thread*=0x49ad2330,peer=0x65257ff0,"Thread-3676"] attached without supplying a name
08-17 04:48:38.584: W/art(4600): Thread[22,tid=4739,Native,Thread*=0x49adf350,peer=0x652ae888,"Thread-3677"] attached without supplying a name
08-17 04:48:42.663: V/GAV3(4600): Thread[GAThread,5,main]: connecting to Analytics service
08-17 04:48:42.689: V/GAV3(4600): Thread[main,5,main]: service connected, binder: [email protected]
08-17 04:48:42.691: V/GAV3(4600): Thread[GAThread,5,main]: connect: bindService returned true for Intent { act=com.google.android.gms.analytics.service.START cmp=com.google.android.gms/.analytics.service.AnalyticsService (has extras) }
08-17 04:48:42.697: V/GAV3(4600): Thread[main,5,main]: bound to service
08-17 04:48:42.706: V/GAV3(4600): Thread[GAThread,5,main]: Loaded clientId
08-17 04:48:42.720: V/GAV3(4600): Thread[main,5,main]: Connected to service
08-17 04:48:42.721: I/GAV3(4600): Thread[GAThread,5,main]: No campaign data found.
08-17 04:48:42.766: V/GAV3(4600): Thread[GAThread,5,main]: putHit called
08-17 04:48:42.793: V/GAV3(4600): Thread[GAThread,5,main]: Sending hit to service PATH: https: PARAMS: v=1, ul=en-us, t=appview, ht=1408276117840, sr=720x1184, an=xxxxxxxxxxxxxxxxxx, sc=start, tidxxxxxx, aid=me.gpesched, cid=0e217c3f-a6c0-4004-80d7-64fbbde19c4a, av=1.05, _u=.K28, cd=me.greatpeople.gpesched.MainActivity,
08-17 04:48:42.851: V/GAV3(4600): Thread[GAThread,5,main]: putHit called
08-17 04:48:42.870: V/GAV3(4600): Thread[GAThread,5,main]: Sending hit to service PATH: https: PARAMS: v=1, ul=en-us, t=appview, ht=1408276117881, sr=720x1184, an=xxxxxxxxxxxxx, tid=xx-xxxxxxxx-x, aid=me.gpesched, cid=0e217c3f-a6c0-4004-80d7-64fbbde19c4a, av=1.05, _u=.K-AL, cd=MainActivity,
08-17 04:48:50.225: I/X509Util(4600): Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
08-17 04:53:37.926: W/ActivityThread(5486): Application me.gpesched is waiting for the debugger on port 8100...
08-17 04:53:37.926: I/System.out(5486): Sending WAIT chunk
08-17 04:53:38.060: I/art(5486): Debugger is active
08-17 04:53:38.154: I/System.out(5486): Debugger has connected
08-17 04:53:38.154: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:38.355: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:38.555: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:38.756: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:38.957: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:39.158: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:39.358: I/System.out(5486): waiting for debugger to settle...
08-17 04:53:39.560: I/System.out(5486): debugger has settled (1400)
08-17 04:53:40.256: V/WebViewChromiumFactoryProvider(5486): Binding Chromium to main looper Looper (main, tid 1) {65219fe0}
08-17 04:53:40.271: I/LibraryLoader(5486): Expected native library version number "",actual native library version number ""
08-17 04:53:40.272: I/chromium(5486): [INFO:library_loader_hooks.cc(116)] Chromium logging enabled: level = 0, default verbosity = 0
08-17 04:53:40.363: I/BrowserStartupController(5486): Initializing chromium process, renderers=0
08-17 04:53:40.369: W/art(5486): Attempt to remove local SIRT entry from IRT, ignoring
08-17 04:53:40.403: E/AudioManagerAndroid(5486): BLUETOOTH permission is missing!
08-17 04:53:40.447: I/Adreno-EGL(5486): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018_msm8226_LNX.LA.3.5.1_RB1__release_AU ()
08-17 04:53:40.447: I/Adreno-EGL(5486): OpenGL ES Shader Compiler Version: E031.24.00.08
08-17 04:53:40.447: I/Adreno-EGL(5486): Build Date: 03/07/14 Fri
08-17 04:53:40.447: I/Adreno-EGL(5486): Local Branch:
08-17 04:53:40.447: I/Adreno-EGL(5486): Remote Branch: quic/LNX.LA.3.5.1_RB1.1
08-17 04:53:40.447: I/Adreno-EGL(5486): Local Patches: NONE
08-17 04:53:40.447: I/Adreno-EGL(5486): Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.1_RB1.04.04.02.048.018 + f2fd134 + NOTHING
08-17 04:53:40.491: W/art(5486): Thread[15,tid=5611,Native,Thread*=0x47f2f5d0,peer=0x65278ff8,"Thread-3763"] attached without supplying a name
08-17 04:53:40.515: W/art(5486): Thread[16,tid=5606,Native,Thread*=0x48d82bf0,peer=0x6527a0f0,"Thread-3764"] attached without supplying a name
08-17 04:53:40.627: W/chromium(5486): [WARNINGroxy_service.cc(890)] PAC support disabled because there is no system implementation
08-17 04:53:40.669: W/art(5486): Attempt to remove local SIRT entry from IRT, ignoring
08-17 04:53:40.812: V/GAV3(5486): Thread[main,5,main]: [EasyTracker] sample rate loaded: 100.0
08-17 04:53:40.816: V/GAV3(5486): Thread[main,5,main]: [EasyTracker] dispatch period loaded: 1
08-17 04:53:40.818: V/GAV3(5486): Thread[main,5,main]: Dispatch period set with null handler. Dispatch will run once initialization is complete.
08-17 04:53:40.823: V/GAV3(5486): Thread[main,5,main]: [EasyTracker] session timeout loaded: 30000
08-17 04:53:40.827: V/GAV3(5486): Thread[main,5,main]: [EasyTracker] auto activity tracking loaded: true
08-17 04:53:40.847: V/GAV3(5486): Thread[main,5,main]: ExceptionReporter created, original handler is com.android.internal.os.RuntimeInit$UncaughtHandler
08-17 04:53:40.850: V/GAV3(5486): Thread[main,5,main]: [EasyTracker] report uncaught exceptions loaded: true
08-17 04:53:45.767: V/GAV3(5486): Thread[GAThread,5,main]: connecting to Analytics service
08-17 04:53:45.784: V/GAV3(5486): Thread[GAThread,5,main]: connect: bindService returned true for Intent { act=com.google.android.gms.analytics.service.START cmp=com.google.android.gms/.analytics.service.AnalyticsService (has extras) }
08-17 04:53:45.791: V/GAV3(5486): Thread[GAThread,5,main]: Loaded clientId
08-17 04:53:45.798: I/GAV3(5486): Thread[GAThread,5,main]: No campaign data found.
08-17 04:53:48.774: V/GAV3(5486): Thread[Failed Connect,5,main]: falling back to local store
08-17 04:53:48.862: V/GAV3(5486): Thread[GAThread,5,main]: Dispatch running...
08-17 04:53:48.992: V/GAV3(5486): Thread[GAThread,5,main]: ...nothing to dispatch
08-17 04:53:48.995: V/GAV3(5486): Thread[GAThread,5,main]: PowerSaveMode initiated.
08-17 04:55:08.474: W/art(5486): Thread[22,tid=6051,Native,Thread*=0x499b8650,peer=0x652d6d90,"Thread-3773"] attached without supplying a name
08-17 04:55:08.581: I/X509Util(5486): Failed to validate the certificate chain, error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
Can some one please clarify why i'm getting that yellowed in error?
Related
unable to sync over gprs - wifi works fine
Unable to activesync over GPRS WiFi works fine Bookmark: Question: I have been having problems with our PDA's since Friday. We have SBS 2003 and all our PDA's are unable to activesync via GPRS. When i connect the PDA's up to a WIFI connection they are able to activesync using that internet connection however when i try to sync using GPRS it gives the error code - 0x80072f78. I am also unable to reach the URL via the internet explorer on the mobile phone - i.e. Http://server1/exchange unless i use the wifi connection. I have narrowed it down to a possible carrier block however i have tried it on 3 different networks and all give the same errors? I have searched high and wide on the net and have removed the proxy from the Tytn II GPRS connection. My carrier is Orange UK. The PDA's have been working effortlessly for the past 2years and on Friday something happened that has stopped any GPRS activesync nothing has change on our network!!! Please help!! Thanks
also i am unable to access OMA by visiting http://server/oma that brings up this error The PDA's on our network have been unable to sync OTA for 4 days now, it happened overnight and everything was working fine. When i try to access http://server1/OMA i receive the following error. Can anyone decipher what the problem is please??? I cant understand any of it ! Server Error in '/OMA' Application. Collection was modified; enumeration operation may not execute. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Collection was modified; enumeration operation may not execute. Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a "Debug=true" directive at the top of the file that generated the error. Example: <%@ Page Language="C#" Debug="true" %> or: 2) Add the following section to the configuration file of your application: <configuration> <system.web> <compilation debug="true"/> </system.web> </configuration> Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. Stack Trace: [InvalidOperationException: Collection was modified; enumeration operation may not execute.] System.Collections.ArrayListEnumeratorSimple.MoveNext() +2833870 Microsoft.Exchange.OMA.Tracing.OmaTrace.set_DebugOutputTracing(Boolean value) +167 Microsoft.Exchange.OMA.UserInterface.Global..ctor() +262 ASP.global_asax..ctor() +5 [TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +268 System.Activator.CreateInstance(Type type, Boolean nonPublic) +66 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1036 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +114 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +200 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +114 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350
ok for some reason ASP.NET had changed to V2 so i set it back to 1.x and i can now visit the OMA site on the server.. My PDA's are still giving the 0x80072F78 error when i try to synchronise to it though!
Windows mobile Web Service
Hi, i'm doing a app for windows mobile and i want to connect to a web service, anyone knows how? Thanks
Use a WebRequest to read the results. replace ##### with the web address of the service and any parameters it wants e.g. "http://www.webserver.com/webservice?parma=A&parmb=B" Then use the Read() method of the stream to get the results. Remember that you can only read 8192 bytes of the stream over the net at one go. You will have to read consecutive blocks of data if the response is longer than that. e.g. Code: using System.IO; using System.Net; Byte[] Buffer = new Byte[8192]; int ByteCount; Stream ResponseStream = WebRequest.Create("########").GetResponse().GetResponseStream(); while ((ByteCount = ResponseStream.Read(Buffer, 0, 8192)) > 0) { // Do something with what's in the buffer. } ResponseStream.Close(); If the webservice returns XML use an XMLTextReader on the url instead Code: XmlTextReader xtr = new XmlTextReader(""http://www.webserver.com/webservice?parma=A&parmb=B"); Then use the Read() method to read the response a line at a time. The Name or Value properties of the class will hold the return values, depends on how the XML has been returned.
I'm doing like this, but its not connecting connecting.StreamWS ws = new connect.connecting.StreamWS(); ws.Url = "http://192.168.56.106:9090"; //url do serviço string strOut = ws.HelloWorld(); //textBoxResultado.Text = strOut; MessageBox.Show(strOut);
What happens if you enter "http://192.168.56.106:9090" in the url of Internet Explorer on your Pocket PC?
nothing happens. The network connection needs to be active?
192.xxx.xxx.xxx is part of your own network, not the web. What is the webservice you wish to call? Where is it defined?
The webService is running on IIS. I can access it by pc browser or by a forms win app, but not by the windows mobile emulator. The application is deployed to the emulator via visual studio.
You have to configure the emulator to use your network. From the emulator window itself, click on File -> Configure and click the network Tab. Check 'Host-only networking' and try that. If not, try adding 'Enable NE2000 adapter' and bind it to your network card.
It didn't work, i'm still getting the same error "Could not establish connection to network." I think the code is right private void buttonResultado_Click(object sender, EventArgs e) { //Properties.Settings.Default["StreamWSTestClient_StreamingWS_Service1"] = "http://localhost:9090/"; //WindowMobileService service = new WindowMobileService(); //service = " connecting.StreamWS ws = new connecting.StreamWS(); ws.Url = "http://mlourenco-pc:9090"; //url do serviço string strOut = ws.HelloWorld(); //textBoxResultado.Text = strOut; MessageBox.Show(strOut); //textBoxResultado.Text = ws.Soma(Convert.ToInt32(textBox1.Text), Convert.ToInt32(textBox2.Text)).ToString(); }
Until you can get Internet Explorer on the emulator to display the IIS site you are wasting your time with any code at all. Emupronet is the set up screen for the emulator. NE2000 is the setup screen for the NE2000 adapter. Localhost is the default under construction screen served by IIS from a default untouched website. The IP address is of the Host PC running IIS. If the emulator's IE can't display a basic webpage served from your PC, webservices won't work either. If your internet connection is served through a proxy, your PPC has to match, also you will have to set up the proxy details in code before it will work.
I can access internet but no IIS
Somewhat at a loss as to why it won't work. Works a treat on mine as can be seen in the post above. Last resort, see if the emulator will work in a 'cradled' state. From Device Emulator Manager, right click on the active emulation and select 'Cradle'. It should be preceded by a network cable icon. You will need ActiveSync installed on the PC to be able to virtually 'cradle' it.
I already did it men, it was the f..... firewall Thanks a lot for your help. Now the next step is receiving a feed list and call wmp to play it, but not in web client. Thanks
That explains it! In hindsight I should have spotted the fact you were using a different port number. HTML goes through port :80 which is normally wide open. Non-standard port numbers are usually blocked by your firewall by default unless specifically defined. Good luck!
Socket Connection over Internet
Hi, I want to create a Socket Connection over the Internet: On my Android Device I´ve opened a Socket Server: Code: ServerSocket ss = new ServerSocket(4711); Log.i("Tcp Example", "Start Socket "); while(!end){ //Server is waiting for client here, if needed Log.i("Tcp Example", "Wait for client: "); Socket s = ss.accept(); Log.i("Tcp Example", "Client acceptet"); BufferedReader input = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter output = new PrintWriter(s.getOutputStream(),true); //Autoflush String st = input.readLine(); Log.i("Tcp Example", "From client: "+st); ... ... And for Tests I´ve created a Socket Client in Java: Code: Main() throws IOException{ System.out.println("... verbinde!"); client = new Socket (serverName, port); System.out.println("... success!"); out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream())); System.out.println("... out!"); in = new BufferedReader(new InputStreamReader(client.getInputStream())); System.out.println("... int!"); sendData("TTTESSSTTT"); } // Sendet Daten an den Server public void sendData(String outgoing) throws IOException{ out.write(outgoing); out.newLine(); out.flush(); } This works finde when I´m in my local Network @ Home, but I want to connected to the Server over the Internet (with a Web Interface - PHP), so I get my Mobile IP Adress von here http://www.whatsmyip.org/, start the Server and want to connect with the Cliebt to this IPAdress, but nothing happens. Is it even possible or what am I doing wrong? Thanks!
IceTi said: Hi, I want to create a Socket Connection over the Internet: On my Android Device I´ve opened a Socket Server: Code: ServerSocket ss = new ServerSocket(4711); Log.i("Tcp Example", "Start Socket "); while(!end){ //Server is waiting for client here, if needed Log.i("Tcp Example", "Wait for client: "); Socket s = ss.accept(); Log.i("Tcp Example", "Client acceptet"); BufferedReader input = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter output = new PrintWriter(s.getOutputStream(),true); //Autoflush String st = input.readLine(); Log.i("Tcp Example", "From client: "+st); ... ... And for Tests I´ve created a Socket Client in Java: Code: Main() throws IOException{ System.out.println("... verbinde!"); client = new Socket (serverName, port); System.out.println("... success!"); out = new BufferedWriter(new OutputStreamWriter(client.getOutputStream())); System.out.println("... out!"); in = new BufferedReader(new InputStreamReader(client.getInputStream())); System.out.println("... int!"); sendData("TTTESSSTTT"); } // Sendet Daten an den Server public void sendData(String outgoing) throws IOException{ out.write(outgoing); out.newLine(); out.flush(); } This works finde when I´m in my local Network @ Home, but I want to connected to the Server over the Internet (with a Web Interface - PHP), so I get my Mobile IP Adress von here http://www.whatsmyip.org/, start the Server and want to connect with the Cliebt to this IPAdress, but nothing happens. Is it even possible or what am I doing wrong? Thanks! Click to expand... Click to collapse Ain't gonna happen. Your android gets a private IP (normally 10.x.x.x) which by internet standards cannot be seen outside the local network. You can get around this on home computers by setting up port forwarding and such on your router (which you could do if your phone is on wifi and you have access to the router--i.e. your home access point), but I doubt that the phone company is going to let you forward ports on the router at their local switch.
Gene Poole said: Ain't gonna happen. Your android gets a private IP (normally 10.x.x.x) which by internet standards cannot be seen outside the local network. You can get around this on home computers by setting up port forwarding and such on your router (which you could do if your phone is on wifi and you have access to the router--i.e. your home access point), but I doubt that the phone company is going to let you forward ports on the router at their local switch. Click to expand... Click to collapse Yes I gete a private (internal) IP but I also get an external IP. This external IP is indeed addressed by for ex. a webiste or something like this. The website also send Data direct over the internet to my phone... so why is it not possible to send data from MY website to direct my appilication?
Because that IP you see in "whatsmyip.com" is shared by any number of devices. How would the router know that you're running a server on a particular port and to redirect any traffic to that port to your device and your device only? This is basic TCP/IP, and beyond the scope of this forum. Look it up if you want more info.
Hmmm, I think I´m confussed now How do other Apps a Client/Server Communication for Example "Whats App". Well, I want to create a Website which allows me to send Data to my Phone. The Server is started on the Phone and the Website connects to it or the other way?! Because that IP you see in "whatsmyip.com" is shared by any number of devices. How would the router know that you're running a server on a particular port and to redirect any traffic to that port to your device and your device only? Click to expand... Click to collapse I think this is not right.. for the moment this IP is just for MY Device...
IceTi said: Hmmm, I think I´m confussed now How do other Apps a Client/Server Communication for Example "Whats App". Well, I want to create a Website which allows me to send Data to my Phone. The Server is started on the Phone and the Website connects to it or the other way?! I think this is not right.. for the moment this IP is just for MY Device... Click to expand... Click to collapse Not to belabor this too much more, but as a for instance, do you have a broadband connection at home? How many computers are connected to it? Run whatsmyip.com on all of them and tell me what you get. Try running a server on one of those computers and connecting from some arbitrary client on the internet. What happens? It's more or less the same with your phone. The details differ depending on the carrier, etc. but essentially all the phones on a given node are going to have a common router at the switch and that's the IP you see at whatsmyip.com. The router uses NAT to allow clients on the private network to connect to servers on the internet, but NAT doesn't work the other way (without explicitly enabling certain ports to certain machines in the routing tables of the router itself). It's possible that you are the only phone on the network node at some given time, but not the norm and even if you are the only one for some reason, the node router isn't going to treat your phone any differently.
[Q] alexander m1u1 on doom kernel wifi
I would ask in his thread but I don't have 10 posts yet, but i'm on Alexanders latest v6 rom testing with doom kernel, so far wifi's my only setback. i've tried several of the wifi mods, any help would be appreciated. here is my logcat Code: D/DASH - select( 1238): sensors_select_callback: select canceled by request D/DASH - select( 1238): sensors_select_callback: select canceled by request D/DASH - select( 1238): sensors_select_callback: select canceled by request D/dalvikvm( 1727): GC_EXTERNAL_ALLOC freed 425K, 46% free 3395K/6279K, external 1403K/1416K, paused 165ms D/SurfaceFlinger( 1238): Screen about to return, flinger = 0x178848 D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false W/InputManagerService( 1238): Window already focused, ignoring focus gain of: [email protected] D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/Netd ( 1121): NetLink Event module action 1 D/Netd ( 1121): NetLink Event drivers action 1 D/Netd ( 1121): NetLink Event drivers action 1 D/Netd ( 1121): NetLink Event mmc action 1 D/Netd ( 1121): NetLink Event sdio action 1 D/Netd ( 1121): NetLink Event net action 1 D/Tethering( 1238): wlan0 is not a tetherable iface, ignoring I/WindowManager( 1238): Setting rotation to 3, animFlags=0 I/ActivityManager( 1238): Config changed: { scale=1.0 fontSize=2 themeChanged=0 themeChangedFlags=0 imsi=310/410 loc=en_US touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=5} D/dalvikvm( 1727): GC_EXTERNAL_ALLOC freed 411K, 46% free 3399K/6279K, external 1515K/1537K, paused 279ms D/dalvikvm( 1238): GC_CONCURRENT freed 381K, 40% free 4773K/7879K, external 0K/0K, paused 3ms+22ms D/SntpClient( 1238): request time failed: java.net.SocketTimeoutException: Try again D/dalvikvm( 1238): GC_EXPLICIT freed 57K, 40% free 4738K/7879K, external 0K/0K, paused 63ms D/dalvikvm( 1373): GC_EXPLICIT freed 228K, 47% free 3133K/5831K, external 0K/0K, paused 57ms D/SntpClient( 1238): request time failed: java.net.SocketTimeoutException: Try again D/Netd ( 1121): NetLink Event net action 2 E/Tethering( 1238): attempting to remove unknown iface (wlan0), ignoring D/Netd ( 1121): NetLink Event drivers action 2 D/Netd ( 1121): NetLink Event drivers action 2 D/Netd ( 1121): NetLink Event module action 2 D/Netd ( 1121): NetLink Event sdio action 2 E/WifiService( 1238): Failed to load Wi-Fi driver. D/Netd ( 1121): NetLink Event mmc action 2 D/SntpClient( 1238): request time failed: java.net.SocketTimeoutException: Try again I/AlarmManager( 1238): wakelock acquire, uid:10016 at elapsed real time: 145854 I/AlarmManager( 1238): wakelock release, uid:10016 at elapsed real time: 145897 I/EventLogService( 1401): Aggregate from 1319255077263 (log), 1319253831012 (data) D/dalvikvm( 1401): GC_CONCURRENT freed 227K, 47% free 3092K/5831K, external 133K/586K, paused 3ms+4ms I/AlarmManager( 1238): wakelock acquire, uid:1000 at elapsed real time: 152875 I/AlarmManager( 1238): wakelock release, uid:1000 at elapsed real time: 152908 D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/PowerManagerService( 1238): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false D/Netd ( 1121): NetLink Event module action 1 D/Netd ( 1121): NetLink Event drivers action 1 D/Netd ( 1121): NetLink Event drivers action 1 D/dalvikvm( 1727): GC_EXTERNAL_ALLOC freed 415K, 46% free 3400K/6279K, external 1590K/1602K, paused 33ms D/Netd ( 1121): NetLink Event mmc action 1 D/Netd ( 1121): NetLink Event sdio action 1 D/Netd ( 1121): NetLink Event net action 1 D/Tethering( 1238): wlan0 is not a tetherable iface, ignoring D/Netd ( 1121): NetLink Event net action 2 E/Tethering( 1238): attempting to remove unknown iface (wlan0), ignoring D/Netd ( 1121): NetLink Event drivers action 2 D/Netd ( 1121): NetLink Event drivers action 2 D/Netd ( 1121): NetLink Event module action 2 D/Netd ( 1121): NetLink Event sdio action 2 E/WifiService( 1238): Failed to load Wi-Fi driver. D/Netd ( 1121): NetLink Event mmc action 2
[Q] Scanning large number of BLE Tags
I was looking for a possibility to scan a large number of BLE Tags (StickNFind) in a single scan. I have noticed that when I scan for 10 seconds I can detect around 20 BLEs easily. When I increase the scanning interval to around 30 seconds and try to scan a large number of BLE Tags e.g. 200 Tags, I see an error in the LogCat about buffer overflow (GKI_exception). This problem occurs somewhere in the core Android libraries, which I am unable to debug. The exact error log is attached. Code: 11-27 11:39:30.542: D/dalvikvm(1017): GC_CONCURRENT freed 412K, 8% free 9039K/9760K, paused 1ms+1ms, total 16ms 11-27 11:39:30.552: D/BtGatt.GattService(1017): onScanResult() - address=E8:C6:AD:6F:BC:22, rssi=-76 11-27 11:39:30.552: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.552: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=10 11-27 11:39:30.552: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=n96 len=3 dev_type=2 11-27 11:39:30.552: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.562: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.562: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.562: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.562: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.592: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.592: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.602: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.602: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception(): Task State Table 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [0] task name [BTU] state [1] 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [1] task name [BTIF] state [1] 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [2] task name [A2DP-MEDIA] state [0] 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception 65524 getbuf: out of buffers##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: 11-27 11:39:30.602: E/GKI_LINUX(1017): ******************************************************************** 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: * GKI_exception(): 65524 getbuf: out of buffers 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: ******************************************************************** 11-27 11:39:30.602: E/GKI_LINUX(1017): ##### 11-27 11:39:30.602: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.602: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.602: D/BtGatt.GattService(1017): onScanResult() - address=F7:09:63:BC:66:D0, rssi=-78 11-27 11:39:30.602: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.602: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.602: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.602: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=11 11-27 11:39:30.602: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=JAALEE len=14 dev_type=2 11-27 11:39:30.602: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.672: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CE:D0, rssi=-86 11-27 11:39:30.672: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.672: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=12 11-27 11:39:30.672: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=JAALEE len=14 dev_type=2 11-27 11:39:30.672: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.682: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.682: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.682: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.682: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.702: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.702: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.702: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.702: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.702: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception(): Task State Table 11-27 11:39:30.702: E/GKI_LINUX(1017): ##### 11-27 11:39:30.702: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [0] task name [BTU] state [1] 11-27 11:39:30.702: E/GKI_LINUX(1017): ##### 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [1] task name [BTIF] state [1] 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: TASK ID [2] task name [A2DP-MEDIA] state [0] 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: GKI_exception 65524 getbuf: out of buffers##### 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: 11-27 11:39:30.712: E/GKI_LINUX(1017): ******************************************************************** 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: * GKI_exception(): 65524 getbuf: out of buffers 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### ERROR : GKI_exception: ******************************************************************** 11-27 11:39:30.712: E/GKI_LINUX(1017): ##### 11-27 11:39:30.732: D/dalvikvm(1017): GC_CONCURRENT freed 385K, 8% free 9038K/9760K, paused 7ms+1ms, total 20ms 11-27 11:39:30.742: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CF:35, rssi=-94 11-27 11:39:30.742: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.742: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.742: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=13 11-27 11:39:30.742: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=n8B len=3 dev_type=2 11-27 11:39:30.772: D/BtGatt.GattService(1017): onScanResult() - address=FC:A6:B0:A0:32:B6, rssi=-73 11-27 11:39:30.772: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.772: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.772: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=14 11-27 11:39:30.772: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=JAALEE len=14 dev_type=2 11-27 11:39:30.802: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.802: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.802: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.802: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.802: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CE:C2, rssi=-76 11-27 11:39:30.802: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.802: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.802: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=15 11-27 11:39:30.812: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=JAALEE len=14 dev_type=2 11-27 11:39:30.822: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.822: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.822: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.822: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.842: D/BtGatt.GattService(1017): onScanResult() - address=78:C5:E5:6E:CF:2D, rssi=-76 11-27 11:39:30.842: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.842: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.842: D/BtGatt.btif(1017): btif_gattc_upstreams_evt: Event 4096 11-27 11:39:30.842: D/BtGatt.btif(1017): btif_gattc_add_remote_bdaddr device overwrite idx=16 11-27 11:39:30.842: D/BtGatt.btif(1017): btif_gattc_update_properties BLE device name=s8E len=3 dev_type=2 11-27 11:39:30.842: I/bt-hci(1017): BLE HCI(id=62) event = 0x02) 11-27 11:39:30.842: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.842: I/bt-hci(1017): btu_ble_process_adv_pkt 11-27 11:39:30.902: D/btif_config_util(1017): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new 11-27 11:39:30.902: D/dalvikvm(1017): GC_CONCURRENT freed 480K, 8% free 9038K/9760K, paused 2ms+2ms, total 20ms What could be the reason for such problem and how can I resolve it? Thanks in advance!