Android :: Android SDK WifiManager Methods Won't Work

Aug 6, 2010

For some reasons, this ain't working:


Why aint this working, am i missing something? And it compiles and everything but when i want to run it on my phone it gives me a force quit error.

Android :: Android SDK WifiManager methods won't work

Android :: Android Tools And Methods Work Best To Find Memory - Resource Leaks

Jul 18, 2009

I've got an Android app developed, and I'm at the point of a phone app development where everything seems to be working well and you want to declare victory and ship, but you know there just have to be some memory and resource leaks in there; and there's only 16mb of heap on the Android and its apparently surprisingly easy to leak in an Android app.

I've been looking around and so far have only been able to dig up info on 'hprof' and 'traceview' and neither gets a lot of favorable reviews.

What tools or methods have you come across or developed and care to share maybe in an OS project?

View 3 Replies View Related

Android :: Android - Twitter Oauth - Many Different Methods - None Seem To Work

Sep 16, 2010

I can't get Oauth to work with Twitter. I have tried the following (all result in the same 401 error):


I've tried my own implementation and copy/pasted the sample code from each of the sites, and nothing seems to work. I'm also 100% sure I also downloaded and included any dependencies (where needed).

Here's the interesting part. Using jTwitter and the oauth-signpost library, I can initiate a connection to Twitter, open a browser window for the user, have them log-in and generate a PIN for my app. When the app goes to post a status update however, (using the pin, and the stored access token and token secret), the 401 error pops up. All other things I've tried won't even let me open a browser window and ask the user to generate a PIN (they die with the 401 error on the request for the "request token").

View 4 Replies View Related

Android :: When Do Synchronize Methods Or Use Synchronized Blocks In Methods In Android Game

Mar 14, 2010

I'm looking into writing simple graphics code in Android and I've noticed some synchronized() blocks. What is the reasoning behind this and how do I know when I should be "synchronizing" my code?

View 1 Replies View Related

Android :: Creating The MulticastLock Used With WifiManager

Sep 18, 2010

I am not able to get, What is the purpose of Creating the MulticastLock used with WifiManager in android.

Can any body clarify me what exactly it means and when to use...

View 2 Replies View Related

Android :: Using WifiManager Or WifiConfiguration.Status

Mar 19, 2009

Does anyone have an idea how use those Class(WifiManager or WifiConfiguration.Status) ???? this is my code but doesn't work even if the manifestxml has all the necessary permession


View 3 Replies View Related

Android :: WifiManager.calculateSignalLevel - RSSI 5

May 20, 2010

I am trying to use the Wifimanager to calculate the Signal Level of the access points found during a scan.

I am using the following method:

WifiManager.calculateSignalLevel(int, int)

But it appears to always return the same int no matter what the RSSI level is.

Here is my code:.............

The logging outputs 1 for all the test cases for calculateQoS(int).

Am I missing something simple here? Why is the SignalLevel always 1?

View 1 Replies View Related

Android :: 2.2 - Portable Hot Spot - WifiManager Class

Nov 9, 2010

I'm looking at how Android supports wifi portable hot spot functionality with a view to writing simple home screen widget that allows people to turn the phone's wifi hotspot on and off without digging into the device settings.

