Android :: Creating The MulticastLock Used With WifiManager
Sep 18, 2010I 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...
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...
I'm trying to find out how use android multicastlock for capturing packets not addressed to device. As i understand SDK, i can capture them.
Can you show how capture them, or advice how use multicast lock.
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
code:.................
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?
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 developer.android.com so I dug through my copy of the Android source code and found that the WifiManager class (android.net.wifi.WifiManager) 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?
After changing the settings of the wireless router(SSID, frequency, securities) Android won't report the correct values until you reboot your android device!
http://code.google.com/p/android/issues/detail?id=5178&can=4&colspec=...
Does anyone know any workarounds of this?
For some reasons, this ain't working:
CODE:................
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.
I'm seemingly having problems creating the apk using an ant build for 1.5. It's building so I'm guessing the sdk pointer in local.properties is set correctly, but it seems to not be finding sun.security.x509.* (?).
I can see that jarutils.jar is in
CODE:...............
Here's the traceback spew...
release: [apkbuilder] Creating .Phresheez-unsigned.apk for release...
CODE:................
I'm developing an Android application and I'm very new on Java and Android. I want to create some constants to use in some activities. Where can I define these constants?
View 4 Replies View RelatedI have a "thirdparty.jar" which I have to add into my Eclipse project and make one combined JAR for my entire package. I have added the thirdparty.jar into my pproject using "Java Build Path" Libraries settings in eclipse. But when I try to make jar for my entire project, the jar creation for my project is success but the "thirdparty.jar" is not getting included in my project.jar.
View 2 Replies View RelatedI am thinking about creating a 2D game for android. Kind of like the flash game "Age Of War" (just google it). Can I do it with just Java or do I also need openGL?
View 4 Replies View RelatedI'm sure this is simple, but I've got myself confused over it.I have an image resource, such as R.drawable.myimage, and I want to convert this into a URI.I tried:
Uri selectedImage = Uri.parse("android.resource://com.my.package/" + resourceId);
but this just returns a NullPointer. The resourceId needs to be dynamic (so I can pass any image to it), not just a hardcoded "myImage".Any help please?
Is there any way to create window on Android using C++.
View 2 Replies View RelatedLet's say I randomly generate a number 0 to 100. Where 0 is really cold and 100 is red hot. Wen the number hits, it would show an image bar (kind of like a % finished bar) that shows in the image what # you hit.
So it would kind of be like a progress bar from 0 to 100, and whatever # they hit it shows in the image of the bar in an imageview?
I want to create a directory by using program in android sdk. Is it possible to listen the folder action like open folder and close folder etc.
View 1 Replies View RelatedI am creating one notification based on some event. This notification will only create sound. I just want to generate the sound using this notification, but no UI. Following is my code for this:
// make notification sound whenever the device is connected or disconnected
Notification notification = new Notification();
notification.defaults |= Notification.DEFAULT_SOUND;
notification.flags = Notification.FLAG_AUTO_CANCEL;
NotificationManager manager = (NotificationManager)
mContext.getSystemService(Context.NOTIFICATION_SERVICE);
// notify to all, manager.notify(0, notification);
I am facing few problems and have some doubts. I tried to search for answers in this post but could not find, so I am posting here for your people's suggestions:
1. Here I am using 0 as id for the notification. Is it good in practice. Since, I don't want to that this notification conflicts with other.
2. I have one doubt, about notification ids, e.g. if i keep my notifications id as 1 and some other application also have set that as 1. In that case, will my notification be updated. or Android treats, application's notifications differently.
3. Is it necessary to add FLAG_AUTO_CANCEL flag in my notification. Because, I think this is used when notification will appear in the status bar. But in my case, I have no UI. It means nothing will appear in status bar.
4. Currently there is one problem. When my notification makes sound, sometimes it seems that it is suppressed or distorted by any other sound or event. I am not sure what is happening there.
Is it possible to write an Softkeyboard without XML or is this the time I'll need it?The idea is: I have an Arraylist with buttons which have a specific position in the layout, height, width, text etc. Those buttons should create my keyboard by converting them into keys.If this won't work, my second idea is, to write a XML-File out of Java.I wonder if one of these ideas are possible.
View 2 Replies View RelatedI am trying to create a information based application, I have 92 subjects, for these subjects I have 92 map locations and maybe as much as 400 url links. Currently I have created a class for each map location and a class for each url link, but this would mean I would have in excess of 500 classes, so what I want to do is split the subjects in four catergories ie. listview of about 23 in four tabs which I have done and create a class that gets the url based on the selection the use makes and do the same for the map locations.Do I need to put these in a xml using the id method and how do you call individual entries, i.e. would I need 500 Android:id is there an easier way?
Is it possible to create files in subdirectories created under "/data/data/packagename/files/" directory using openFileOutput method in android?
ie there is a sub-directory by name "text" inside the "/data/data/packagename/files/" directory.
I want to use the openFileOutput (String name, int mode) method to write a file eg:sample.txt into this directory....Is it possible to use openFileOutput method to do it....
I want to create a java.util.map in android from a resource. I want to do this because I have a lot of entries to populate into the java.util.map and I want to store the values in the res folder of the project in xml format.
Is there an effecient way to do this in android? My map will have around 2500 entries so I want to do this as effeciently as possible and I don't want to hard code them...
How does one go about adding a custom SQLite function from within the Android sqlite API? I have a function (written in C) that I'm able to add using the C API outside of Android as described here: http://www.sqlite.org/c3ref/create_function.html.
View 4 Replies View RelatedIn a broadcast receiver I want to do the following:
1. See if MyActivity is alive somewhere. 2. If it is, bring it to the foreground. 3. Otherwise, start a new MyActivity.
In my MediaPlayer application for streaming Video i am using the following code File temp = File.createTempFile("mediaplayertmp", "dat"); while running it throws exceptions like
Parent directory of file in not
writable:/sdcard/
mediaplayertmp43912.dat
I dont how to handle this problem, and i want to know that when we execute that code means where the file will be created.
I want to create a file on the SD-Card and later save a CSV file in it. From surfing around I noticed that there seem to be two ways about going about it:If you're using API Level 8 or greater, use getExternalFilesDir() to open a File that represents the external storage directory where you.................................
View 1 Replies View RelatedWhile trying to create a new Android Project., Get a error - An SDK Target must be specified. The documentation states that - "Under Target, select an Android target to be used as the project's Build Target. The Build Target specifies which Android platform you'd like your application built against." However in my case The Build Target section of the open dialog does not contain any text field or select dropdown, so I am not able to specify anything.
View 11 Replies View RelatedI am new to android and I have a problem in creating a database.
public class database extends ListActivity {
/** Called when the activity is first created. */
private final String MY_DATABASE_NAME = "myCoolUserDB.db";
private final String MY_DATABASE_TABLE = "t_Users";
Context c;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ArrayList<String> results = new ArrayList<String>();
setContentView(R.layout.main);
SQLiteDatabase mydb=null;
try
{
mydb.openOrCreateDatabase(MY_DATABASE_NAME, null);
} catch(Exception e){}
}}
When I run this code it throws a run time exception.
1. It contain's the native binary with it. Then it will llod that native binary to AFS. 2. Then it should call or execute that native binary. But when I do that one. The native binary is working fine. But the problem cmoes out here. The function of the native binary is to read the file in the AFS and to copy it to another location.
But when I do the above steps. The native binary has been successfully loading to the AFS. After that when I try to execute the native binary. The file is get created with 0 size. The file permissions looks like below.
......................
How can I create a XML file that has identation or, at least, line breaks between each tag? I'm using class XMLSerializer (available in Android) to handle the XML creation.
XMLSerializer serializer = new XMLSerializer();
StringWriter writer = new StringWriter();
serializer.setOutput(writer);
String xmlFileContents = writer.toString();
Then I use the contents of xmlFileContents to create a file, using a BufferedWriter. The file is written, but the XML is not idented, and would like it to be.
In my main.xml layout file, I define a FrameLayout. Then in another layout file (say overlay.xml), I define another layout.
At runtime (onCreate) I want to create a new View object, set it's layout with overlay.xml, and add it to the frame dynamically. I need access to the elements of the overlay, to change text etc.
I'm trying to create a "scrollable" layout in Android. Even using developers.android.com, though, I feel a little bit lost at the moment. I'm somewhat new to Java, but not so much that I feel I should be having these issues--being new to Android is the bigger problem right now.The layout I'm trying to create should scroll in a sort of a "grid". I THINK what I'm looking for is the Gallery view, but I'm really lost as to how to implement it at the moment. I want it to "snap" to center the frame, like in the actual Gallery application.Essentially, if I had a photo gallery of 9 pictures, the idea is to scroll between them up/down AND side to side, in a 3x3 manner. Doesn't need to dynamically adjust, or anything like that, I just want a grid I can scroll through.I'm also not asking for anyone to give me explicit code for it--I'm trying to learn, more than anything. But pointing me in the right direction for helpful layout programming resources would be greatly appreciated, and confirming if it's a Gallery view I'm looking for would also be really helpful.EDIT: To clarify, the goal is to have ONE item on screen at a time. If you scroll between one item and the next, the previous one leaves the screen, and the new one snaps into place. So if it were a photo gallery, each spot on the grid would take up the entire screen size, approximately, and would be flung out of the viewable area when you slide across to the next photo, in either direction. (Photos are just an example for illustration purposes)
View 2 Replies View Related