I am a person of very little experience w/ mobile devices but have recently rooted (w/ serious help from a how-to) a Barnes & Noble Nook Simple Touch e-reader and enabled Android v. 2.1. It is a much more versatile system now w/ several apps allowing me to do much more than the stock device.
However. I cannot use any apps from GooglePlay (the site will not allow my device to access the apps because it does not meet the audio and video requirements), which severely limits the reader's flexibility. I have been able to make use of several excellent programs from the Amazon App Store, but it seems that I can only install those apps which are not third party .apk files. Consequently, my Amazon Kindle app is a very early version, limited in functionality but proprietary, while there are many later, third party versions available elsewhere on the Web.
My device has a couple of .apk app installers installed, but they will not even recognize the presence of a third party .apk on the SD card or on the main memory of the reader. I have the well-regarded "Root Explorer" app installed and, while it will locate the target third-party .apk file, the install command only results in the same error that there is an inability to parse the program. Further, I have read that Android devices usually have a menu system w/ access to system settings allowing a check to the option "allow third party sources", but my device has no such menu system, and I have not been able to install any app that would install such a menu (due to the same problem about third party sourced app files).
I have done quite a lot of searching as how to solve this problem but have given up--this is a bit frustrating because I feel that my experience must be encountered by many others having run up against the roadblock presented by the GooglePlay site.
I wonder, is there any way to access GooglePlay so that I might install many apps conforming to Android v.2.1? Is there any way to allow permission to third party sources that does not require a menu that my device does not have? Does anybody know of a reliable source for a Kindle Reader app that is not third-party sourced? (interestingly, the two primitive Kindle apps that are recognized by my device also show the Kindle logo on the app file; the other, later Kindle app versions have the Android logo.)
I would appreciate, so much, any help w/ this, and, as I say, I imagine that my problem is the experience many others, as well.
Thank you very much to all those who have read and/or reply to this post.
I have received emails with pictures in the email that I want to download to my phone. I am not anywhere near wi-fi to download the picture.When I try to download the pictures they will just sit there and then time out. Please let me know if there is a setting issue.
I got the Galaxy s4 yesterday. I'm going crazy just trying to add word to the dictionary. I can't even get it to spell my own name. It does not have the "personal dictionary" option under "language and input" that I am used to. I took it to Best Buy and three separate techs there played with it and they could not figure it out either.
hi. i am using chomp sms and have created a custom notification tone. the problem is my phone makes 2 sounds every time i receive a text, the default sound followed by my tone. i read to disable the sms sound in the stock message app and i did that but it still makes the double sound. any one know how to fix this? thanks
Edit: forgot to mention im using 4.2.2 jellybean on the galaxy s4 sprint
I've notice lately, after flashing a custom rom, that during calls I can barely hear people on the other end yet they hear me fine. I have check all volume levels on my phone. Even with the call volume Zahl the way up and on speaker is still very hard to hear. It's extremely annoying and I have yet to find a post about it on this forum.
I did however find a post on another for with a similar problem and the way he went about fixing it was flashing a custom radio. I have no idea what that is and I can't find a thing about it on Google. I need help with this situation badly because I don't know where else to look for answers. I have the galaxy note 2 by at&t rooted.
I did a camera application and i want to upload the picture taken by the camera into the blob storage in azure. Below is the code for me to select image from gallery and upload through the SAS URL. However when i tried entering the report class file, it force closes.
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //Get access to the storage service StorageApplication myApp = (StorageApplication) getApplication(); mStorageService = myApp.getStorageService(); //Get data from the intent that launched this activity Intent launchIntent = getIntent(); mContainerName = launchIntent.getStringExtra("ContainerName");
//Get the blobs for the selected container mStorageService.getBlobsForContainer(mContainerName);
public void onClick(View v) { mStorageService.getSasForNewBlob(mContainerName, tv1.getText().toString());
}
// Fire off intent to select image from gallery protected void selectImage() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("image/*"); startActivityForResult(intent, 1111); }
// Result handler for any intents started with startActivityForResult @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); try { //handle result from gallary select if (requestCode == 1111) { Uri currImageURI = data.getData(); mImageUri = currImageURI; //Set the image view's image by using imageUri mImgBlobImage.setImageURI(currImageURI); } } catch (Exception ex) { Log.e(TAG, ex.getMessage()); } }
/*** * Handles uploading an image to a specified url */ class ImageUploaderTask extends AsyncTask { private String mUrl; public ImageUploaderTask(String url) { mUrl = url; }
@Override protected Boolean doInBackground(Void... params) { try { //Get the image data Cursor cursor = getContentResolver().query(mImageUri, null,null, null, null); cursor.moveToFirst(); int index = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA); String absoluteFilePath = cursor.getString(index); FileInputStream fis = new FileInputStream(absoluteFilePath); int bytesRead = 0; ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] b = new byte[1024]; while ((bytesRead = fis.read(b)) != -1) { bos.write(b, 0, bytesRead); } byte[] bytes = bos.toByteArray(); // Post our image data (byte array) to the server URL url = new URL(mUrl.replace("\"", "")); HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection(); urlConnection.setDoOutput(true); urlConnection.setRequestMethod("PUT"); urlConnection.addRequestProperty("Content-Type", "image/jpeg"); urlConnection.setRequestProperty("Content-Length", ""+ bytes.length); // Write image data to server DataOutputStream wr = new DataOutputStream(urlConnection.getOutputStream()); wr.write(bytes); wr.flush(); wr.close(); int response = urlConnection.getResponseCode(); //If we successfully uploaded, return true if (response == 201 && urlConnection.getResponseMessage().equals("Created")) { return true; } } catch (Exception ex) { Log.e(TAG, ex.getMessage()); } return false; }
For starters, you are going to want to set a scaleType (try "center_inside") in your xml definition of the ImageView.
If you provide some code (in particular your layout xml file) I might be able to be of more assistance.
Update
Now, this may not fully be your problem, but it is a piece of it. DP (or DPI, they are the same thing) adjust for the screen density (pixels per inch), not the screen size. That means that an image of 200dp x 200dp will be approximately the same size in inches on both screens, not the same percentage of the screen.
Since the Atrix is hdpi, and hdpi is a 1.5 multiplier, 200dp will take up 300px in real pixels, or approximately 1/3 (300/960) of the screen as you point out.
On the mdpi Ace, the 200dp translates evenly to 200px, which should be closer to 1/2 the screen. However, with the addition of the actionbar taking up screen real estate, it may seem like more.
The best way to deal with very small screens like the ace... well, my normal solution is to not support them very well, at least not on my first pass, as they are pretty rare. But if you want to, the best way is to provide alternate layouts.
Make a copy of your existing xml file in that folder. (name must be exactly the same)
Modify the file in layout/ so that it works better on smaller screens.
Essentially, if the device has a "large" screen or above (where large is basically the standard these days), it will use the layout in the layout-large/ folder.
Otherwise, it will use the default layout in the layout/ folder.
If you think this explanation is not what is happening, please provide screen shots to verify that the layout is in fact not behaving like it should.
I'm trying to get my username & password from my WAMS (android) to check during login (my login part is at btn1). I not sure if I did it correctly. Please help me take a look at it and see what did I do wrongly. Thanks.
try { // Create the Mobile Service Client instance, using the provided // Mobile Service URL and key mClient = new MobileServiceClient( "https://*****.azure-mobile.net/", "********************************", this );
// Get the Mobile Service Table instance to use mMembersTable = mClient.getTable(Members.class);
} catch (MalformedURLException e) { //createAndShowDialog(new Exception("There was an error creating the Mobile Service. Verify the URL"), "Error"); }
btn1.setOnClickListener(new View.OnClickListener(){ public void onClick(View v) { final String username, password; username = tf1.getText().toString(); password = tf2.getText().toString();
mMembersTable.select("username", "password").execute(new TableQueryCallback() { public void onCompleted(List result, int count, Exception exception, ServiceFilterResponse response) { if (exception == null) { for (Members mbs : result) { mbs.getUsername(); mbs.getPassword();
I have found a mysterious problem that may be a bug! I have a list in my fragment. Each row has a button. List shouldn't respond to click however buttons are clickable.
In order to get which button has clicked I have created a listener and implement it in my fragment. This is the code of my adapter.
public class AddFriendsAdapter extends BaseAdapter {
public interface OnAddFriendsListener { public void OnAddUserClicked(MutualFriends user); }
private final String TAG = "*** AddFriendsAdapter ***";
When I run the app, I can see my rows however since my list is long and has over 200 items when i goto middle of list and click an item then returned position is wrong (it's something like 7, sometimes 4 and etc.).
Now what is the mystery? If I active on item listener of list from my fragment and click on row then correct row position will be displayed while on that row if I click on button then wrong position will be displayed.
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { Log.e(TAG, "item " + position + " clicked."); } });
I am trying to find the user location with latitude and longitude. Is it possible to add a button to save the location (lat, long) and jump into another page? Or maybe get the image of the user location on the map. Do help me out on what to do. Thanks.
// Getting reference to the SupportMapFragment of activity_main.xml SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
// Getting GoogleMap object from the fragment googleMap = fm.getMap();
// Enabling MyLocation Layer of Google Map googleMap.setMyLocationEnabled(true);
// Getting LocationManager object from System Service LOCATION_SERVICE LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
// Creating a criteria object to retrieve provider Criteria criteria = new Criteria();
// Getting the name of the best provider String provider = locationManager.getBestProvider(criteria, true);
// Getting Current Location Location location = locationManager.getLastKnownLocation(provider);
LocationListener locationListener = new LocationListener() { public void onLocationChanged(Location location) { // redraw the marker when get location update. drawMarker(location); }
@Override public void onProviderDisabled(String provider) { // TODO Auto-generated method stub
}
@Override public void onProviderEnabled(String provider) { // TODO Auto-generated method stub
}
@Override public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub
void saveLoc(){ if ( myLocation!=null){ // save Location in SharedPreference or a Database here SharedPreferences prefs = getSharedPreferences("myPreferences",Context.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); editor.putString("myLocation", myLocation); editor.commit(); // Start new activity Intent intent = new Intent(Map.this, SendMessage.class); startActivity(intent); } }
Logcat.txt
05-09 02:01:54.280: D/dalvikvm(508): GC_EXTERNAL_ALLOC freed 51K, 53% free 2576K/5379K, external 3129K/3266K, paused 72ms 05-09 02:01:57.891: W/KeyCharacterMap(508): No keyboard for id 0 05-09 02:01:57.891: W/KeyCharacterMap(508): Using default keymap: /system/usr/keychars/qwerty.kcm.bin 05-09 02:02:34.450: W/KeyCharacterMap(508): No keyboard for id 0 05-09 02:02:34.450: W/KeyCharacterMap(508): Using default keymap: /system/usr/keychars/qwerty.kcm.bin 05-09 02:02:34.490: D/dalvikvm(508): GC_CONCURRENT freed 1486K, 58% free 3019K/7111K, external 3430K/4246K, paused 6ms+4ms 05-09 02:02:46.381: I/dalvikvm(508): Total arena pages for JIT: 11 05-09 02:02:47.931: D/dalvikvm(508): GC_CONCURRENT freed 1315K, 59% free 2950K/7111K, external 3430K/4246K, paused 5ms+4ms 05-09 02:02:48.281: D/AndroidRuntime(508): Shutting down VM 05-09 02:02:48.281: W/dalvikvm(508): threadid=1: thread exiting with uncaught exception (group=0x40015560) 05-09 02:02:48.300: E/AndroidRuntime(508): FATAL EXCEPTION: main 05-09 02:02:48.300: E/AndroidRuntime(508): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{mp.memberuse/mp.memberuse.Map}: java.lang.NullPointerException 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.os.Handler.dispatchMessage(Handler.java:99) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.os.Looper.loop(Looper.java:123) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.ActivityThread.main(ActivityThread.java:3683) 05-09 02:02:48.300: E/AndroidRuntime(508): at java.lang.reflect.Method.invokeNative(Native Method) 05-09 02:02:48.300: E/AndroidRuntime(508): at java.lang.reflect.Method.invoke(Method.java:507) 05-09 02:02:48.300: E/AndroidRuntime(508): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 05-09 02:02:48.300: E/AndroidRuntime(508): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 05-09 02:02:48.300: E/AndroidRuntime(508): at dalvik.system.NativeStart.main(Native Method) 05-09 02:02:48.300: E/AndroidRuntime(508): Caused by: java.lang.NullPointerException 05-09 02:02:48.300: E/AndroidRuntime(508): at mp.memberuse.Map.(Map.java:114) 05-09 02:02:48.300: E/AndroidRuntime(508): at java.lang.Class.newInstanceImpl(Native Method) 05-09 02:02:48.300: E/AndroidRuntime(508): at java.lang.Class.newInstance(Class.java:1409) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 05-09 02:02:48.300: E/AndroidRuntime(508): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 05-09 02:02:48.300: E/AndroidRuntime(508): ... 11 more 05-09 02:02:55.531: I/Process(508): Sending signal. PID: 508 SIG: 9
Who can help me solve my problem. My LG E730 smartphone is have in someones of my friends without a sim card but with an internet connection over WiFi. How to calculate from where my smartphone connecting to internet, and how to find IP address of the phone? P.S. I can install any application on it over Google Play in my account using browser!
What app can help me to track where my smartphone is??
Hi, I have some questions. I would appreciate any assistance
Samsung Tab 2 (7.0, 3113 Wifi with IR)
Android vers 4.1.1 (afaik latest for this device)
1) Could anyone recommend a case? I need something that can flip (prefer a magnet based lock). It needs to be able to take massive impacts (ie. drop from onto cement from 2 meters) from EVERY angle, including corners. I also need it real quick (within 12 days) - so big department stores are good, and Amazon Prime is good (I live in Canada)
2) Is there any way to adjust screen dim time?
3) Is there any way to have the screen automatically turn on/off using the sensors? Namely, the light and proximity sensors. Ex. proximity sensor: IF object is detected within 2 cm continuously for 5 seconds, shut off screen. IF object is removed, turn screen on. I had a Nexus 7 with a magnetic flip case, in which the Nexus 7 would automatically turn on when the flap was opened, and turn off when the flap was closed, as sensed by its magnetometer.
4) Could I get detailed instructions into the installation of Cyanogenmod? What exactly is it good for? Any other BIOSes worth looking into?
5) A suggestion for a fast PDF reader? I need something that will process large, coloured images very quickly (a large sized travel book).
6) Any tweaks to maximize speed? I just bought it 2 days ago and its not as fast as I'd like even out of the box.
7) Is there any way to get better camera quality? I want to use it in the place of a discrete camera (personal reasons).
Thanks in advace. Any help with even one of the questions would be great.
I have row. 1) i have custom row in button and i want to when click button then open the alert box and this row clicked then open the new activity but Only one button clicked not row clicked . how to possible in this case. my code in below.
Thank you.
public class AlMessagesAdapter extends ArrayAdapter {
@Override public boolean onItemLongClick(AdapterView arg0, View arg1, int position, long arg3) { // TODO Auto-generated method stub
msg = userLIstArray.get(position).getMessage(); token = userLIstArray.get(position).getToken(); type = userLIstArray.get(position).getType(); int msgId = userLIstArray.get(position).getMessageid(); token = token.substring(0,token.length()-3); int token_value = Integer.parseInt(token) * 1000;
if(type.equals("text")) { Log.v("log", " if in text to Display " + msg + " token "+token); Intent i = new Intent(MessagesList.this,DisplayPopupActivity.class); i.putExtra("msg", msg); i.putExtra("token", token); i.putExtra("msgid", msgId); startActivity(i);
} else if(type.equals("photo")) { Log.v("log", " else in IMage to Display " + msg + " token "+token);
Log.v("log","token "+token+" type "+type + " position "+position + "msgId "+ msgId);
Intent i = new Intent(MessagesList.this,DisplayImageActivity.class); i.putExtra("imgData", msg); i.putExtra("token", token); i.putExtra("msgid", msgId); startActivity(i);
I have a class country with an arraylist that stores countries. I have created a get and set to add and get items from specified indexes from the array list but i wont work. Whenever i call an index from the arraylist i get an out of bounds exception because the array is empty or at least seems to be.
public class country extends Application {
public ArrayList countryList = new ArrayList(); public String Name; public String Code; public String ID;
public void setCountry(country c) { countryList.add(c); }
public country getCountry(int index) { country aCountry = countryList.get(index); return aCountry; }
to call the setter i use.
country ref = new country();
ref.setCountry(new country (sName, ID, Code));
then when i want to get an index
String name = ref.countryList.get(2).Name;
i have done the same thing but used a local arraylist and it populated fine and i was able to display the names so the datasource isnt the problem its whatever im doing wrong setting and getting the data inside the arraylist in the country class
I am trying to create a simple set of screens in an android app. The app begins with a menu screen with buttons. After a choice is made I then want to launch an activity built with 2 fragments (one for player 1 and another for player 2). However when I try and start the activity with the fragments I get an error in the android emulator.
@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, menu); return true; }
// load up 1v1 duel activity public void beginRegularDuel(View view) { Intent intent = new Intent(this, OneVsOneDuelActivity.class);
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
After successfully using ProGuard on my application, it crashes on the startup on my mobile device. I use standard configuration of proguard: ${sdk.dir}/tools/proguard/proguard-android.txt
And logcat says something like this: E/AndroidRuntime(13441): at packagename.q.doInBackground(Unknown Source)
And then some App crashed errors etc.
Why does it not find my Source in doInBackground? Its a simple AsyncTask. Can anyone help me?
I'm trying to connect a socket with Android. I know that you can't open network-connections from MainThread. I have created an AsyncTask to do it. I have created and private class inside of the main class, I have seen some examples on internet about that.
Could someone help me about what it's wrong?? I guess that it's a error in the way I'm trying to connect because I have connected to the server with a normal Java class. I have edited the manisfest to give the necessary permissions.
If someone has any advise about a better way to do it, it would be great.
AsyncButtons asyncButtons = new AsyncButtons(); asyncButtons.execute(request);
}
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; }
//Botones private class AsyncButtons extends AsyncTask { private Socket socket;
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
I have
String name = "admin";
then i do
String char = name.substring(0,1); //char="a"
I want to convert the char to it's ASCII value (97), how can i do this in java?
asked 12 mins ago
Instead of this:
String char = name.substring(0,1); //char="a"
You should use the charAt() method.
char c = name.charAt(0); // c='a' int ascii = (int)c;
answered 11 mins ago
Very simple. Just cast your char as an int.
char character = 'a'; int ascii = (int) character;
In your case, you need to get the specific Character from the String first and then cast it. Though cast is not required explicitly, but its improves readability.
int ascii = character; // Even this will do the trick.
answered 12 mins ago
Just cast the char to an int.
char character = 'a'; int number = (int) character;
The value of number will be 97.
answered 11 mins ago
It's simple, get the character you want, and convert it to int.
String name = "admin"; int ascii = name.charAt(0);
answered 7 mins ago
Convert the char to int.
String name = "admin"; int ascii = name.toCharArray()[0];
Also :
int ascii = name.charAt(0);
answered 9 mins ago
If you wanted to convert the entire string into concatenated ASCII values then you can use this -
String str = "abc"; // or anything else
StringBuilder sb = new StringBuilder(); for (char c : str.toCharArray()) sb.append((int)c);
BigInteger mInt = new BigInteger(sb.toString()); System.out.println(mInt);