There was nothing obvious at so I dug through my copy of the Android source code and found that the WifiManager class ( provides the basics to allow the state to be queried. So as well as 'getWifiState()' there is 'getWifiApState()' and a matching set of state constants.

However, in my bang-up-to-date Eclipse IDE, this class has none of the Ap methods or constants. Can anyone shed any light on this?

View 10 Replies View Related

Android :: WifiManager.getScanResults() Reports Out-fo-date Values After AP Settings Changed

Dec 3, 2009

After changing the settings of the wireless router(SSID, frequency, securities) Android won't report the correct values until you reboot your android device!

Does anyone know any workarounds of this?

View 5 Replies View Related

Android :: HTTP Get Methods?

May 14, 2010

I have written a number of applications for blackberry and am just starting in Android. It seems to me that android has a lot more built in functions. I am starting by recreating some of my BB apps on Android and on one I take a few xml sites and parse them out. On blackberry I implemented this by creating a class that extended a thread. I would construct a new instance of this class with the parameters of my http request and it would call a function back in my main class, sending it the results. I am tempted to reuse my code, but am curious if android has something better built in. I have been looking at the handler class as well as possible using a service.

Bascially, I would like to start a new thread that will return a document of a specific url.

View 1 Replies View Related

Android :: Methods Of Intents Activity?

Jan 8, 2010

I have two applications A and B (in different packages,but it doesn't matter).Application B is an sms application that i have made and contains one activity.This activity has a method called sendSMS(String number,String text).I want to call this method from application A and send an SMS without opening the activity(the GUI) of application B but just send an SMS in the background by calling just the method of the activity.Any ideas?

View 10 Replies View Related

Android :: Difference Between Position And ID In Methods?

Dec 30, 2009

On methods like these kind, onItemClick(AdapterView parent, View view, int position, long id), what's the difference between position and id.

View 2 Replies View Related

Android :: How To Call Java Methods From C++ In JNI?

Oct 10, 2010

So I'm writing an Android app which uses a large c++ library. I have everything working so that the java app can call the c++ delegation methods, but I'm finding myself wishing I could log messages from c++ to the Android log. This is easy from java, but I'm at a loss as to how to call a java method from c++. My searches found methods for opening a jvm from c++, which is not at all what I want to do. Ideally, I'd like to pass a log method pointer to c++, which could then be used whenever I wanted. Of course, java doesn't support method pointers.

View 2 Replies View Related

Android :: ItemizedOverlay Using Both OnTap Methods

Jun 15, 2010

I have a MapView where I would like to be able to tap the map to create a new item at that location if there is no item there, or display the info about the item if there is.

I tried overriding both the onTap(int) and onTap(GeoPoint, MapView) methods but apparently if the second method is overridden the first never gets called (commenting one or the other lets each one work as I expected).

I thought about just checking if an item was at the location, but there doesn't seem to be any handy methods available to do that (other than iterating through the list of items and checking each manually).

View 17 Replies View Related

Android :: Optimization Accessing Fields Vs Methods

Nov 1, 2010

I know rule #1 of optimization is: don't do it! But I figured this was an easy question, and if I start using the faster method now I can save a lot of cpu time when I'm finished.Now, the answer to my question may be "there's no difference" and that's fine with me. I just want to know.

View 4 Replies View Related

Android :: KeyEvent Methods - What Does Its Return Value - Mean Logically?

Sep 1, 2010

1. what is the getKeyDownTime() method? What does its return value mean logically? 2. what is the getKeyEventTime() method? What does its return value mean logiccaly? 3. I want to measure the time a key was depressed for. Eg: Key A was pressed for 60 ms. which of the above methods would be useful?

View 7 Replies View Related

Android :: Different Text Input Methods (Poll)

Aug 11, 2010

Just out of curiosity how many people use Swype vs. Voice to Text vs. other means for text input. If I forgot a method just say it out loud.

View 4 Replies View Related

Android :: Methods To Keep Mobile Phone Off Using Code

May 28, 2010

is there a methods to keep mobile phone off using code, i have no idea about this,and hope someone give me some advice,or example , code,api

View 1 Replies View Related

Android :: Accessing Common Methods Among Activities

Jun 20, 2010

I have Activity A and Activity B. I want to access a method in Activity A from Activity B. This is my method:
Activity A extends activity{
public void save(){
} }

View 5 Replies View Related

Android :: Closing Old Methods / Activities In Application

Nov 24, 2010

Need help closing/accessing my views in a simple app (included an img of my program layout) but I might have been too confusing. Basically, I have an app that has a main menu where the user can click a button to open a camera. The user then snaps a photo and it is displayed on a page. The user will then click another button that detects faces. If faces are detected, the user is sent to a final page that shows the cropped face, etc. I give the user the ability to return to the main menu or snap a new photo.

Let's say a new photo is snapped and the user does it a few more times. Now I have multiple saved instances of old snapped photos (presented on the layout). How do I kill the previous instance (the layout from before he decided to snap a new photo)? So when I try to close the app it doesn't go back to the previous instance (displayed layout of said snapped photo). I am so confused on this one thing.

View 1 Replies View Related

Android :: How Java Generate Signatures For Methods

Oct 1, 2010

I have an Java class with a static final method getAll:


Now I want to hand in null as a value for the where statemant so that it will just be ignored later on in the code. Anyway in the testcase for this method I have: Vector<Category> categories = Category.getAll(context, null);

Which then in turn gives me a NoSuchMethodError. I don't know exactly why it does that. The only thing I could imagine is that the null I hand in would not match the signature of the above method. But how can I overcome this? I already thought of overloading. But this would just end in rewriting most of the code. At least when I do it, how I think.

This is the stack trace I get:


View 2 Replies View Related

Android :: Want Call Methods Of A Activity From Service

Apr 27, 2009

Is it possible to call methods of a Activity from service. I am running a thread from a service and i listening to some external event from that thread. I am not able to call methods from that thread. Is there any way to call methods from a thread.

View 3 Replies View Related

Android :: Remotely Call Methods Through AIDL

Jul 21, 2010

I am curious whether the AIDL only serves for inter-process communication between several Android apps on the same device, or AIDL provides much wider functionality. Let's say I have a Java application running on some server, is it possible to remotely call methods on that server through AIDL from an Android phone?If yes, do I need some extra libraries on the server-side Java application?

View 1 Replies View Related

Android :: Want Activity State Without Override Each Methods

Nov 22, 2010

I want see the state of my activity (Pause Stop Resume etc etc) without override each methods like this: Code...

View 3 Replies View Related

Android :: Way To Create Methods / Threads In Java?

Sep 7, 2010

I want to create one method and call the created Thread inside that method in my Android Application, I am new to Java as I had told before. Can anybody giive me an example of how should I create a method and call a Thread inside that method!

View 2 Replies View Related

Android :: Methods Not Working - Force Closing?

Nov 20, 2009

I've a couple functions that basically parse XML but it's not XML it is parsing something similar. I use them in PHP to break apart large strings so I converted them to Java for this, but when I use them they force close. I use this code to call them....

That's the gist of it. I know the string "str" is good, checked it, but if I run these lines I get a force close, if I comment them out I do not. The methods are below. See anything wrong?


View 5 Replies View Related

Android :: Graphics.Point - All Methods Are Stubs?

Jul 4, 2010

I'm trying to use the Point class from, but it appears that all the methods are stubs.

For example, the line Point p = new Point(1, 1); causes java.lang.RuntimeException: Stub!.

If I look at the bytecode for Point, I see a bunch of stubbed methods, e.g:


What's the deal here? Surely they didn't ship a class that's 100% stubs.

View 1 Replies View Related

Android :: Sdk - Methods For Converting Shape To Path?

Aug 20, 2010

The Canvas class does not take Shape as a parameter for any of its methods. There is no drawShape or clipShape, etc... So, I need to use Path instead. Does android sdk expose any way to convert Shape to Path or Path to shape? I haven't been able to find relationship any between the 2 classes...?

View 1 Replies View Related

Android : How Can I Call Service Methods From BroadcastReceiver?

Dec 7, 2009

I made two applications. One for an activity receiving user input, the other for a background service. In the service package, I create two files (, StartSensorBroadReceiver will receiver an intent from activity application and call method inside of the service. There is no erron in the codes but I can not excute what is want. I meet a message like this "The application ServiceExample has stopped unexpectedly. Please try again." could you let me know. what is wrong? and how I can call service methods from broadcastReceiver?

View 5 Replies View Related

Android :: Accessing Shared Preferences Through Static Methods

Sep 27, 2010

I have some information stored as SharedPreferences. I need to access that information from outsite an Activity (in from a domain model class). So I created a static method in an Activity which I only use to get the shared preferences. This is giving me some problems, since apparently it is not possible to call the method "getSharedPreferences" from a static method. Here's the message eclipse is giving me:
Cannot make a static reference to the non-static method
getSharedPreferences(String, int) from the type ContextWrapper

I tried to work around this by using an Activity instance, like this:
public static SharedPreferences getSharedPreferences () {
Activity act = new Activity();
return act.getSharedPreferences("FILE", 0);

This code gives a null point exception. Is there a work-around? Am I going into an android-code-smell by trying to do this?

View 2 Replies View Related

Copyrights 2005-15, All rights reserved