w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
removing unwanted elements from blogger page
The blue box behind the iframe is located here: .post-outer { background-color: #eef8f8; border: solid 1px #e8e8e8; To remove the blue box, you can hide ".post-outer" or: background-color: transparent; border: none; Add "!important" where needed. The white box behind the iframe is located here: .main-outer { To remove the border, remove: box-shadow: 0 1px 3px rgba(0, 0, 0, .15); EDIT: *(based on different format idea)* If you're wanting to expand the blue and white portions, you have to expand the width of the blog to the same width or greater than that of the iframe. Click on "Template" > orange button that says "Customize". On the page that loads click "Adjust Widths". If you don't want to increase the whole blog width, you can use conditional tags to only effect that pag

Categories : HTML

JAXB adding unwanted tags in XML and removing desired ones
since i see tag <Bes> and <Aes> in class A and class B.. i feel that you have already defined root element.. i mean class A and Class B are subset of another class.. check this because an xml can have only one root element. if it is so then root element in class A and B is not valid. i don't see any issue with the xml defined in the class. for more information please visit http://java.dzone.com/articles/jaxb-and-root-elements

Categories : Java

Removing unwanted header and bottom part of sql result
Use the -s flag to invoke silent mode: sqlplus -S -L cimkroger/cimkroger@orcl @procdemo.sql > demo.txt The command line options are shown in the documentation.

Categories : SQL

Filtering file list and removing unwanted extensions using Enumerable and Lambda
Part of the problem is that FindAccessableFiles is returning an IEnumerable<string> instance which will re-walk the entire directory structure every time it is enumerated. The Select and Where clauses are re-evaluated every time the enumeration is walked and hence you are repeating this expensive work many times over. One quick fix for this is to force the walking one time by calling .ToList on the returned value return Enumerable.Concat(filesList, dirsList).ToList(); Note that this will cause the entire enumeration to be walked promptly at this point. However it will be done only once. If you are still seeing perf problems there are some other options you should consider You mentioned there are images you ignore. I would filter them out before hitting the disk to get i

Categories : C#

Identifying and Removing unwanted CSS (files/styles) and JS(scripts/functions) from a browsing session of a domain
I know that with Chrome's Audits, you can check what percentage of your CSS files are being used, that would help narrow it down; only for certain pages though. Sometimes the best way for doing a cleanup is just choosing a design (features/styles/etc.) and dropping the rest, it may break functionality and appearance on the system and it may be tedious, but at least you know the job is done right then. Some of you may probably disagree, but this would be the way I would tackle the job.

Categories : Javascript

How to detect programmatically when other apps are closed / force stopped
I don't believe it's possible to detect when an app is force stopped. Even the app being stopped doesn't get that information. You can detect if an app is currently closed by using the BroadcastReceiver. Here's a pretty decent tutorial on using that: http://saigeethamn.blogspot.com/2009/10/android-developer-tutorial-part-11.html

Categories : Android

Removing duplicates from the Google Apps Script ScriptDB
I had to recreate many bds too because of that appscript bug. I deleted the entire bd and recreated it by hand because I dont trust the possibly still corrupted entries. If its not huge you can dump it on a spreadsheet and manually remove them, then recreate the bd. Its not just dups, you could also have similar objects as they got recreated and later only one gets updated.

Categories : Mongodb

Android Tablerow unwanted row space
Hard to say without testing, but a useful trick to 'debug' complex views like this, is adding background color to relevant subviews (i.e. RelativeLayouts containing your ImageViews), just to check who contains that padding. You may also simplify as much as you can, for instance, you probably wouldn't need to wrap the ImageViews inside RelativeLayouts. That said, my guess is that ImageViews need their scaleType attribute to be set, they'd look something like.- <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="fitXY" android:src="@drawable/tile" android:adjustViewBounds="true" /> There's no need to set padding/margin, as they're 0 by default, and remember that fill_parent is deprecated from API level 8.

Categories : Android

Retrieving the state of Google Chrome preferences, like "Continue running background apps when Google Chrome is closed"?
You cannot read the state of Google Chrome preferences. Google does not provide an API for Chrome, "system" settings, and Google blocks general reads to the file system (You can read sandboxed files only). isAllowedIncognitoAccess()Doc just reports wether the extension is allowed in "Incognito mode", AKA "porn mode". It has nothing to do with whether background apps run. Currently, Chrome's high-level settings are stored in a JSON file named Local State in the User Data folder1. If you can find a way to read this file, the "Continue running background apps when Google Chrome is closed" setting is stored in the background_mode property. 1 The User Data folder defaults to: Windows XP: %AppData%..Local SettingsApplication DataGoogleChromeUser Data Windows Vista/7/8: %Loca

Categories : Google Chrome

Android: Unwanted left/right margins on Nexus 10 in landscape mode
Ok, so it was embarrassingly straightforward! The margin for the Nexus 10 in landscape mode is taken from the 'values-sw720dp-land' resource folder, which declares a much larger value: <!-- Customize dimensions originally defined in res/values/dimens.xml (such as screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. --> <dimen name="activity_horizontal_margin">128dp</dimen> After nearly a year of lurking on SO and finding answers to all my questions, the first one I finally decide to ask properly turns out to be as trivial as this...

Categories : Android

Camera preview shows unwanted tiles only on Android 4.2.2 (S4, full HD screen)
This looks like a possible bug in the Android platform on Samsung's S4 devices with that particular Android version. My experience tells me that it's a very real possibility. It could also be that you do something wrong in your app that only causes actual problems on that version (and maybe even only on that device), but there is no indication of that from what you tell. Android 4.2.2 should be backwards compatible with 4.0.3, so in general it should work on the later version too, of course. I would advice you (or anyone in the same situation) to try it out on other devices with the same Android version if possible. Also, double check that you're not violating anything in the Android API documentation. Please add more info about what you're doing and how if you need more detailed answers

Categories : Android

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

Can we use Google Android in-App purchase in Android apps published on Samsung Store?
For samsung app Store you need to use Plasma.... for more ref. visit http://developer.samsung.com/distribute/monetization http://developer.samsung.com/android/technical-docs/In-App-Purchase-using-Plasma-in-Android This may help you

Categories : Android

How to get android play store installed apps packages through android code?
You should use getInstallerPackageName, it retrieves the package name of the application that installed a package. This identifies which market the package came from: http://developer.android.com/reference/android/content/pm/PackageManager.html#getInstallerPackageName%28java.lang.String%29 For the Play Store, you should check if it comes from com.android.vending!

Categories : Android

How to check whether an application is being closed in android
From the Android Developer Guide: There are a few scenarios in which your activity is destroyed due to normal app behavior, such as when the user presses the Back button or your activity signals its own destruction by calling finish(). The system may also destroy your activity if it's currently stopped and hasn't been used in a long time or the foreground activity requires more resources so the system must shut down background processes to recover memory. When you switch between apps by pressing the home button, Android pauses the activity and resumes it when you return to the activity. For the most part, the OS decides when to quit an application so it wouldn't make sense for you to log when an activity is destroyed. I would suggest overriding the onPause() or the onSto

Categories : Android

Get closed canvas shape in android
Try the following way. public class MainActivity extends Activity { private ArrayList<Path> _graphics = new ArrayList<Path>(); private Paint mPaint; float x1, x2, y1, y2; boolean isDraw; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new DrawingPanel(this)); System.out.println(x1 + " " + x2 + " " + y1 + " " + y2); mPaint = new Paint(); mPaint.setDither(true); mPaint.setColor(0xFFFFFF00); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(3); } class DrawingPanel extends SurfaceView implements SurfaceHolder.Callback

Categories : Android

Dialog gets closed on screen rotation android
This is because your activity is recreated on orientation change. See: Activity Life-cycle Management [developer.android.com]. UPDATE: The dialog for the list preference is a part of the preference hierarchy and is created by android. Hence it is saved and restored by android in the PreferenceActivity's onSaveInstanceState() and onRestoreInstanceState() calls. Whereas you are creating the dialog for your Preference "prefAlert" and must save and restore in your class' onSaveInstanceState and onRestoreInstanceState methods. See this: Recreating an activity [developer.android.com]

Categories : Android

Connection closed before request completed - Android ION
If you don't mind checking, I think the underlying cause of this bug was fixed recently: https://github.com/koush/ion/issues/18 https://github.com/koush/AndroidAsync/issues/55 Was related to SSL.

Categories : Android

Android BOOT_COMPLETED not received when application is closed
was struggling with the same problem, the reason is you are using Log.d to track you application in logcat, unfortunately when you restart your phone the application is receiving the BOOT_Complete but you can't see it because it's not logging to logcat. try making a Toast with some text instead of Log.d to make sure if BOOT_COMPLETED is or is not received. hope this Help.

Categories : Android

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

Android Apps Debugging in Android Studio
in click Edit Configurations then change the yellow circled to USB devices

Categories : Android

Android : Does a Service gets killed when an Activity in the same process is closed?
Services in Android run as long as it is not closed by OURselves or the SYSTEM Or by the user. Does the running service get closed if all the activities in my app are closed ? If you used startService() to start the service, no. If you used bindService() and called unbindService() a matching number of times, then yes. And i also came to know that both an Activity and a Service can't be run at the same time on the main process, Is this true ? An Activity is an object. A Service is an object. Objects do not "run" in Java (or any other OO language that I can think of). Methods run. For my scenario which design is best ? Activity+Service in same process, Activity+ IntentService in same process, Activity, Service in diff processes ? "Activity+Service in same process".

Categories : Android

Android google map v2 is not working after the application is closed and reopened
I think that the best place would be to create a class that extends SupportMapFragment, and initialise the map in: @Override public void onAttach(Activity activity) Besides that though, I think if you initialise the map in onResume of the container activity it should be ok. But if you by initialising you mean adding the mapfragment to the activity, I would suggest doing it in the xml or in your activity's onCreate. Just my two pennies.

Categories : Android

Android Twitter default share-force closed
This is what I do to share stuff with twitter: tweetButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub initShareIntentTwi("twi"); } }); private void initShareIntentTwi(String type) { boolean found = false; Intent share = new Intent(android.content.Intent.ACTION_SEND); share.setType("text/plain"); // gets the list of intents that can be loaded. List<ResolveInfo> resInfo = getPackageManager().queryIntentActivities( share, 0); if (!resInfo.isEmpty()) { for (ResolveInfo info : resInfo) { if (info.activityInfo.packageName.toLowerCase().contains(type) || info.activityInfo.nam

Categories : Android

IOException: read failed, socket might closed - Bluetooth on Android 4.3
I have finally found a workaround. The magic is hidden under the hood of the BluetoothDevice class (see https://github.com/android/platform_frameworks_base/blob/android-4.3_r2/core/java/android/bluetooth/BluetoothDevice.java#L1037). Now, when I receive that exception, I instantiate a fallback BluetoothSocket, similar to the source code below. As you can see, invoking the hidden method createRfcommSocket via reflections. I have no clue why this method is hidden. The source code defines it as public though... Class<?> clazz = tmp.getRemoteDevice().getClass(); Class<?>[] paramTypes = new Class<?>[] {Integer.TYPE}; Method m = clazz.getMethod("createRfcommSocket", paramTypes); Object[] params = new Object[] {Integer.valueOf(1)}; fallbackSocket = (BluetoothSocket) m.invoke(

Categories : Android

Android - attempt to re-open an already-closed object: SQLiteQuery using loaderManager
Fixed it: @Override public void onLoadFinished(Loader cursorLoader, Cursor cursor) { if(!cursor.isClosed()){ adapter.swapCursor(cursor); } } I do have another problem now, my list does not get updated automatically...

Categories : Android

Send notification from a service running in background after application is closed in Android
Notification: NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification.Builder builder = new Notification.Builder( getApplicationContext()); Intent intent = new Intent(getApplicationContext(), YourActivity.class); intent.setAction("notification"); PendingIntent pendingIntent = PendingIntent.getActivity( getApplicationContext(), 0, i intent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT); builder.setSmallIcon(R.drawable.app_icon) .setContentTitle("Next Appoinment....") .setContentText(response)

Categories : Android

Send Push notifications to iOS/Android on closed WiFi nework (no internet connection)
E.g. an on premises push notification service that can be used to send a notification to a users phone based on an event that is triggered by our server? With respect to Android, the answer is "not really". Your options are: Implement your "push" mechanism in the form of some message queue, where the devices poll looking for messages every so often, or Use a WakeLock and WifiLock to keep the device (and WiFi) powered on constantly, then use something like MQTT for the push message Either of these will be bad for the battery, though the first one is more configurable in terms of power drain (e.g., if you only check for messages once per hour, it won't be bad). The reason why GCM can keep the power drain low is because of special hooks for mobile data connections within the OS and

Categories : Android

Android - Bluetooth Printer not finished printing but throws IOException: Socket Closed
What happpend if you put a Thread.sleep(2000) right before the socket.close()? I work on bluetooth SPP and I had the same issue (Socket close before the end of data transfer). I think that the broadcast of socket.close() is faster than the transmission of the data, then all the data are not analyze by the BT printer when the close request is send

Categories : Android

How to draw closed spline 3D (closed curve 3d) through unordered list of points3D. How to arrange points3D?
It sounds like you're looking for the Concave Hull of the data set. Unfortunately, I don't know of any pre-canned algorithms, but the link references a paper that another developer was starting from, as well as some sample code, so maybe that'll help you in the right direction.

Categories : C#

Is there any workaround to run JRE apps on android?
looks like there is one coming soon: http://www.apogee.com/products/cjre-a The first JRE4A scheduled for release in mid march 2014 is targeted at wireless and “connected” devices based on ARM Cortex-A8, Cortex-A9, Cortex-A15, or similar ARM processors running Android 4.1.x, 4.2.x, 4.3.x, or 4.4, such as smart phones, tablets, other "hand-helds", home gateways, etc. The JRE4As targeted at devices based on x86, MIPS, and PowerPC processors running Android 4.2.x, 4.3.x, 4.4, or a subsequent release of Android would follow in 2nd quarter of 2014. This first JRE4A will be available for download from Google Play as a single Android-compatible “.apk” file, which will run, after installed on a given Android device, side-by-side with its Android on “top” of it

Categories : Android

Sms Notification from Android Apps
then try following method: //---sends an SMS message to another device--- private void sendSMS(String phoneNumber, String message) { SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage(phoneNumber, null, message, null, null); } And call that method for an sms send: sendSMS(“5556”, “Hello my friends!”); (Of course, that would also mean you would have to pay the fees incurred in sending all those SMS messages…)

Categories : Android

Streaming audio between apps in Android
I do not know about the streaming audio API support so I'll not touch this case. As for writing data to a file and let other application to read it - this is a possible case how to solve your problem. As for calling service through AIDL and using intents, I do not think that this is a good solution. The problem is that Binder has a limitation over the size of the data (1MB) that can be passed in a transaction. To my point of view, the best solution (especially if you're working in native) is to use AshMem. This is a shared memory driver developed specifically for Android. Thus, in your service you create a shared memory region and pass the reference to it into your client app that reads information from the this memory.

Categories : Android

Can we convert Android Apps to J2ME
There is no such tool available which can directly convert your Android application into Java ME application. You must need to manually create one Java ME application. There are some reasons behind it. Few of are .. In J2ME, Midlet interop (no "intents") Impossible to implement alpha-blending, canvas transformation, etc. 3rd party library integration which are only compatible with Android. Possible things are, Drawable to refer Layout XML files rendering Most of code logic Web Service and Bean classes

Categories : Android

Sort Android apps alphabetically?
From what I understand, you want to sort a list of PackageInfo objects alphabetically by name. I would start here. What you want to do is create a custom Comparator for the ArrayList you called installedapps and then sort is using Collections.sort(..). The property of PackageInfo you should use for sorting is p.packageName which is the fully qualified name of the Application (you can use regular expressions to isolate the last piece of the package name). An example of isolating cosmetic properties of apps you can find here.

Categories : Android

List out the installed apps android
Try this: public class AppList extends Activity { private ListView lView; private ArrayList results = new ArrayList(); @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); lView = (ListView) findViewById(R.id.list1); PackageManager pm = this.getPackageManager(); Intent intent = new Intent(Intent.ACTION_MAIN, null); intent.addCategory(Intent.CATEGORY_LAUNCHER); List list = pm.queryIntentActivities(intent, PackageManager.PERMISSION_GRANTED); for (ResolveInfo rInfo : list) { results.add(rInfo.activityInfo.applicationInfo .loadLabel(pm).toString()); Log.w("Installed Applications", rInfo.activityInfo.applicationInfo .loadLabel(pm).toString()); } lView.setAdapter(new ArrayAdapte

Categories : Java

Where is stored the output of Log in android apps?
If you're Android device is connected to Eclipse then you can view your logs in real time by opening LogCat: Window -> Show View -> Other... -> LogCat To view your logs over a WiFi connection you can do the following: 1) Open the command prompt and navigate to your sdk/platform-tools/ folder. 2) Type adb tcpip 5555 3) Type adb connect :5555 4) At this point you unplug your device and type adb logcat 5) At times, such as unplugging/plugging into a USB device, the logcat will become disconnected, just redo steps 3 & 4.

Categories : Android

Developing android apps with Xamarin
You specifically asked to: create an android app If that is your only requirement, and you have no previous experience in C# development, you should stick to developing the application using JAVA and Android SDKs. After all, it is free of charge. However, Why do you want to limit yourself to Android platforms? If there is a chance that you might want to expand to other platforms in the future, you should IMHO start preparing for it right now, and create a cross-platform application. C# is a powerful language, Xamarin products are mature and of high quality and Xamarin community is big enough for wide support. There are no restrictions that I know of, and everything that you can do with native Java you can also achieve with Xamarin.Android. Also, in case you will ever find any rest

Categories : Dotnet

How to add soundButton(on&off) on a activity in android apps?
You can do simple google search to find tons of samples for adding button. However for playing sound file check out the MediaPlayer class. Button startBtn, stopBtn; //get the reference of Button .... final MediaPlayer mp = new MediaPlayer(); startBtn.onClickListener() { public void onClick(View v) { try { mp.setDataSource(path+"/"+audio.mp3); mp.prepare(); mp.start(); } catch (Exception e) { e.printStackTrace(); } } }; stopBtn.onClickListener() { public void onClick(View v) { if(mp.isPlaying()) { mp.stop(); //hide buttons stopBtn.setVisibiltiy(View.GONE); startBtn.setVisibility(View.GONE); }

Categories : Android

Secure container for apps- Android
I know one solution that runs each app within it's own dalvik VM with a unique ID (uid ref linux) to protect all resources for that app. It makes use of the linux file permissions to protect these resources. The only way to get apps running with the same UID is to sign it with the same publisher key and declare this ID in the manifest. To get resources world readable you have to declare this explicitly when opening the resources within the app. Further more the apps can only access certain system resources if they declare that permission in the manifest. Think of IO operations and so on. These permissions will than be prompted to the user and install time. ... It's called Android :-) Or in other words what more do you search for than what is already provided by the Android system? If you

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.